Statusbar color is by default the color assigned to colorPrimaryDark
.
In versions below 21 it is only possible to change it by changing the colorPrimaryDark
. Which means that every component that uses that color has also changed it.
In equal or higher versions it is possible to do it in the application style using android:statusBarColor
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:statusBarColor">#ff00</item>
</style>
</resources>
or, via code
getWindow().setStatusBarColor(Color.RED);