androidandroid-5.0-lollipopandroid-stylesandroid-statusbar

Android statusbar icons color


I was wondering if it's possible to change the statusbar icons colour (not the statusbar colour, colorPrimaryDark) enter image description here Let's say I want this statusbar with:
<item name="colorPrimaryDark">@android:color/white</item>

and the icons in black, is it possible?

Thanks.

EDIT:

New in the M developer preview: windowLightStatusBar. Flipping this on in your theme tells the system to use a dark foreground, useful for lighter colored status bars. Note the M preview seems to have a bug where notification icons remain white, while system status icons correctly change to semitransparent black.

from: Roman Nurik Google+ post enter image description here


Solution

  • Not since Lollipop. Starting with Android 5.0, the guidelines say:

    Notification icons must be entirely white.

    Even if they're not, the system will only consider the alpha channel of your icon, rendering them white

    Workaround

    The only way to have a coloured icon on Lollipop is to lower your targetSdkVersion to values <21, but I think you would do better to follow the guidelines and use white icons only.

    If you still however decide you want colored icons, you could use the DrawableCompat.setTint method from the new v4 support library.