google / accompanist

A collection of extension libraries for Jetpack Compose
https://google.github.io/accompanist
Apache License 2.0
7.43k stars 598 forks source link

Status bar color is not changing #1484

Closed AbdullahJaved-dev closed 1 year ago

AbdullahJaved-dev commented 1 year ago

I am using SystemUiController library to update the system bars color but it working only for navigation bar, not for status bar.

Using this code to update color to black

val systemUiController = rememberSystemUiController()
    val useDarkIcons = !isSystemInDarkTheme()

    DisposableEffect(systemUiController, useDarkIcons) {
        systemUiController.setSystemBarsColor(
            color = Color.Black,
            darkIcons = useDarkIcons
        )
        onDispose {}
    }

Status bar color should be black.

Device: Samsung S10+ Android version 12

Screenshot_20230118_163254_1_30

AbdullahJaved-dev commented 1 year ago

Commented default status bar code from Theme.kt. and it's working now.

alexvanyo commented 1 year ago

Just to confirm, you had to comment out the default status bar code handling in Theme.kt that is created with the Android Studio template?

AbdullahJaved-dev commented 1 year ago

Yes. I had commented the Android Studio template status bar color code in Theme.kt file. And then SystemUIController was working fine.

alexvanyo commented 1 year ago

That's great to know if anyone else is running into issues and troubleshooting, thanks for sharing!

mslalith commented 1 year ago

@alexvanyo Still seeing this. Also the icons are fading away

Commented default status bar code from Theme.kt. and it's working now.

What do you mean by this?

here's my Theme.kt

status_bar.webm

mslalith commented 1 year ago

I believe it's how it is in Android S. Seems to be fine in Android R. I'll have to check with some other versions