Day021 — Hide Status Bar

https://github.com/jacky-ttt/CodingEveryday

I want to build an android app that can take over all the visible space on a device, which means that its content will take up the whole screen with status bar and navigation bar(if there is one) disappeared. Those disappeared system bar should be not able to re-appear unless my app tells the system to.

After researching for a few hours, I cannot find a way to 100% achieve the requirements without rooting my phone. The closest thing I could get is that the app goes fullscreen with “immersive” mode on. When user swipes down from the top of the screen, the status bar and navigation bar will re-appear and disappear again after a very short instant. User will definitely see the two apps flash in and out. The method is not perfect at all, but it, at least, could stop the appeared status bar to expand more to reveal the notification drawer.

I am testing my project on android 4.4.2, 5.1.1 and 7.0.1

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — —

How to hide status bar:

How to hide navigation bar:

Immersive / Immersive-sticky mode

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — —

How to make the app overlay other apps on >=23

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — —

How to meet my requirements as close as possible: