Example usage for android.view View setSystemUiVisibility

List of usage examples for android.view View setSystemUiVisibility

Introduction

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

Prototype

public void setSystemUiVisibility(int visibility) 

Source Link

Document

Request that the visibility of the status bar or other screen/window decorations be changed.

Usage

From source file:Main.java

public static void enter(View view) {
    view.setSystemUiVisibility(view.getSystemUiVisibility() | SYSTEM_UI_IMMERSIVE);
}

From source file:Main.java

public static void exit(View view) {
    view.setSystemUiVisibility(view.getSystemUiVisibility() & (~SYSTEM_UI_IMMERSIVE));
}

From source file:Main.java

public static void showSystemUi(View view) {

    view.setSystemUiVisibility(SYSTEM_UI_BASE_VISIBILITY);
}

From source file:Main.java

public static void addFlags(View view, int flags) {

    view.setSystemUiVisibility(view.getSystemUiVisibility() | flags);
}

From source file:Main.java

public static void clearFlags(View view, int flags) {

    view.setSystemUiVisibility(view.getSystemUiVisibility() & ~flags);
}

From source file:Main.java

public static void setSystemUiInVisible(Activity activity) {
    View decor = activity.getWindow().getDecorView();
    decor.setSystemUiVisibility(decor.getSystemUiVisibility() & ~FLAG_IMMERSIVE);
}

From source file:Main.java

public static void setSystemUiVisible(Activity activity) {
    View decor = activity.getWindow().getDecorView();
    decor.setSystemUiVisibility(decor.getSystemUiVisibility() | FLAG_IMMERSIVE);
}

From source file:Main.java

private static void hideSystemUI(View view) {
    view.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);
}

From source file:Main.java

@TargetApi(VERSION_CODES.KITKAT)
public static void showSystemUI(Activity activity) {
    View decorView = activity.getWindow().getDecorView();
    decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
            | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
}

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(
            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);
}