Example usage for android.widget FrameLayout setSystemUiVisibility

List of usage examples for android.widget FrameLayout setSystemUiVisibility

Introduction

In this page you can find the example usage for android.widget FrameLayout 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:com.sabaibrowser.UI.java

protected void setImmersiveFullscreen(boolean enabled) {
    FrameLayout decor = (FrameLayout) mActivity.getWindow().getDecorView();
    int systemUiVisibility = decor.getSystemUiVisibility();
    final int bits = 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;
    if (enabled) {
        systemUiVisibility |= bits;/* ww w .ja v a 2 s . com*/
    } else {
        systemUiVisibility &= ~bits;
    }
    decor.setSystemUiVisibility(systemUiVisibility);
}