Skip to content Skip to sidebar Skip to footer

Compose - Custom Materialtheme Colors Not Working?

I want to custom colors system using Compose, but it isn't working. It effected by colors in themes.xml. Activity class DemoComposeMainActivity : AppCompatActivity() { override

Solution 1:

The statusbar color is based on the android:statusBarColor defined in your app theme. If you want to change the statusBar color you can use the accompanist library.

Something like.

valsystemUiController= rememberSystemUiController()
        valuseDarkIcons= MaterialTheme.colors.isLight

        SideEffect {
            systemUiController.setSystemBarsColor(
                color = Color.Transparent,
                darkIcons = useDarkIcons
            )

            // setStatusBarsColor() and setNavigationBarsColor() also exist
        }

Post a Comment for "Compose - Custom Materialtheme Colors Not Working?"