Java Code Examples for android.view.View.SYSTEM_UI_FLAG_VISIBLE

The following are Jave code examples for showing how to use SYSTEM_UI_FLAG_VISIBLE of the android.view.View class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: BBSSDK-for-Android   File: StatusBarCompatLollipop.java   Source Code and License Vote up 7 votes
/**
 * 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();
	}
}
 
Example 2
Project: Phoenicia   File: SystemUiHiderHoneycomb.java   Source Code and License Vote up 6 votes
/**
 * 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;
    }
}
 
Example 3
Project: Coder   File: ImmersionBar.java   Source Code and License Vote up 6 votes
/**
 * 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;
}
 
Example 4
Project: TitanCompanion   File: SystemUiHiderHoneycomb.java   Source Code and License Vote up 6 votes
/**
 * 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;
	}
}
 
Example 5
Project: bluewatcher   File: SystemUiHiderHoneycomb.java   Source Code and License Vote up 6 votes
/**
 * 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;
	}
}
 
Example 6
Project: starcor.xul   File: SystemUiHiderHoneycomb.java   Source Code and License Vote up 6 votes
/**
 * 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;
    }
}
 
Example 7
Project: whatanime-android   File: VideoPreviewActivity.java   Source Code and License Vote up 5 votes
private void _expand() {
    View decorView = getWindow().getDecorView();
    if (decorView != null) {
        boolean isNotFullScreen = decorView.getSystemUiVisibility() == View.SYSTEM_UI_FLAG_VISIBLE;
        if (isNotFullScreen) {
            goFullscreen();
        } else {
            exitFullscreen();
        }
    }
}
 
Example 8
Project: SeafoodBerserker   File: PlayActivity.java   Source Code and License Vote up 5 votes
@Override
protected void onPause() {

    mSounds.releaseBGM();
    pause();

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

    mSounds.releaseBGM();
    super.onPause();
}
 
Example 9
Project: aos-Video   File: PlayerController.java   Source Code and License Vote up 4 votes
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;
}
 
Example 10
Project: CodeCompilerApp   File: SystemUiHelperImplICS.java   Source Code and License Vote up 4 votes
@Override
protected int createShowFlags() {
    return View.SYSTEM_UI_FLAG_VISIBLE;
}
 
Example 11
Project: RetroMusicPlayer   File: SystemUiHelperImplICS.java   Source Code and License Vote up 4 votes
@Override
protected int createShowFlags() {
    return View.SYSTEM_UI_FLAG_VISIBLE;
}