Briscoooe Briscoooe - 6 months ago 24
Android Question

How to change status bar color to match app in Lollipop? [Android]

In the new lollipop update I noticed that with the native Google apps the color of the status bar changes to match the action bar on the app you're running. I see it's on the Twitter app also so I'm guessing it's not exclusively Google who can do it.

Does anyone know how to do this if it is possible?


To change status bar color use setStatusBarColor(int color). According the javadoc, we also need set some flags on the window.

Working snippet of code:

Window window = activity.getWindow();

Keep in mind according Material Design guidelines status bar color and action bar color should be different:

  • ActionBar should use primary 500 color
  • StatusBar should use primary 700 color

Look at the screenshot below:

enter image description here