Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - Fully transparent status bar with non transparent navigation bar

I have been looking for a way to re-color the navigation bar while the status bar is fully transparent (not translucent). Getting the status bar to be completely transparent requires the layout flags to be set to NO_LIMITS but that also makes the navigation bar lose its color. Is there any way to achieve this?

like image 978
Matty De Bie Avatar asked Jun 25 '16 06:06

Matty De Bie


People also ask

How do I hide the bars on my Android?

Way 1: Touch “Settings” -> “Display” -> “Navigation bar” -> “Buttons” -> “Button layout”. Choose the pattern in “Hide navigation bar” -> When the app opens, the navigation bar will be automatically hidden and you can swipe up from the bottom corner of the screen to show it.


1 Answers

If you do not need the status bar text to be dark, the following works.

        getWindow().getDecorView().setSystemUiVisibility(
                View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                        | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);

And change the navigation bar color as @JaviChaqués suggest.

like image 58
Sira Lam Avatar answered Sep 18 '22 15:09

Sira Lam