Customize the Status Bar
The material theme lets you easily customize the status bar, so you can specify a color that fits your brand and provides enough contrast to show the white status icons. To set a custom color for the status bar, use the
android:statusBarColorattribute when you extend the material theme. By default,
android:statusBarColorinherits the value of
android:colorPrimaryDark.You can also draw behind the status bar yourself. For example, if you want to show the status bar transparently over a photo, with a subtle dark gradient to ensure the white status icons are visible. To do so, set the
@android:color/transparentand adjust the window flags as required. You can also use the
Window.setStatusBarColor()method for animations or fading.
Note: The status bar should almost always have a clear delineation from the primary toolbar, except for cases where you show edge-to-edge rich imagery or media content behind these bars and when you use a gradient to ensure that the icons are still visible.When you customize the navigation and status bars, either make them both transparent or modify only the status bar. The navigation bar should remain black in all other cases. Read more about this in the Design Methods manual.