There is also a medium article written by me on this same thing. https://pa1tirumani.medium.com/how-to-get-your-activity-to-occupy-full-screen-on-android-9df99b641185
The Visibility flags that are employed in achieving various levels of full screen activity
SYSTEM_UI_FLAG_FULLSCREEN
: Hide the status barSYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
: Let the layout expand into status barSYSTEM_UI_FLAG_LAYOUT_STABLE
: Avoid abrupt layout changes during toggling of status and navigation barsSYSTEM_UI_FLAG_HIDE_NAVIGATION
: Hide the navigation barSYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
: Let the layout expand into navigation bar
The Theme Attributes employed in achieving various levels of full screen activity
windowActionBar
: Set to false to remove the action barwindowNoTitle
: Set to true to remove the annoying window titleandroid:windowLayoutInDisplayCutoutMode
: Set toshortEdges
to let the layout expand to the front camera notch in both portrait and landscape modes
I have added the commits sequentially increasing the level of full screeness. You can track the corresponding changes and their effects below
- commit: https://github.com/pavan142/FullScreenExperiments/commit/2c004dae7e611555b0c442391cebcf4ab4cdffa3
- commit: https://github.com/pavan142/FullScreenExperiments/commit/28e3f51d400d70bb9ab706ed30b5d280878de5e0
- commit: https://github.com/pavan142/FullScreenExperiments/commit/0113c0f859b16a33599b7e5e91f5146b34626491