Example usage for android.widget ViewFlipper setSystemUiVisibility

List of usage examples for android.widget ViewFlipper setSystemUiVisibility

Introduction

In this page you can find the example usage for android.widget ViewFlipper 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:eu.e43.impeller.activity.MainActivity.java

@TargetApi(Build.VERSION_CODES.KITKAT)
void setUiFlags() {
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH)
        return;//from  ww w  .  j a  v a 2s.com

    ViewFlipper flipper = (ViewFlipper) findViewById(R.id.overlay_flipper);
    if (m_overlayController != null) {
        // Fullscreen
        int flags = View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                | View.SYSTEM_UI_FLAG_FULLSCREEN;

        if (m_overlayController.isImmersive()) {
            flags |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;

            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
                flags |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
            }
        }

        flipper.setSystemUiVisibility(flags);
    } else {
        // Standard
        flipper.setSystemUiVisibility(0);
    }
}