Hi, I followed the Jetpack Compose Theming Codelab...
# compose
n
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
Copy code
MaterialTheme {
    window.statusBarColor = MaterialTheme.colors.surface.toArgb()
}
l
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
Thanks @manueldidonna and @Louis Pullen-Freilich [G], I'll experiement with your suggestions! 😊
👍 1