Color Android navigation bar according to selected theme


#1

Some device manufacturers including OnePlus and Samsung decided for a default white navigation bar instead of the usual black. This white bar really stands out in dark themes and looks ugly, see this screenshot:

Can we get a colored navigation bar that fits the selected theme, e.g. a black one for the dark themes? This is usually simply done by setting android:navigationBarColor accordingly, e.g. to 0xff000000 for a black navbar.


(Uwe Trottmann) #2

Thanks for the request and even pointing to the solution!

I always dismissed this because I’m not a fan of tampering with system UI (it might break or look bad on some devices).

But I guess after so many requests I’ll have look.


(Uwe Trottmann) #3

Done, let’s see how this plays out once the update ships.


#4

Thanks for the quick response and implementing this suggestion!

For that its worth, more and more Android apps color the navigation bar to fit the general design: Telegram always sets it to pure black [1], WhatsApp makes it black dependent on what screen you are on and even Google Photos and the new Gmail color the bar (pure white in both cases).
So I wouldn’t expect any problems with coloring it.


#5

I’ve just received the beta update. For whatever reason, the color is not applied and the bar stays white on my OnePlus device. Apparently OnePlus Devices fall back to a white navigation bar when one sets it to pure black via styles.xml [1]. Either setting it to an almost-black (e.g. #ff000001) or using getWindow().setNavigationBarColor(0xff000000); does work according to the above link.

I don’t really understand why they intentionally choose this behaviour or haven’t fixed this if it is a bug. The system apps have a pure black navbar when in dark mode, so they must use the second method mentioned above in their own apps.


(Uwe Trottmann) #6

See, see, this is what I was talking about :smiley:

Though avoiding burn-in might be a real concern… :thinking:


(Uwe Trottmann) #7

@Blubbb So did the latest beta fix things?


#8

The latest beta has a black navigation bar for me. Thank you very much!