當前位置: 首頁>>代碼示例>>Java>>正文


Java View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY屬性代碼示例

本文整理匯總了Java中android.view.View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY屬性的典型用法代碼示例。如果您正苦於以下問題:Java View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY屬性的具體用法?Java View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY怎麽用?Java View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.view.View的用法示例。


在下文中一共展示了View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onCreate

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_login);
    View decorView = getWindow().getDecorView();
    int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
    decorView.setSystemUiVisibility(uiOptions);
    ActionBar actionBar = getActionBar();
    if (null != actionBar) actionBar.hide();
    ButterKnife.bind(this);
    FirebaseAuth auth = FirebaseAuth.getInstance();
    if (auth.getCurrentUser() != null) {
        showWhiteSnackBar(R.string.sign_in_successful);
        googleLoginButton.setVisibility(View.INVISIBLE);
        Intent intent = new Intent(getApplicationContext(), MainActivity.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
        startActivity(intent);
        finish();
    }

}
 
開發者ID:vixir,項目名稱:Perfect-Day,代碼行數:21,代碼來源:LoginActivity.java

示例2: hideSystemUI

private void hideSystemUI(View view) {
    if (view == null) return;
    try {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            int uiOptions = 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;
            view.setSystemUiVisibility(uiOptions);
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:16,代碼來源:PopupWindowProxy.java

示例3: onWindowFocusChanged

/**
 * Called when view focus is changed
 */
@Override
public void onWindowFocusChanged(boolean hasFocus) {
    super.onWindowFocusChanged(hasFocus);
    if (hasFocus && immersiveMode) {
        final int uiOptions = 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;

        getWindow().getDecorView().setSystemUiVisibility(uiOptions);
    }
}
 
開發者ID:Andy-Ta,項目名稱:COB,代碼行數:17,代碼來源:CordovaActivity.java

示例4: getSystemUiVisibility

@TargetApi(19)
private static int getSystemUiVisibility() {
  int flags = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN;
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
    flags |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
  }
  return flags;
}
 
開發者ID:Piasy,項目名稱:AppRTC-Android,代碼行數:8,代碼來源:CallActivity.java

示例5: setImmersive

@TargetApi(Build.VERSION_CODES.HONEYCOMB)
private void setImmersive() {
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
        return;
    }
    int newUiOptions = getWindow().getDecorView().getSystemUiVisibility();

    // Navigation bar hiding:  Backwards compatible to ICS.
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        newUiOptions ^= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
    }

    // Status bar hiding: Backwards compatible to Jellybean
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
        newUiOptions ^= View.SYSTEM_UI_FLAG_FULLSCREEN;
    }

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
        newUiOptions ^= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
    }

    getWindow().getDecorView().setSystemUiVisibility(newUiOptions);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
        setImmersive(true);
    }
}
 
開發者ID:archos-sa,項目名稱:aos-Video,代碼行數:26,代碼來源:CastPlayerActivity.java

示例6: toggleHideyBar

public static void toggleHideyBar(Activity activity, boolean onResume) {

        int newUiOptions = activity.getWindow().getDecorView().getSystemUiVisibility();

        if (onResume) {

            applyImmersiveMode(activity);

        } else {
            newUiOptions ^= View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
            newUiOptions ^= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
            newUiOptions ^= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
            newUiOptions ^= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;

            newUiOptions ^= View.SYSTEM_UI_FLAG_FULLSCREEN;
            newUiOptions ^= View.SYSTEM_UI_FLAG_IMMERSIVE;
            newUiOptions ^= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
            activity.getWindow().getDecorView().setSystemUiVisibility(newUiOptions);
        }
    }
 
開發者ID:enricocid,項目名稱:LaunchEnr,代碼行數:20,代碼來源:ImmersiveUtils.java

示例7: onCreate

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (BuildConfig.BACK_BUTTON_QUITS) {
        createQuitDialog();
    }

    mSystemUiVisibility = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
        mSystemUiVisibility |= View.SYSTEM_UI_FLAG_FULLSCREEN;
        mSystemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
        mSystemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
        mSystemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;

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

    mPlayer = PlayerHelper.create(this);
    mPlayer.setKeepScreenOn();
    setContentView(mPlayer.getView());

    if (!addBootstrapInterface(mPlayer)) {
        Uri.Builder projectURIBuilder = Uri.fromFile(new File(getString(R.string.mv_project_index))).buildUpon();
        Bootstrapper.appendQuery(projectURIBuilder, getString(R.string.query_noaudio));
        if (BuildConfig.SHOW_FPS) {
            Bootstrapper.appendQuery(projectURIBuilder, getString(R.string.query_showfps));
        }
        mPlayer.loadUrl(projectURIBuilder.build().toString());
    }
}
 
開發者ID:AltimitSystems,項目名稱:mv-android-client,代碼行數:33,代碼來源:WebPlayerActivity.java

示例8: setFullScreen

static void setFullScreen(Map message) {
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP ) { 
        return;
    }

    final Boolean value = (Boolean) message.get("value");
    final Activity activity = QtNative.activity();

    Runnable runnable = new Runnable () {
        public void run() {
            Window w = activity.getWindow(); // in Activity's onCreate() for instance
            View decorView = w.getDecorView();

            int config = decorView.getSystemUiVisibility();

            if (value) {
                config &= ~View.SYSTEM_UI_FLAG_FULLSCREEN;
            } else {
                config |= View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
            }
            decorView.setSystemUiVisibility(config);
        }
    };

    activity.runOnUiThread(runnable);

}
 
開發者ID:benlau,項目名稱:androidnative.pri,代碼行數:27,代碼來源:Util.java

示例9: hideBar

/**
 * Hide bar.
 * 隱藏或顯示狀態欄和導航欄。 狀態欄和導航欄的顏色不起作用,都是透明色,以最後一次調用為準
 *
 * @param uiFlags the ui flags
 * @return the int
 */
private int hideBar(int uiFlags) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
        switch (mBarParams.barHide) {
            case FLAG_HIDE_BAR:
                uiFlags |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                        | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
                        | View.INVISIBLE;
                break;
            case FLAG_HIDE_STATUS_BAR:
                uiFlags |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.INVISIBLE;
                break;
            case FLAG_HIDE_NAVIGATION_BAR:
                uiFlags |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                        | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
                break;
            case FLAG_SHOW_BAR:
                uiFlags |= View.SYSTEM_UI_FLAG_VISIBLE;
                break;
        }
    }
    return uiFlags | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
}
 
開發者ID:penghongru,項目名稱:Coder,代碼行數:29,代碼來源:ImmersionBar.java

示例10: FullScreencall

public void FullScreencall() {
    if (Build.VERSION.SDK_INT > 11 && Build.VERSION.SDK_INT < 19) { // lower api
        View v = this.getWindow().getDecorView();
        v.setSystemUiVisibility(View.GONE);
    } else if (Build.VERSION.SDK_INT >= 19) {
        //for new api versions.
        View decorView = getWindow().getDecorView();
        int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
        decorView.setSystemUiVisibility(uiOptions);
    }
}
 
開發者ID:Wan7451,項目名稱:mvparms,代碼行數:11,代碼來源:BaseActivity.java

示例11: hideNavigationBar

/**
 * <pre>{@code
 * @Override
 * public void onWindowFocusChanged(boolean hasFocus) {
 *   super.onWindowFocusChanged(hasFocus);
 *   if (hasFocus) {
 *     // place here
 *   }
 * }
 * }</pre>
 */

public static void hideNavigationBar(Window window) {
    if (window == null) {
        return;
    }

    window.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
    window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);

    final View decorView = window.getDecorView();

    if (decorView != null) {
        int uiOptions = decorView.getSystemUiVisibility();

        if (Build.VERSION.SDK_INT >= 14) {
            uiOptions |= View.SYSTEM_UI_FLAG_LOW_PROFILE;
        }

        if (Build.VERSION.SDK_INT >= 16) {
            uiOptions |= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
        }

        if (Build.VERSION.SDK_INT >= 19) {
            uiOptions |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
        }

        decorView.setSystemUiVisibility(uiOptions);
    }
}
 
開發者ID:dmitrykolesnikovich,項目名稱:featurea,代碼行數:40,代碼來源:AndroidInputUtil.java

示例12: showNavigationBar

private static void showNavigationBar(Context context) {
    View decorView = scanForActivity(context).getWindow().getDecorView();
    int systemUiVisibility = decorView.getSystemUiVisibility();
    int flags = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
            | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | View.SYSTEM_UI_FLAG_FULLSCREEN;
    systemUiVisibility &= ~flags;
    decorView.setSystemUiVisibility(systemUiVisibility);
}
 
開發者ID:dueeeke,項目名稱:dkplayer,代碼行數:8,代碼來源:WindowUtil.java

示例13: _setImmersiveMode

@TargetApi(19)
private void _setImmersiveMode(){
	//if (true) return;
	int vis = 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;
	if (mGLView.getSystemUiVisibility() != vis){
		//screenMessage("FORCING IMMERSIVE");
		mGLView.setSystemUiVisibility(vis);
	}
}
 
開發者ID:efroemling,項目名稱:bombsquad-remote-android,代碼行數:14,代碼來源:GamePadActivity.java

示例14: toggleHideyBar

/**
* 隱藏虛擬鍵
* @param context
*/
public static void toggleHideyBar(Activity context) {

       // BEGIN_INCLUDE (get_current_ui_flags)
       // BEGIN_INCLUDE (get_current_ui_flags)
       // getSystemUiVisibility() gives us that bitfield.
       int uiOptions = context.getWindow().getDecorView().getSystemUiVisibility();
       int newUiOptions = uiOptions;
       // END_INCLUDE (get_current_ui_flags)
       // BEGIN_INCLUDE (toggle_ui_flags)
       boolean isImmersiveModeEnabled =
               ((uiOptions | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY) == uiOptions);
       if (isImmersiveModeEnabled) {
           Log.i("TAG", "Turning immersive mode mode off. ");
       } else {
           Log.i("TAG", "Turning immersive mode mode on.");
       }

       // Navigation bar hiding:  Backwards compatible to ICS.
       if (Build.VERSION.SDK_INT >= 14) {
           newUiOptions ^= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
       }

       // Status bar hiding: Backwards compatible to Jellybean
       if (Build.VERSION.SDK_INT >= 16) {
           newUiOptions ^= View.SYSTEM_UI_FLAG_FULLSCREEN;
       }

       // Immersive mode: Backward compatible to KitKat.
       // Note that this flag doesn't do anything by itself, it only augments the behavior
       // of HIDE_NAVIGATION and FLAG_FULLSCREEN.  For the purposes of this sample
       // all three flags are being toggled together.
       // Note that there are two immersive mode UI flags, one of which is referred to as "sticky".
       // Sticky immersive mode differs in that it makes the navigation and status bars
       // semi-transparent, and the UI flag does not get cleared when the user interacts with
       // the screen.
       if (Build.VERSION.SDK_INT >= 18) {
           newUiOptions ^= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
       }

       context.getWindow().getDecorView().setSystemUiVisibility(newUiOptions);
       //END_INCLUDE (set_ui_flags)
   }
 
開發者ID:CoderCF,項目名稱:SuperVideoPlayer,代碼行數:46,代碼來源:Tools.java

示例15: getExtraFullscreenUIFlags

private static int getExtraFullscreenUIFlags() {
    int flags = 0;
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        flags |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
        flags |= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
        flags |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
    }
    return flags;
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:9,代碼來源:FullscreenHtmlApiHandler.java


注:本文中的android.view.View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。