https://kotlinlang.org logo
#compose
Title
# compose
n

Nat Strangerweather

09/16/2020, 4:04 PM
Hi, I followed the Jetpack Compose Theming Codelabs tutorial to the letter but my status bar is still purple. Any ideas what I need to do? I would like it to be white in LightTheme and black in DarkTheme...
m

manueldidonna

09/16/2020, 4:24 PM
Copy code
MaterialTheme {
    window.statusBarColor = MaterialTheme.colors.surface.toArgb()
}
l

Louis Pullen-Freilich [G]

09/16/2020, 4:25 PM
You may also want to consider setting it in XML, so when the app is first launched it has the correct status bar color, instead of changing once Compose runs
Copy code
<item name="android:statusBarColor">@color/status_bar</item>
Although then there isn't a great way to share colors between the XML and the rest of your theme in Compose
n

Nat Strangerweather

09/16/2020, 4:27 PM
Thanks @manueldidonna and @Louis Pullen-Freilich [G], I'll experiement with your suggestions! 😊
👍 1