Giter VIP home page Giter VIP logo

Comments (6)

skydoves avatar skydoves commented on August 27, 2024 2

They @Breens-Mbaka, Balloon doesn't apply any Compose theme (Material, Material3, or custom themes), due to providing flexibility to users. So you should apply background color or text color depending on your theme.

balloonContent = {
 Box(modifier = Modifier.background(MaterialTheme.colors.background)) {
  Text(
      color = //
   )
 }
}

The most recommended way is setting the colors when you build the Balloon.Builder like the example below:

      val background = MaterialTheme.colors.background
      val textColor = if (isSystemInDarkTheme()) {
        Color.White
      } else {
        Color.Black
      }

      val builder = rememberBalloonBuilder {
        setBackgroundColor(background)
        setTextColor(textColor)
        setArrowSize(10)

from balloon.

Breens-Mbaka avatar Breens-Mbaka commented on August 27, 2024 1

Thanks @skydoves it has worked. I propose maybe this can be explicitly added to the README if it doesn't exist, so that people who have a challenge like mine will be helped and avoid raising the same issue again. What do you think ?

from balloon.

skydoves avatar skydoves commented on August 27, 2024

Hey @Breens-Mbaka, would you describe the details? It would be good if you can contain several code snippets and the result (screenshot). Also, do you use Compose or XML?

from balloon.

skydoves avatar skydoves commented on August 27, 2024

The demo project works well in dark theme since I've only used dark theme on my devices.

from balloon.

Breens-Mbaka avatar Breens-Mbaka commented on August 27, 2024

Hi @skydoves I'm using Compose and the issue comes up when I change from light theme to dark theme.

here is the code and screenshot of the balloon not adapting to the dark theme:

Screenshot 2024-06-24 at 08 44 19 Screenshot 2024-06-24 at 08 51 34

from balloon.

skydoves avatar skydoves commented on August 27, 2024

Hey @Breens-Mbaka, thank you for your report and feedback!

from balloon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.