Make full screen using android provided api

From wizarPOS
Revision as of 06:06, 3 December 2018 by Mahong (talk | contribs) (Created page with "For hiding the status bar and navigation bar, android provide the '''Immersive Mode'''. Use this way, the third-party app can implement full screen. == Permission == android...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

For hiding the status bar and navigation bar, android provide the Immersive Mode. Use this way, the third-party app can implement full screen.

Permission

 android.permission.CLOUDPOS_REAL_FULLSCREEN

The app declares the permission in the manifest.

Snippet code

//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.