当前位置: 首页>>代码示例>>Java>>正文


Java View.SYSTEM_UI_FLAG_VISIBLE属性代码示例

本文整理汇总了Java中android.view.View.SYSTEM_UI_FLAG_VISIBLE属性的典型用法代码示例。如果您正苦于以下问题:Java View.SYSTEM_UI_FLAG_VISIBLE属性的具体用法?Java View.SYSTEM_UI_FLAG_VISIBLE怎么用?Java View.SYSTEM_UI_FLAG_VISIBLE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.view.View的用法示例。


在下文中一共展示了View.SYSTEM_UI_FLAG_VISIBLE属性的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setStatusBarColor

/**
 * set StatusBarColor
 * <p>
 * 1. set Flags to call setStatusBarColor
 * 2. call setSystemUiVisibility to clear translucentStatusBar's Flag.
 * 3. set FitsSystemWindows to false
 */
static void setStatusBarColor(Activity activity, int statusColor, boolean isLight) {
	Window window = activity.getWindow();

	window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
	window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
	window.setStatusBarColor(statusColor);
	int options = View.SYSTEM_UI_FLAG_VISIBLE;
	if (isLight) {
		options = options | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
	}
	window.getDecorView().setSystemUiVisibility(options);
	ViewGroup contentview = (ViewGroup) window.findViewById(Window.ID_ANDROID_CONTENT);
	View childview = contentview.getChildAt(0);
	if (childview != null) {
		childview.setFitsSystemWindows(false);
		childview.requestApplyInsets();
	}
}
 
开发者ID:MobClub,项目名称:BBSSDK-for-Android,代码行数:25,代码来源:StatusBarCompatLollipop.java

示例2: SystemUiHiderHoneycomb

/**
 * Constructor not intended to be called by clients. Use
 * {@link SystemUiHider#getInstance} to obtain an instance.
 */
protected SystemUiHiderHoneycomb(Activity activity, View anchorView, int flags) {
    super(activity, anchorView, flags);

    mShowFlags = View.SYSTEM_UI_FLAG_VISIBLE;
    mHideFlags = View.SYSTEM_UI_FLAG_LOW_PROFILE;
    mTestFlags = View.SYSTEM_UI_FLAG_LOW_PROFILE;

    if ((mFlags & FLAG_FULLSCREEN) != 0) {
        // If the client requested fullscreen, add flags relevant to hiding
        // the status bar. Note that some of these constants are new as of
        // API 16 (Jelly Bean). It is safe to use them, as they are inlined
        // at compile-time and do nothing on pre-Jelly Bean devices.
        mShowFlags |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
        mHideFlags |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                | View.SYSTEM_UI_FLAG_FULLSCREEN;
    }

    if ((mFlags & FLAG_HIDE_NAVIGATION) != 0) {
        // If the client requested hiding navigation, add relevant flags.
        mShowFlags |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
        mHideFlags |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
        mTestFlags |= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
    }
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:29,代码来源:SystemUiHiderHoneycomb.java

示例3: 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

示例4: SystemUiHiderHoneycomb

/**
 * Constructor not intended to be called by clients. Use
 * {@link SystemUiHider#getInstance} to obtain an instance.
 */
protected SystemUiHiderHoneycomb(Activity activity, View anchorView, int flags) {
	super(activity, anchorView, flags);

	mShowFlags = View.SYSTEM_UI_FLAG_VISIBLE;
	mHideFlags = View.SYSTEM_UI_FLAG_LOW_PROFILE;
	mTestFlags = View.SYSTEM_UI_FLAG_LOW_PROFILE;

	if ((mFlags & FLAG_FULLSCREEN) != 0) {
		// If the client requested fullscreen, add flags relevant to hiding
		// the status bar. Note that some of these constants are new as of
		// API 16 (Jelly Bean). It is safe to use them, as they are inlined
		// at compile-time and do nothing on pre-Jelly Bean devices.
		mShowFlags |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
		mHideFlags |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_FULLSCREEN;
	}

	if ((mFlags & FLAG_HIDE_NAVIGATION) != 0) {
		// If the client requested hiding navigation, add relevant flags.
		mShowFlags |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
		mHideFlags |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
		mTestFlags |= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
	}
}
 
开发者ID:joaomneto,项目名称:TitanCompanion,代码行数:27,代码来源:SystemUiHiderHoneycomb.java

示例5: SystemUiHiderHoneycomb

/**
 * Constructor not intended to be called by clients. Use {@link SystemUiHider#getInstance} to
 * obtain an instance.
 */
protected SystemUiHiderHoneycomb(Activity activity, View anchorView, int flags) {
	super(activity, anchorView, flags);

	mShowFlags = View.SYSTEM_UI_FLAG_VISIBLE;
	mHideFlags = View.SYSTEM_UI_FLAG_LOW_PROFILE;
	mTestFlags = View.SYSTEM_UI_FLAG_LOW_PROFILE;

	if ((mFlags & FLAG_FULLSCREEN) != 0) {
		// If the client requested fullscreen, add flags relevant to hiding
		// the status bar. Note that some of these constants are new as of
		// API 16 (Jelly Bean). It is safe to use them, as they are inlined
		// at compile-time and do nothing on pre-Jelly Bean devices.
		mShowFlags |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
		mHideFlags |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_FULLSCREEN;
	}

	if ((mFlags & FLAG_HIDE_NAVIGATION) != 0) {
		// If the client requested hiding navigation, add relevant flags.
		mShowFlags |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
		mHideFlags |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
		mTestFlags |= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
	}
}
 
开发者ID:masterjc,项目名称:bluewatcher,代码行数:27,代码来源:SystemUiHiderHoneycomb.java

示例6: SystemUiHiderHoneycomb

/**
 * Constructor not intended to be called by clients. Use {@link SystemUiHider#getInstance} to
 * obtain an instance.
 */
protected SystemUiHiderHoneycomb(Activity activity, View anchorView, int flags) {
    super(activity, anchorView, flags);

    mShowFlags = View.SYSTEM_UI_FLAG_VISIBLE;
    mHideFlags = View.SYSTEM_UI_FLAG_LOW_PROFILE;
    mTestFlags = View.SYSTEM_UI_FLAG_LOW_PROFILE;

    if ((mFlags & FLAG_FULLSCREEN) != 0) {
        // If the client requested fullscreen, add flags relevant to hiding
        // the status bar. Note that some of these constants are new as of
        // API 16 (Jelly Bean). It is safe to use them, as they are inlined
        // at compile-time and do nothing on pre-Jelly Bean devices.
        mShowFlags |= 0x00000400;// View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
        mHideFlags |= 0x00000400 //View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                      | 0x00000004; // View.SYSTEM_UI_FLAG_FULLSCREEN;
    }

    if ((mFlags & FLAG_HIDE_NAVIGATION) != 0) {
        // If the client requested hiding navigation, add relevant flags.
        mShowFlags |= 0x00000200;//View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
        mHideFlags |= 0x00000200//View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                      | 0x00000002;//View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
        mTestFlags |= 0x00000002;//View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
    }
}
 
开发者ID:starcor-company,项目名称:starcor.xul,代码行数:29,代码来源:SystemUiHiderHoneycomb.java

示例7: _expand

private void _expand() {
    View decorView = getWindow().getDecorView();
    if (decorView != null) {
        boolean isNotFullScreen = decorView.getSystemUiVisibility() == View.SYSTEM_UI_FLAG_VISIBLE;
        if (isNotFullScreen) {
            goFullscreen();
        } else {
            exitFullscreen();
        }
    }
}
 
开发者ID:maddog05,项目名称:whatanime-android,代码行数:11,代码来源:VideoPreviewActivity.java

示例8: onPause

@Override
protected void onPause() {

    mSounds.releaseBGM();
    pause();

    int uiOptions = View.SYSTEM_UI_FLAG_VISIBLE;
    getWindow().getDecorView().setSystemUiVisibility(uiOptions);

    mSounds.releaseBGM();
    super.onPause();
}
 
开发者ID:quaap,项目名称:SeafoodBerserker,代码行数:12,代码来源:PlayActivity.java

示例9: showSystemBar

protected void showSystemBar(boolean show) {
    if (mSystemBarShowing == show) return;
    mSystemUiVisibility = mPlayerView.getSystemUiVisibility();
    if (PlayerConfig.hasHackedFullScreen()) {
        final int STATUS_BAR_GONE =  (Build.VERSION.SDK_INT <= Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1 ? 0x00000004 : 0x000008);
        if (show)
            mSystemUiVisibility &= ~STATUS_BAR_GONE;
        else
            mSystemUiVisibility |= STATUS_BAR_GONE;
        manualVisibilityChange=true;
        mPlayerView.setSystemUiVisibility(mSystemUiVisibility);
        mSystemBarGone = !show;
    } else {
        int systemUiFlag = View.SYSTEM_UI_FLAG_LOW_PROFILE;
        if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) { /* ICS and less */
            if (show)
                mWindow.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
            else
                mWindow.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
        } else { /* JB and more */
            systemUiFlag |= 0x00000004 /* View.SYSTEM_UI_FLAG_FULLSCREEN */;
        }
        if (show) {
            mSystemUiVisibility &= ~systemUiFlag;
            if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT)
                mSystemUiVisibility = View.SYSTEM_UI_FLAG_VISIBLE;
        }
        else {
            mSystemUiVisibility |= systemUiFlag;
            if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT)
                    mSystemUiVisibility |= View.SYSTEM_UI_FLAG_IMMERSIVE;
        }
        mPlayerView.setSystemUiVisibility(mSystemUiVisibility);
        manualVisibilityChange=true;
        mSystemBarGone = false;
        if (PlayerConfig.canSystemBarHide()) {
            if (!show)
                mHandler.sendEmptyMessageDelayed(MSG_HIDE_SYSTEM_BAR, 1000);
        }
    }
    mSystemBarShowing = show;
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:42,代码来源:PlayerController.java

示例10: createShowFlags

@Override
protected int createShowFlags() {
    return View.SYSTEM_UI_FLAG_VISIBLE;
}
 
开发者ID:ujjwalagrawal17,项目名称:CodeCompilerApp,代码行数:4,代码来源:SystemUiHelperImplICS.java


注:本文中的android.view.View.SYSTEM_UI_FLAG_VISIBLE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。