As apps with targetSdk 35 are edge-to-edge by default on Android 15, so I encountered a problem with navigation bar and status bar icons colors.
When running my app on android 15, navigation bar buttons and status bar icons colors are dark and not visible. Is there a way to change its color for some pages of my app? (As I also have pages with light background, so dark icons will be ok for them)
EDIT
For making status bar icons dark or light:
val systemUiController = rememberSystemUiController()
LaunchedEffect(Unit) {
systemUiController.setStatusBarColor(
color = Color.Transparent,
darkIcons = true // or false
)
}
But for changing navigation bar buttons colors I haven’t found any way.
you can use the enableEdgeToEdge()
to change the color similar to this
enableEdgeToEdge(statusBarStyle = SystemBarStyle.dark(Color.DKGRAY), navigationBarStyle = SystemBarStyle.dark(Color.DKGRAY))
just replace the color with your purple color
1
You can use windowLightStatusBar in your theme like below
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimary</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:statusBarColor">@color/white</item>
<!--if status bar color is light then true, if statusbar color is dark then make it false-->
<item name="android:windowLightStatusBar">true</item>
</style>
apply these theme in your menifest in application tag.
Hope this works. 🙂
1