How to Implement Full Screen Mode Using Android APIs: Difference between revisions

From wizarPOS
No edit summary
Line 1: Line 1:
For hiding the status bar and navigation bar, android provide the '''Immersive Mode'''. Use this way, the third-party app can implement full screen.
To hide the status bar and navigation bar, Android provides immersive mode. In this way, third-party applications can achieve full screen.
== Permission ==
== Permission ==
   android.permission.CLOUDPOS_REAL_FULLSCREEN
   android.permission.CLOUDPOS_REAL_FULLSCREEN
The app declares the permission in the manifest.
The application declares permissions in the manifest.


== Snippet code ==
== Code snippet ==
<syntaxhighlight lang="java">
<syntaxhighlight lang="java">
//statusBar,navigationBar are all not display
//statusBar,navigationBar are all not display

Revision as of 10:54, 15 March 2020

To hide the status bar and navigation bar, Android provides immersive mode. In this way, third-party applications can achieve full screen.

Permission

 android.permission.CLOUDPOS_REAL_FULLSCREEN

The application declares permissions in the manifest.

Code snippet

//statusBar,navigationBar are all not display
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN);

//statusBar is display, navigationBar is not display
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_VISIBLE);

Download

Please download the whole demo.