Example usage for android.view View SYSTEM_UI_FLAG_FULLSCREEN

List of usage examples for android.view View SYSTEM_UI_FLAG_FULLSCREEN

Introduction

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

Prototype

int SYSTEM_UI_FLAG_FULLSCREEN

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

Click Source Link

Document

Flag for #setSystemUiVisibility(int) : View has requested to go into the normal fullscreen mode so that its content can take over the screen while still allowing the user to interact with the application.

Usage

From source file:com.scooter1556.sms.android.activity.VideoPlayerActivity.java

@Override
public void onResume() {
    super.onResume();

    controller.setVisibility(View.VISIBLE);
    showController = true;/*from   w ww.  ja v a  2  s .c om*/

    // Hide action bar
    surface.setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN);

    // Retrieve media element to play
    Intent intent = getIntent();
    mediaElement = (MediaElement) intent.getSerializableExtra("mediaElement");

    // If our surface is ready start playing video (surface is not destroyed if the power button is pressed)
    if (ready) {
        preparePlayer();
    }
}

From source file:com.yahoo.mobile.client.android.yodel.ui.ImageGalleryActivity.java

@SuppressLint("NewApi")
public void showSystemUi() {
    getWindow().getDecorView()/*from  w w w . j a  v  a  2  s . c  o m*/
            .setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_FULLSCREEN // keep status bar hidden
                    | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);

    Animator anim = AnimatorInflater.loadAnimator(this, R.animator.fade_show);
    anim.setTarget(mCaptionPagerIndicator);
    anim.start();

    getSupportActionBar().show();
}

From source file:com.freshdigitable.udonroad.MediaViewActivity.java

private boolean isSystemUIVisible(int visibility) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
        return (View.SYSTEM_UI_FLAG_FULLSCREEN & visibility) == 0;
    } else {/*from www. j ava  2  s . c om*/
        return (View.SYSTEM_UI_FLAG_HIDE_NAVIGATION & visibility) == 0;
    }
}

From source file:com.hplasplas.cam_capture.activitys.CamCapture.java

private void hideStatusPanelIfNeed() {

    if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
        getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN);
    }/* w  w w. j  av  a2 s  .  c  o m*/
}

From source file:ca.hoogit.garagepi.Main.MainActivity.java

public void toggleFullscreen() {
    int newUiOptions = getWindow().getDecorView().getSystemUiVisibility();
    newUiOptions ^= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
    newUiOptions ^= View.SYSTEM_UI_FLAG_FULLSCREEN;
    newUiOptions ^= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;

    getWindow().getDecorView().setSystemUiVisibility(newUiOptions);
}

From source file:org.fossasia.phimpme.leafpic.activities.PlayerActivity.java

@SuppressWarnings("ResourceAsColor")
private void initUI() {
    setSupportActionBar(toolbar);//from   w w w .j  ava2s  .  c om
    toolbar.setBackgroundColor(ContextCompat.getColor(getApplicationContext(), R.color.transparent_black));
    toolbar.setNavigationIcon(getToolbarIcon(GoogleMaterial.Icon.gmd_arrow_back));
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            onBackPressed();
        }
    });
    getSupportActionBar().setDisplayShowTitleEnabled(false);

    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 // hide nav bar
            | View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
            | View.SYSTEM_UI_FLAG_IMMERSIVE);

    toolbar.animate().translationY(-toolbar.getHeight()).setInterpolator(new AccelerateInterpolator())
            .setDuration(0).start();
    mediController_anchor.setPadding(0, 0, 0, Measure.getNavBarHeight(PlayerActivity.this));

    mediaController
            .setBackgroundColor(ContextCompat.getColor(getApplicationContext(), R.color.transparent_black));

    setStatusBarColor();
    setNavBarColor();
    setRecentApp(getString(R.string.app_name));
}

From source file:com.stemsc.bt.BarcodeCaptureActivity.java

/**
 * Initializes the UI and creates the detector pipeline.
 *//*  w w  w.j  a  va 2 s  .  c o m*/
@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);

    //   
    //        requestWindowFeature(Window.FEATURE_NO_TITLE);
    // ?? ?
    //        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
    //                WindowManager.LayoutParams.FLAG_FULLSCREEN);

    View view = this.getWindow().getDecorView();
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        view.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN
                | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
    }

    setContentView(R.layout.barcode_capture);
    mPreview = (CameraSourcePreview) findViewById(R.id.preview);
    mGraphicOverlay = (GraphicOverlay<BarcodeGraphic>) findViewById(R.id.graphicOverlay);

    // read parameters from the intent used to launch the activity.
    //        boolean autoFocus = getIntent().getBooleanExtra(AutoFocus, false);
    //        boolean useFlash = getIntent().getBooleanExtra(UseFlash, false);
    //    ?
    sPref = PreferenceManager.getDefaultSharedPreferences(this.getApplicationContext());
    autoFocus = sPref.getBoolean("af", true);
    useFlash = sPref.getBoolean("fl", false);
    mRaw = sPref.getBoolean("raw", false);
    mPV = sPref.getBoolean("pv", false);
    mS = sPref.getInt("s", 50);
    mH = sPref.getInt("h", 360);
    mW = sPref.getInt("v", 640);
    //        Log.d(TAG,"=== mS === "+mS);
    //        Log.d(TAG,"=== mH === "+mH);
    //        Log.d(TAG,"=== mW === "+mW);

    // Check for the camera permission before accessing the camera.  If the
    // permission is not granted yet, request permission.
    int rc = ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA);
    if (rc == PackageManager.PERMISSION_GRANTED) {
        createCameraSource(autoFocus, useFlash);
    } else {
        requestCameraPermission();
    }

    //        gestureDetector = new GestureDetector(this, new CaptureGestureListener());
    //        scaleGestureDetector = new ScaleGestureDetector(this, new ScaleListener());

    //        Snackbar.make(mGraphicOverlay, "Tap to capture. Pinch/Stretch to zoom",
    //                Snackbar.LENGTH_LONG)
    //                .show();

    tvSost = (TextView) findViewById(R.id.tvSost);
    lLay = (RelativeLayout) findViewById(R.id.lLayout1);

    if (mPV) {
        mPreview.setVisibility(View.VISIBLE);
    } else {
        mPreview.setVisibility(View.INVISIBLE);
    }

    sbS = (SeekBar) findViewById(R.id.seekBarS);
    sbW = (SeekBar) findViewById(R.id.seekBarW);
    sbH = (SeekBar) findViewById(R.id.seekBarH);

    sbS.setOnSeekBarChangeListener(this);
    sbW.setOnSeekBarChangeListener(this);
    sbH.setOnSeekBarChangeListener(this);

    target = (TextView) findViewById(R.id.target);
    RelativeLayout.LayoutParams MyParams = new RelativeLayout.LayoutParams(64 * mS / 10, 72 * mS / 10);
    MyParams.addRule(RelativeLayout.ALIGN_PARENT_TOP);
    MyParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
    MyParams.topMargin = mW;
    MyParams.leftMargin = mH;
    target.setLayoutParams(MyParams);

    sbS.setProgress(mS);
    sbW.setProgress(mW);
    sbH.setProgress(mH);
    ((TextView) findViewById(R.id.taPar)).setText("" + mS + " " + mW + " " + mH);

    // create instance
    _displayControl = new DisplayControl(this);
    // get current display condition
    _mode = _displayControl.getMode();
    //        _backlight = _displayControl.getBacklight();

    if (_mode == DisplayControl.DISPLAY_MODE_2D) {
        _mode = DisplayControl.DISPLAY_MODE_3D;
        _displayControl.setMode(_mode, true);
    }

    if (mRaw) {
        tvSost.setText("?(raw) ");
        lLay.setVisibility(View.INVISIBLE);

        return; // !!!!!!!!!  !!!!!!!

    }

    lLay2 = (RelativeLayout) findViewById(R.id.lLayout2);

    tvNeed = (TextView) findViewById(R.id.tvNeed);
    tvNeedT = (TextView) findViewById(R.id.tvNeedT);
    tvNeedAT = (TextView) findViewById(R.id.tvNeedAT);
    tvNeedA = (TextView) findViewById(R.id.tvNeedA);
    tvNeedBT = (TextView) findViewById(R.id.tvNeedBT);
    tvNeedB = (TextView) findViewById(R.id.tvNeedB);
    tvNeedQT = (TextView) findViewById(R.id.tvNeedQT);
    tvNeedQ = (TextView) findViewById(R.id.tvNeedQ);

    tvCellT = (TextView) findViewById(R.id.tvCellT);
    tvCell = (TextView) findViewById(R.id.tvCell);
    tvTrayT = (TextView) findViewById(R.id.tvTrayT);
    tvTray = (TextView) findViewById(R.id.tvTray);
    pb1 = (ProgressBar) findViewById(R.id.pb1);

    tvNeedAT.setVisibility(View.INVISIBLE);
    tvNeedA.setVisibility(View.INVISIBLE);
    tvNeedBT.setVisibility(View.INVISIBLE);
    tvNeedB.setVisibility(View.INVISIBLE);
    tvNeedQT.setVisibility(View.INVISIBLE);
    tvNeedQ.setVisibility(View.INVISIBLE);

    tvCellT.setVisibility(View.INVISIBLE);
    tvCell.setVisibility(View.INVISIBLE);
    tvTrayT.setVisibility(View.INVISIBLE);
    tvTray.setVisibility(View.INVISIBLE);

    //  json
    //        AsyncTask<Void, Void, String> tmp = new ParseTask("http://onbqth.com/route2.json");
    //        AsyncTask<Void, Void, String> dStr = tmp.execute();
    new ParseTask("http://onbqth.com/order.json").execute();
}

From source file:org.kaaproject.kaa.demo.photoframe.PhotoFrameActivity.java

@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public void setLightsOutMode(boolean enabled) {
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
        if (enabled) {
            getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
            getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
        } else {/*w  w  w .j  av a  2s .  co m*/
            getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
            getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
        }
    } else {
        getWindow().getDecorView().setSystemUiVisibility(enabled ? View.SYSTEM_UI_FLAG_FULLSCREEN : 0);
    }
}

From source file:com.example.maxuan.photoutils.ViewPagerActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_select_viewpager);
    mViewPager = (HackyViewPager) findViewById(R.id.view_pager);
    recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
    cancelBtn = (ImageView) findViewById(R.id.selectCancel);
    cancelBtn.setOnClickListener(this);
    selectCheckBox = (CheckBox) findViewById(R.id.checkbox);
    selectCheckBox.setOnClickListener(this);
    completeBtn = (Button) findViewById(R.id.completeBtn);
    completeBtn.setOnClickListener(this);
    photos = new ArrayList<>();
    posArray = new SparseIntArray(10);
    adapter = new PhotoPagerAdapter(this, photos);
    mViewPager.setAdapter(adapter);//w ww .  java  2 s.  c  o m
    mViewPager.addOnPageChangeListener(this);
    Intent intent = getIntent();
    if (intent != null) {
        Bundle bundle = intent.getBundleExtra("data");
        if (bundle == null)
            return;
        selectedPhotoArray = bundle.getSparseParcelableArray("selectedPhotos");
        completeBtn.setText(String.format(format, selectedPhotoArray.size()));
        List<Photo> list = bundle.getParcelableArrayList("photos");
        if (list != null)
            photos.addAll(list);
        for (int i = 0; i < photos.size(); ++i) {
            posArray.put(photos.get(i).id, i);
        }
        position = bundle.getInt("position", 0);
        maxCount = bundle.getInt("maxCount", 9);
        adapter.notifyDataSetChanged();
        mViewPager.setCurrentItem(position);
        selectCheckBox.setChecked(selectedPhotoArray.indexOfKey(photos.get(position).id) >= 0);
    }

    selectedPhotoAdapter = new SelectedPhotoAdapter(this);
    LinearLayoutManager layoutManager = new LinearLayoutManager(this);
    layoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
    layoutManager.setReverseLayout(true);
    recyclerView.setLayoutManager(layoutManager);
    recyclerView.setAdapter(selectedPhotoAdapter);
    recyclerView.setVisibility(selectedPhotoArray.size() > 0 ? View.VISIBLE : View.GONE);
    if (savedInstanceState != null) {
        boolean isLocked = savedInstanceState.getBoolean(ISLOCKED_ARG, false);
        ((HackyViewPager) mViewPager).setLocked(isLocked);
    }

    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT)
        return;
    getWindow().getDecorView()
            .setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                    | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);

}

From source file:org.thoughtcrime.securesms.MediaPreviewActivity.java

@TargetApi(VERSION_CODES.JELLY_BEAN)
private void setFullscreenIfPossible() {
    if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN) {
        getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN);
    }//  w w  w.  j  a  v  a  2  s . co  m
}