Example usage for android.view View SYSTEM_UI_FLAG_LOW_PROFILE

List of usage examples for android.view View SYSTEM_UI_FLAG_LOW_PROFILE

Introduction

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

Prototype

int SYSTEM_UI_FLAG_LOW_PROFILE

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

Click Source Link

Document

Flag for #setSystemUiVisibility(int) : View has requested the system UI to enter an unobtrusive "low profile" mode.

Usage

From source file:com.fatelon.partyphotobooth.fragments.CaptureFragment.java

/**
 * Requests system ui to enter low profile mode.
 *///from   ww  w.  jav  a2 s  .  c o  m
@SuppressLint("NewApi")
private void dimSystemUi() {
    // View.SYSTEM_UI_FLAG_LOW_PROFILE only available in ICS and above.
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        mStartButton.post(new Runnable() {
            @Override
            public void run() {
                if (isActivityAlive()) {
                    mStartButton.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
                }
            }
        });
    }
}

From source file:paulscode.android.mupen64plusae.profile.TouchscreenProfileActivity.java

@SuppressLint("InlinedApi")
private void hideSystemBars() {
    getSupportActionBar().hide();/*ww  w  . j  ava2  s . c  o m*/
    View view = mSurface.getRootView();
    if (view != null) {
        if (AppData.IS_KITKAT && mGlobalPrefs.isImmersiveModeEnabled)
            view.setSystemUiVisibility(View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
                    | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN
                    | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
        else
            view.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE); // == STATUS_BAR_HIDDEN for Honeycomb
    }
}

From source file:com.justwayward.reader.ui.activity.ReadActivity.java

private synchronized void hideReadBar() {
    gone(mTvDownloadProgress, mLlBookReadBottom, mLlBookReadTop, rlReadAaSet, rlReadMark);
    hideStatusBar();//from   ww  w  . java 2 s .co  m
    decodeView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
}

From source file:com.google.android.apps.muzei.ArtDetailFragment.java

private void showHideChrome(boolean show) {
    int flags = show ? 0 : View.SYSTEM_UI_FLAG_LOW_PROFILE;
    flags |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
            | View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
    if (!show) {//w  ww  . j a  v  a2s  .c o m
        flags |= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN
                | View.SYSTEM_UI_FLAG_IMMERSIVE;
    }
    mContainerView.setSystemUiVisibility(flags);
}

From source file:com.antew.redditinpictures.library.ui.ImageViewerActivity.java

public void goFullscreen() {
    EasyTracker.getInstance(this)
            .send(MapBuilder.createEvent(Constants.Analytics.Category.UI_ACTION,
                    Constants.Analytics.Action.TOGGLE_DETAILS, Constants.Analytics.Label.GO_FULLSCREEN, null)
                    .build());//w  w  w .  j a  v a2  s .c o  m
    mPager.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
}

From source file:com.scigames.registration.LoginActivity.java

@Override
public boolean dispatchTouchEvent(MotionEvent event) {

    View v = getCurrentFocus();/*w w  w  .j a v  a2  s .  c  om*/
    Log.d(TAG, "CLICK DETECTED");
    getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
    //        getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION );
    //        v.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
    //        Window win = this.getWindow(); // in Activity's onCreate() for instance
    //        win.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
    //                WindowManager.LayoutParams.FLAG_FULLSCREEN);
    boolean ret = super.dispatchTouchEvent(event);

    if (v instanceof EditText) {
        View w = getCurrentFocus();
        int scrcoords[] = new int[2];
        w.getLocationOnScreen(scrcoords);
        float x = event.getRawX() + w.getLeft() - scrcoords[0];
        float y = event.getRawY() + w.getTop() - scrcoords[1];

        Log.d("Activity",
                "Touch event " + event.getRawX() + "," + event.getRawY() + " " + x + "," + y + " rect "
                        + w.getLeft() + "," + w.getTop() + "," + w.getRight() + "," + w.getBottom() + " coords "
                        + scrcoords[0] + "," + scrcoords[1]);
        if (event.getAction() == MotionEvent.ACTION_UP
                && (x < w.getLeft() || x >= w.getRight() || y < w.getTop() || y > w.getBottom())) {

            InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
            imm.hideSoftInputFromWindow(getWindow().getCurrentFocus().getWindowToken(), 0);
        }
    }
    return ret;

}

From source file:com.antew.redditinpictures.library.ui.ImageViewerActivity.java

@Override
public boolean isSystemUiVisible() {
    final int vis = mPager.getSystemUiVisibility();
    if ((vis & View.SYSTEM_UI_FLAG_LOW_PROFILE) != 0) {
        return false;
    }/*from   w w w .  j av a 2s  .  co m*/
    return true;
}

From source file:it.readbeyond.minstrel.commander.Commander.java

private void dim(final boolean dim, final CallbackContext callbackContext) {
    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        cordova.getActivity().runOnUiThread(new Runnable() {
            public void run() {
                try {
                    // getRootView is really necessary here!!! 
                    View rootView = cordova.getActivity().getWindow().getDecorView().getRootView();
                    if (rootView != null) {
                        if (dim) {
                            rootView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
                        } else {
                            rootView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
                        }//  www  . jav  a2  s .  c o m
                    }
                    callbackContext.success("");
                } catch (Exception e) {
                    callbackContext.error("Exception " + e);
                }
            }
        });
    }
}

From source file:com.example.camera360.ui.ImageDetailActivity.java

/**
 * Set on the ImageView in the ViewPager children fragments, to
 * enable/disable low profile mode when the ImageView is touched.
 *//*from w w  w .j av a  2  s. com*/
@TargetApi(11)
@Override
public void onClick(View v) {
    switch (v.getId()) {
    case R.id.image_back_botton:
        ((ImageView) v).setImageResource(R.drawable.ic_back_active);
        finish();
        break;
    case R.id.imageView:
        handleMenu();
        break;
    case R.id.image_header_menu:
    case R.id.image_footer_menu:
        break;
    case R.id.image_like:
        HashMap<String, String> map = new HashMap<String, String>();
        map = arrayList.get(currentIndex);
        int i = 0;
        if (map.get("favorite").equals("0")) {
            map.put("favorite", "1");
            i = R.drawable.photo_like;
        } else {
            map.put("favorite", "0");
            i = R.drawable.photo_like_active;
        }
        ((ImageView) v).setImageResource(i);
        ((ImageView) v).startAnimation(baseAnimate.animateScale(0.5f, 1f, 0.5f, 1f, DURATION_MILLIS, true));
        break;
    default:
        final int vis = mPager.getSystemUiVisibility();
        if ((vis & View.SYSTEM_UI_FLAG_LOW_PROFILE) != 0) {
            mPager.setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
        } else {
            mPager.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
        }
        break;
    }
}

From source file:com.scigames.registration.LoginActivity.java

@Override
public void onBackPressed() {
    //do nothing
    getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);

}