本文整理汇总了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();
}
}
示例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();
}
}
示例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);
}
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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());
}
}
示例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);
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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)
}
示例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;
}