4
Just you define how true
the property windowLightStatusBar
in the style inside the file styles.xml
. This way, icons will be changed to gray (no custom colors). See:
<item name="android:windowLightStatusBar">true</item>
Note: This only works from the API 23. For example: values-v23/styles.xml
. Or you can enter the property targetApi
being like 23 in this way:
<item name="android:windowLightStatusBar" tools:targetApi="23">true</item>
Picture of Roman Nurik Google+ post
It is also possible to do this programmatically, see:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
View decor = getWindow().getDecorView();
if (shouldChangeStatusBarTintToDark) {
decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
} else {
decor.setSystemUiVisibility(0);
}
}
Note that you first need to check the SDK version you are using.
perfect Ack Lay, I’ll check.
– afnascimento
It worked perfectly, but would have some option to set the color of the icons instead of the gray pattern ?
– afnascimento
@afnascimento only Ligth and dark by what I’ve read. I think too much customization is bad, because it ends up leaving too much of the pattern.
– viana
Roger @Acklay, thanks for your help
– afnascimento
How do I validate ? obg
– afnascimento