I am trying to reproduce the behaviour of Google Calendar application:
but I have not found a way to change the status text color. If i set the colorPrimaryDark as white I cannot see the icons neither text of status bar due their color is white as well.
Is there any way to change the status bar text color?
Thanks in advance
Try this once.
In your activity
onCreate()
method, paste the following code.Note: color_red - is the status bar colour.
As previous, the SYSTEM_UI_FLAG_LIGHT_STATUS_BAR do the work in my case, don't forget to set for higher than API 22.
add this to oncreate after the setContentView:
I'm not sure what API level your trying to target, but if you can use API 23 specific stuff, you can add the following to your AppTheme styles.xml:
when
android:windowLightStatusBar
is set to true, status bar text color will be able to be seen when the status bar color is white, and vice-versa whenandroid:windowLightStatusBar
is set to false, status bar text color will be designed to be seen when the status bar color is dark.Example:
It works for me
it's very simple:
and vice versa:
you can do that programmatically like this answer
just add this