How to change style of status bar elements in android (Material design). I wanted to do something like this...I want to change color of time and battery not only the background of the status bar
Asked
Active
Viewed 815 times
0

shankey
- 343
- 2
- 9
-
http://stackoverflow.com/questions/26474125/android-4-4-translucent-status-and-navigation-bars-style-on-android-5-0 – Maheshwar Ligade May 04 '16 at 07:52
2 Answers
0
Just add this in you styles.xml. The colorPrimary is for the action bar and the colorPrimaryDark is for the status bar.
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="android:colorPrimary">@color/primary</item>
<item name="android:colorPrimaryDark">@color/primary_dark</item>
</style>
This picture from developer android explains more about color pallete. You can read more on this link.
0
in AndroidMainFest
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
in values/style.xml
<style name="AppTheme.NoActionBar" parent="Theme.AppCompat.Light.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowEnableSplitTouch">false</item>
<item name="android:splitMotionEvents">false</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@color/color_bg_splash</item>
</style>

Nguyễn Trung Hiếu
- 2,004
- 1
- 10
- 22