当前位置: 首页>>代码示例>>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;未经允许,请勿转载。