當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。