Example usage for android.widget FrameLayout getSystemUiVisibility

List of usage examples for android.widget FrameLayout getSystemUiVisibility

Introduction

In this page you can find the example usage for android.widget FrameLayout getSystemUiVisibility.

Prototype

public int getSystemUiVisibility() 

Source Link

Document

Returns the last #setSystemUiVisibility(int) that this view has requested.

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;/*w  w  w.  ja  va  2  s .  c  o  m*/
    } else {
        systemUiVisibility &= ~bits;
    }
    decor.setSystemUiVisibility(systemUiVisibility);
}