Android Utililty Methods Screen Full Screen Set

List of utility methods to do Screen Full Screen Set

Description

The list of methods to do Screen Full Screen Set are organized into topic(s).

Method

voidrequestFullscreen(final Activity pActivity)
request Fullscreen
final Window window = pActivity.getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
window.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
window.requestFeature(Window.FEATURE_NO_TITLE);
voidrequestFullscreen(final Activity pActivity)
request Fullscreen
final Window window = pActivity.getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
window.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
window.requestFeature(Window.FEATURE_NO_TITLE);
voidsetFullScreen(Activity activity)
set Full Screen
toggleFullScreen(activity, true);
voidsetFullScreen(Activity activity)
set Full Screen
activity.getWindow().setFlags(
        WindowManager.LayoutParams.FLAG_FULLSCREEN,
        WindowManager.LayoutParams.FLAG_FULLSCREEN);
voidtoggleFullScreen(Activity activity, boolean isFull)
toggle Full Screen
Window window = activity.getWindow();
WindowManager.LayoutParams winParams = window.getAttributes();
final int bits = WindowManager.LayoutParams.FLAG_FULLSCREEN;
if (isFull) {
    winParams.flags |= bits;
} else {
    winParams.flags &= ~bits;
window.setAttributes(winParams);
voidsetupFullScreen(Window window)
setup Full Screen
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
    window.getDecorView().setSystemUiVisibility(
            View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                    | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                    | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                    | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
                    | View.SYSTEM_UI_FLAG_FULLSCREEN
                    | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
...