Example usage for android.view View SYSTEM_UI_FLAG_FULLSCREEN

List of usage examples for android.view View SYSTEM_UI_FLAG_FULLSCREEN

Introduction

In this page you can find the example usage for android.view View SYSTEM_UI_FLAG_FULLSCREEN.

Prototype

int SYSTEM_UI_FLAG_FULLSCREEN

To view the source code for android.view View SYSTEM_UI_FLAG_FULLSCREEN.

Click Source Link

Document

Flag for #setSystemUiVisibility(int) : View has requested to go into the normal fullscreen mode so that its content can take over the screen while still allowing the user to interact with the application.

Usage

From source file:Main.java

public static void hideNavBar(Activity activity) {
    View decorView = activity.getWindow().getDecorView();
    int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
            | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
    decorView.setSystemUiVisibility(uiOptions);
    activity.getWindow().setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
}

From source file:Main.java

public static void hideStatusBar(Activity activity) {
    View decorView = activity.getWindow().getDecorView();
    int uiVisibility = decorView.getSystemUiVisibility();
    decorView.setSystemUiVisibility(uiVisibility | View.SYSTEM_UI_FLAG_FULLSCREEN);
}

From source file:Main.java

public static String systemUIVisibilityString(View theView) {
    int crap = theView.getWindowSystemUiVisibility();

    int duhs[] = { View.SYSTEM_UI_FLAG_LOW_PROFILE, View.SYSTEM_UI_FLAG_HIDE_NAVIGATION,
            View.SYSTEM_UI_FLAG_FULLSCREEN, View.SYSTEM_UI_FLAG_LAYOUT_STABLE,
            View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION, View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN,
            View.SYSTEM_UI_FLAG_IMMERSIVE, View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY };
    String result = "OK: 0";

    for (int duh : duhs) {
        if ((crap & duh) == duh) {
            switch (duh) {
            case View.SYSTEM_UI_FLAG_LOW_PROFILE:
                result += " | SYSTEM_UI_FLAG_LOW_PROFILE";
                break;
            case View.SYSTEM_UI_FLAG_HIDE_NAVIGATION:
                result += " | SYSTEM_UI_FLAG_HIDE_NAVIGATION";
                break;
            case View.SYSTEM_UI_FLAG_FULLSCREEN:
                result += " | SYSTEM_UI_FLAG_FULLSCREEN";
                break;
            case View.SYSTEM_UI_FLAG_LAYOUT_STABLE:
                result += " | SYSTEM_UI_FLAG_LAYOUT_STABLE";
                break;
            case View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION:
                result += " | SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION";
                break;
            case View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN:
                result += " | SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN";
                break;
            case View.SYSTEM_UI_FLAG_IMMERSIVE:
                result += " | SYSTEM_UI_FLAG_IMMERSIVE";
                break;
            case View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY:
                result += " | SYSTEM_UI_FLAG_IMMERSIVE_STICKY";
                break;
            }/*from w ww  . ja va  2s .com*/
        }
    }

    return result;
}

From source file:Main.java

@TargetApi(19)
public static void setUIVisibility(Activity activity) {
    View decorView = activity.getWindow().getDecorView();
    int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
    if (Build.VERSION.SDK_INT >= 16) {
        uiOptions = uiOptions | View.SYSTEM_UI_FLAG_FULLSCREEN;
    }/*w w  w . j  ava  2s. c om*/
    if (Build.VERSION.SDK_INT >= 19) {
        uiOptions = uiOptions | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
    }
    decorView.setSystemUiVisibility(uiOptions);
}

From source file:Main.java

private static void hideBar(Activity context) {
    if (Build.VERSION.SDK_INT < 16) {
        context.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
    } else {//from  w ww .j a v a  2 s .  c om
        View decorView = context.getWindow().getDecorView();
        int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
        decorView.setSystemUiVisibility(uiOptions);
    }
}

From source file:Main.java

@SuppressLint("InlinedApi")
public static void makeFullscreen(Activity activity) {
    //      if (!SkyUtility.isNexus()) return;
    //      if (SkyUtility.isNexusTablet()) return;
    activity.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    if (Build.VERSION.SDK_INT >= 19) {
        activity.getWindow().getDecorView()
                .setSystemUiVisibility(View.SYSTEM_UI_FLAG_IMMERSIVE | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
                        | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
                        | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                        | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
    } else if (Build.VERSION.SDK_INT >= 11) {
        activity.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
    }/*from   w w  w  .  ja  va 2  s  . c  om*/
}

From source file:Main.java

@TargetApi(VERSION_CODES.KITKAT)
public static void hideSystemUI(Activity activity) {
    // Set the IMMERSIVE flag.
    // Set the content to appear under the system bars so that the content
    // doesn't resize when the system bars hideSelf and show.
    View decorView = activity.getWindow().getDecorView();
    decorView.setSystemUiVisibility(//from ww w  .j  a v a2 s  . co m
            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 // hideSelf nav bar
                    | View.SYSTEM_UI_FLAG_FULLSCREEN // hideSelf status bar
                    | View.SYSTEM_UI_FLAG_IMMERSIVE);
}

From source file:Main.java

@TargetApi(19)
public static void setUIVisibility(Dialog activity) {
    View decorView = activity.getWindow().getDecorView();
    int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
    if (Build.VERSION.SDK_INT >= 16) {
        uiOptions = uiOptions | View.SYSTEM_UI_FLAG_FULLSCREEN;
    }//from  w w w .j av a2  s .c om
    if (Build.VERSION.SDK_INT >= 19) {
        uiOptions = uiOptions | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
    }
    decorView.setSystemUiVisibility(uiOptions);
}

From source file:Main.java

public static void onResume(Activity activity) {
    View decorView = activity.getWindow().getDecorView();
    hideSystemUI(decorView);/*  w ww .ja  v a2  s.  c  o  m*/
    decorView.setOnSystemUiVisibilityChangeListener(visibility -> {
        if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) {
            hideSystemUI(decorView);
        }
    });
}

From source file:Main.java

@TargetApi(Build.VERSION_CODES.KITKAT)
public static void setImmersiveStickyWithActionBar(Window w) {
    w.getDecorView()//  ww w.jav  a  2 s.c o  m
            .setSystemUiVisibility(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);

}