Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make the status bar white with black icons?

Tags:

android

themes

I want to change the colour of the status bar for my app so that it's white with black icons (instead of the default black with white icons). Is there any way of doing this?

like image 693
Jon Avatar asked Dec 23 '14 15:12

Jon


People also ask

How can I make my status bar color white?

Step 1: After opening the android studio and creating a new project with an empty activity. Step 2: Navigate to res/values/colors. xml, and add a color that you want to change for the status bar.

Why are my status bar icons black?

A recent update to the Google application caused an aesthetic issue with the font and symbols turning black on the notification bar. By uninstalling, reinstalling, and updating the Google application, this should allow the white text/symbols to return to the notification bar on the home screen.

How do I change my status bar appearance?

To customize it, first pull down the slider bar from the top of the screen. Next, tap on the three vertical dots in the top right corner. Now click on Status bar. You're in.


2 Answers

With Android M (api level 23) you can achieve this from theme with android:windowLightStatusBar attribute.

Edit :

Just as Pdroid mentioned, this can also be achieved programatically:

getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);  
like image 107
bugraoral Avatar answered Sep 17 '22 08:09

bugraoral


It is possible to make the white status bar with grey icons e.g. this way for SDK >= 23 (see docs):

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">     <item name="android:windowLightStatusBar">true</item> </style> 

in your styles.xml and set the colorPrimary to white or programmatically:

getWindow().setStatusBarColor(Color.WHITE); 
like image 31
Rammgarot Avatar answered Sep 21 '22 08:09

Rammgarot