4

I've just realised that it isn't possible to change the status bar color via appcompat on Android Versions below Lollipop. I am currently running Android Kitkat 4.4.2 and received an update for an application, here's a screenshot

enter image description here

My question is, how did they manage to change the status bar color without using appcompat on a device running a lower version than Lollipop?

How is it possible to change the color?

user2410644
  • 3,693
  • 6
  • 35
  • 57
  • 1
    I am currently running Android 4.4.2 and the twitch app somehow managed to change the status bar color, I just wondered how, because normally it should be only available in Android Lollipop – user2410644 Nov 05 '14 at 21:50
  • @AlexLockwood : The accepted answer for this question ended up in saying that it isn't possible to change the status bar color via appcompat. I've got an application that changes the status bar color and wondered how it was achieved – user2410644 Nov 05 '14 at 21:54
  • Can you post a screenshot of the twitch app? – Alex Lockwood Nov 05 '14 at 21:59
  • @AlexLockwood Yes I've just edited my post – user2410644 Nov 05 '14 at 22:02
  • 1
    Twitch is using kit kat apis to achieve that effect. It is making the status bar translucent... It is not actually setting its color. – Alex Lockwood Nov 05 '14 at 22:05
  • 1
    @AlexLockwood is correct. You cannot actually _change the color of the status bar_, but you can _draw underneath_. – matiash Nov 05 '14 at 22:14
  • Ok thank for your replies! – user2410644 Nov 05 '14 at 22:15
  • Take a look at this tutorial: http://www.murrayc.com/permalink/2014/10/28/android-changing-the-toolbars-text-color-and-overflow-icon-color/ Edit: Important for your question is, that you use the appcompat library in the latest version (21). You can find the documentation here: https://developer.android.com/tools/support-library/features.html#v7-appcompat – Lukas Nov 05 '14 at 21:48

2 Answers2

0

Changing the Status Bar color in pre-Lollipop(5.0) is not possible by setting colorPrimaryDark.

On older platforms, AppCompat emulates the color theming where possible. At the moment this is limited to coloring the action bar and some widgets.

See this

Also see this

Community
  • 1
  • 1
Darish
  • 8,638
  • 2
  • 37
  • 57
0

I have used this library to change the status bar color in my application. For me it has caused complications, so carefully test your UI before you ship with it, but it does the job for KitKat. To the best of my knowledge, it isn't possible to change the system bar color pre OS 19.

https://github.com/jgilfelt/SystemBarTint

laochiv
  • 2,343
  • 1
  • 12
  • 17