Example usage for android.view View SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN

List of usage examples for android.view View SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN

Introduction

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

Prototype

int SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN

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

Click Source Link

Document

Flag for #setSystemUiVisibility(int) : View would like its window to be laid out as if it has requested #SYSTEM_UI_FLAG_FULLSCREEN , even if it currently hasn't.

Usage

From source file:com.mishiranu.dashchan.ui.gallery.GalleryActivity.java

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void applyStatusNavigationTranslucency() {
    if (C.API_LOLLIPOP) {
        Window window = getWindow();
        int color = ACTION_BAR_COLOR;
        window.setStatusBarColor(color);
        window.setNavigationBarColor(color);
        window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
    }//from   w ww  .j  a  va2 s  . c o  m
}

From source file:com.miz.mizuu.ImageViewer.java

@SuppressLint("InlinedApi")
private void hideSystemUi() {
    getWindow().getDecorView().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);

    mHandler.removeCallbacks(mHideSystemUiRunnable);

    getSupportActionBar().hide();//from w ww .j a  v  a  2  s .co  m
}

From source file:uk.co.fuuzetsu.turnofwar.GameActivity.java

@SuppressLint("NewApi")
@Override//w  ww  .  j  a  v  a  2  s .com
public void onResume() {
    super.onResume();
    int currentApiVersion = android.os.Build.VERSION.SDK_INT;
    if (currentApiVersion >= 19) {
        final int flags = 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;
        final View decorView = getWindow().getDecorView();
        decorView.setSystemUiVisibility(flags);
    }
    if (ranFlag == 0) {
        Bundle b = getIntent().getExtras();
        String mapFileName = b.getString("mapFileName");
        boolean[] isAi = b.getBooleanArray("isAi");
        GameMap map = null;

        try {
            map = MapReader.readMapFromFile(mapFileName, this, isAi);
        } catch (JSONException e) {
            Log.d(TAG, "Failed to load the map: " + e.getMessage());
        }

        if (map == null) {
            Log.d(TAG, "map is null");
            System.exit(1);
        }
        // getWindow().setFormat(PixelFormat.RGBA_8888); //fix banding which
        // ruined all my nice images
        setContentView(R.layout.activity_game);
        GameView gameView = (GameView) this.findViewById(R.id.gameView);
        state = new GameState(map, new Logic(), map.getPlayers(), gameView);
        Button menuButton = (Button) this.findViewById(R.id.menuButton);
        menuButton.setOnClickListener(gameView);
        gameView.setState(state, this);
    }
}

From source file:io.v.moments.ux.ShowPhotoActivity.java

@SuppressLint("InlinedApi")
private void showNavControl() {
    mImageView.setSystemUiVisibility(/*from   w  ww . j a v a2s  .  c om*/
            View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
    mIsNavControlVisible = true;
    mControlView.setVisibility(View.VISIBLE);
}

From source file:me.selinali.tribbble.ui.shot.ShotActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_shot);
    ButterKnife.bind(this);
    overridePendingTransition(R.anim.slide_in_from_right, R.anim.slide_out_to_left);
    getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);

    mShot = Parcels.unwrap(getIntent().getParcelableExtra(EXTRA_SHOT));

    setSupportActionBar(mToolbar);//ww  w . ja  v a 2s. c o m
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setDisplayShowTitleEnabled(false);

    (mShot.isAnimated() ? mGifImageLoader : mStaticImageLoader).load(bitmap -> Palette.from(bitmap)
            .maximumColorCount(8).generate(palette -> mShotDetailsView.bind(palette.getSwatches())));

    load();
}

From source file:de.sixtyfourktec.mirrorhub.Main.java

@TargetApi(16)
private void setFullscreenLevel16() {
    getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // API 14; hide nav bar
            | View.SYSTEM_UI_FLAG_LAYOUT_STABLE // API 16
            | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION // API 16
            | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN // API 16
            | View.SYSTEM_UI_FLAG_FULLSCREEN); // API 16; hide status bar
}

From source file:com.guodong.sun.guodong.activity.MultiGifActivity.java

@Override
public void onWindowFocusChanged(boolean hasFocus) {
    super.onWindowFocusChanged(hasFocus);
    if (hasFocus && Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        View decorView = getWindow().getDecorView();
        int option = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN // ???
                | View.SYSTEM_UI_FLAG_LAYOUT_STABLE // ????
                | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION // ???
                | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // ???
                | View.SYSTEM_UI_FLAG_FULLSCREEN // ????
                | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; // ?
        decorView.setSystemUiVisibility(option);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            getWindow().setStatusBarColor(Color.TRANSPARENT);
            getWindow().setNavigationBarColor(Color.TRANSPARENT);
        }/*from  w ww . j av a 2s  . co m*/
    }
}

From source file:com.mercandalli.android.apps.files.file.image.FileImageActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_file_picture);

    final Toolbar toolbar = (Toolbar) findViewById(R.id.my_toolbar);
    if (toolbar != null) {
        setSupportActionBar(toolbar);/*from   w  ww  . ja  v  a 2s. com*/
        ActionBar actionBar = getSupportActionBar();
        if (actionBar != null) {
            actionBar.setDisplayHomeAsUpEnabled(true);
        }
    }

    // Translucent notification bar
    getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);

    // Get views
    mProgressBar = (ProgressBar) this.findViewById(R.id.progressBar);
    mCircle = (ImageButton) this.findViewById(R.id.circle);
    mTitleTextView = (TextView) this.findViewById(R.id.title);
    mProgressTextView = (TextView) this.findViewById(R.id.progress_tv);

    mProgressBar.setProgress(0);

    Bundle extras = getIntent().getExtras();
    if (extras == null) {
        Log.e("" + getClass().getName(), "extras == null");
        finish();
        overridePendingTransition(R.anim.right_in, R.anim.right_out);
        return;
    } else {
        mId = extras.getInt("ID");
        mTitle = extras.getString("TITLE");
        mUrl = extras.getString("URL_FILE");
        online = extras.getBoolean("CLOUD");
        sizeFile = extras.getLong("SIZE_FILE");
        date_creation = (Date) extras.getSerializable("DATE_FILE");

        if (mTitle != null) {
            mTitleTextView.setText(mTitle);
        }

        if (ImageUtils.isImage(this, this.mId)) {
            mBitmap = ImageUtils.loadImage(this, this.mId);
            ((ImageView) this.findViewById(R.id.tab_icon)).setImageBitmap(mBitmap);
            int bgColor = ColorUtils.getMutedColor(mBitmap);
            if (bgColor != 0) {
                mTitleTextView.setBackgroundColor(bgColor);
                mTitleTextView.setTextColor(ColorUtils.colorText(bgColor));
                RippleDrawable cir = ImageUtils.getPressedColorRippleDrawable(bgColor,
                        ColorUtils.getDarkMutedColor(mBitmap));
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                    mCircle.setBackground(cir);
                }
            }
            mProgressBar.setVisibility(View.GONE);
            mProgressTextView.setVisibility(View.GONE);
        } else if (this.mId != 0) {
            mProgressBar.setVisibility(View.VISIBLE);
            mProgressTextView.setVisibility(View.VISIBLE);
            (new TaskGetDownloadImage(this, mUrl, mId, sizeFile, -1, new IBitmapListener() {
                @Override
                public void execute(Bitmap bitmap) {
                    ((ImageView) findViewById(R.id.tab_icon)).setImageBitmap(bitmap);
                    int bgColor = ColorUtils.getMutedColor(bitmap);
                    if (bgColor != 0) {
                        mTitleTextView.setBackgroundColor(bgColor);
                        mTitleTextView.setTextColor(ColorUtils.colorText(bgColor));
                        RippleDrawable cir = ImageUtils.getPressedColorRippleDrawable(bgColor,
                                ColorUtils.getDarkMutedColor(bitmap));
                        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                            mCircle.setBackground(cir);
                        }
                    }
                    mProgressBar.setVisibility(View.GONE);
                    mProgressTextView.setVisibility(View.GONE);
                }
            }, new ILongListener() {
                @Override
                public void execute(long text) {
                    mProgressBar.setProgress((int) text);
                    mProgressTextView.setText(text + "%");
                }
            })).execute();
        }
    }

    mCircle.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent picIntent = new Intent();
            picIntent.setAction(Intent.ACTION_VIEW);
            picIntent.setDataAndType(Uri.parse("file://"
                    + (new File(FileImageActivity.this.getFilesDir() + "/file_" + mId)).getAbsolutePath()),
                    "image/*");
            FileImageActivity.this.startActivity(picIntent);
        }
    });
}

From source file:com.creativechaitu.castremotedisplay.CastRemoteDisplayActivity.java

private void setFullScreen() {
    View decorView = getWindow().getDecorView();
    decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | View.SYSTEM_UI_FLAG_LAYOUT_STABLE
            | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
}

From source file:io.plaidapp.ui.PlayerActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_dribbble_player);
    ButterKnife.bind(this);
    circleTransform = new CircleTransform(this);
    chromeFader = new ElasticDragDismissFrameLayout.SystemChromeFader(this);

    final Intent intent = getIntent();
    if (intent.hasExtra(EXTRA_PLAYER)) {
        player = intent.getParcelableExtra(EXTRA_PLAYER);
        bindPlayer();//  w w w  .  j  ava  2  s.c  o m
    } else if (intent.hasExtra(EXTRA_PLAYER_NAME)) {
        String name = intent.getStringExtra(EXTRA_PLAYER_NAME);
        playerName.setText(name);
        if (intent.hasExtra(EXTRA_PLAYER_ID)) {
            long userId = intent.getLongExtra(EXTRA_PLAYER_ID, 0L);
            loadPlayer(userId);
        } else if (intent.hasExtra(EXTRA_PLAYER_USERNAME)) {
            String username = intent.getStringExtra(EXTRA_PLAYER_USERNAME);
            loadPlayer(username);
        }
    } else if (intent.getData() != null) {
        // todo support url intents
    }

    // setup immersive mode i.e. draw behind the system chrome & adjust insets
    draggableFrame.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
            | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
    draggableFrame.setOnApplyWindowInsetsListener(new View.OnApplyWindowInsetsListener() {
        @Override
        public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
            final ViewGroup.MarginLayoutParams lpFrame = (ViewGroup.MarginLayoutParams) draggableFrame
                    .getLayoutParams();
            lpFrame.leftMargin += insets.getSystemWindowInsetLeft(); // landscape
            lpFrame.rightMargin += insets.getSystemWindowInsetRight(); // landscape
            ((ViewGroup.MarginLayoutParams) avatar.getLayoutParams()).topMargin += insets
                    .getSystemWindowInsetTop();
            ViewUtils.setPaddingTop(container, insets.getSystemWindowInsetTop());
            ViewUtils.setPaddingBottom(shots, insets.getSystemWindowInsetBottom());
            // clear this listener so insets aren't re-applied
            draggableFrame.setOnApplyWindowInsetsListener(null);
            return insets;
        }
    });
    setExitSharedElementCallback(FeedAdapter.createSharedElementReenterCallback(this));
}