Android : status bar color change for API level below 21
Solution 1
Changing the color of statusbar is available from Lollipop
but actually you could change the color of statusbar for Api >= 19
inside the style of value-v19 put
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="MaterialDrawerTheme.Light">
<!-- Customize your theme here. -->
<item name="android:windowNoTitle">true</item>
<item name="android:windowTranslucentStatus">true</item>
.....
</style>
</resources>
the background color of the status bar will became transparent color, and for coloring it you just put a background color in your to your app so the status bar will take that color
hope that was clear and helpful
Solution 2
Changing status bar color feature is only available from Lollipop onwards. Lower OS versions doesn't have this feature. There is no way for you to change the status bar color in pre lollipop devices.
Solution 3
Status bar coloring is not supported till date in latest version of AppCompat v7:23.1.0
too.
Take a look at Android developers blog post
From the post :
On older platforms, AppCompat
emulates the color theming where possible. At the moment this is limited to coloring the action bar and some widgets.
Which means the AppCompat lib will only color status bars on Lollipop and above.
Binil Surendran
Am always act with wisdom, am dosen't make decisions before weighed the pros and cons.
Updated on October 04, 2020Comments
-
Binil Surendran over 3 years
I am trying change status bar color for API level lower than 21.By changing the color primary in Theme style we can change the color in status bar for the API level 21.
I am looking for how to change the status bar color for lower version
Can any one please help me ?
-
ʍѳђઽ૯ท over 8 yearsi'm not agree with this, what about this library? github.com/jgilfelt/SystemBarTint
-
Jayakrishnan Salim over 8 yearsThats not exactly like material design. With that we can create only translucent status bars. And it can be done in only API>=19.
-
RoCkDevstack almost 8 yearsThis is good, how can I changed it's color instead of translucent?
-
TheRealChx101 over 4 yearsYou'd think. Sigh. Sometimes design choices made by Google is puzzling. Like what do they smoke over there?