1

I made a full screen dialog using Jetpack compose but every time i try to change status bar and navigation bar color, i get a strong gray overlay that makes every color i chose, almost dark grey.

I've already tried to set custom style in styles.xml file and used the systemUi controller to change colors with the following code:

    val systemUiController = rememberSystemUiController().apply {
        setNavigationBarColor(navigationBarColor)
        setStatusBarColor(statusBarColor)
    }

Nothing really worked. What can i do?

androidexpert35
  • 319
  • 1
  • 10
  • Check this out https://stackoverflow.com/questions/65243956/jetpack-compose-fullscreen-dialog – Zain Jan 27 '23 at 14:15

1 Answers1

0

I had the similar issue, and have find the solution:

By default statusBar has a layer with 30% opaque black color even if color has been set to transparent.

private val BlackScrim = Color(0f, 0f, 0f, 0.3f) // 30% opaque black
private val BlackScrimmed: (Color) -> Color = { original ->
BlackScrim.compositeOver(original)
}

It the setNavigationBarColor you need to change transformColorForLightContent.

Set Transperent color or another if needed instead black.

private val noScrimmed: (Color) -> Color = { original ->
Color.Transperent.compositeOver(original)
}
setNavigationBarColor( transformColorForLightContent = noScrimmed)
Mariya
  • 1