However, this API is available on or above API 21. I think setStatusBarColor() needs no explanation. SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN helps keep the content from resizing when the system bars hide and show while going in and out of full screen mode. System UI elements are elements like status bar, naviagtion bar etc. What is systemUiVisibility? Using this method, we can control the visibility of the system UI drawn by the system. So, we first remove this flag.įLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS flag tells the system that our window is responsible for drawing the background for system bars. What are these different flags you can apply to a window? If FLAG_TRANSLUCENT_STATUS is enabled, translucent status bar will be shown which we don’t want.
All these windows on a single screen are managed by WindowManager. The navigation bar also has a different window where it draws the back button, the home button etc. The status bar is given a window where the system draws things like time, battery, notification icons etc.
The activity is given a window where it draws the view hierarchy specified by us. Each of these components are given a window to draw themselves into. Each of these components have a different window. What is a Window? When you open any standard app, you would see a status bar, a navigation bar, and the actual activity.