下面列出了android.widget.FrameLayout#getSystemUiVisibility ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
void saveSystemVisibility(Activity activity) {
// If we are in fullscreen we may have also have hidden the system UI. This
// is overridden when we display the dialog. Save the system UI visibility
// state so we can restore it.
FrameLayout decor = (FrameLayout) activity.getWindow().getDecorView();
mSystemVisibility = decor.getSystemUiVisibility();
mRestoreSystemVisibility = (
(mSystemVisibility & View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN) != 0);
}
void restoreSystemVisibility(Activity activity) {
if (mRestoreSystemVisibility) {
FrameLayout decor = (FrameLayout) activity.getWindow().getDecorView();
// In some cases we come out of fullscreen before closing this dialog. In these
// cases we don't want to restore the system UI visibility state.
int systemVisibility = decor.getSystemUiVisibility();
if ((systemVisibility & View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN) != 0) {
decor.setSystemUiVisibility(mSystemVisibility);
}
}
}
void saveSystemVisibility(Activity activity) {
// If we are in fullscreen we may have also have hidden the system UI. This
// is overridden when we display the dialog. Save the system UI visibility
// state so we can restore it.
FrameLayout decor = (FrameLayout) activity.getWindow().getDecorView();
mSystemVisibility = decor.getSystemUiVisibility();
mRestoreSystemVisibility = (
(mSystemVisibility & View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN) != 0);
}
void restoreSystemVisibility(Activity activity) {
if (mRestoreSystemVisibility) {
FrameLayout decor = (FrameLayout) activity.getWindow().getDecorView();
// In some cases we come out of fullscreen before closing this dialog. In these
// cases we don't want to restore the system UI visibility state.
int systemVisibility = decor.getSystemUiVisibility();
if ((systemVisibility & View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN) != 0) {
decor.setSystemUiVisibility(mSystemVisibility);
}
}
}
void saveSystemVisibility(Activity activity) {
// If we are in fullscreen we may have also have hidden the system UI. This
// is overridden when we display the dialog. Save the system UI visibility
// state so we can restore it.
FrameLayout decor = (FrameLayout) activity.getWindow().getDecorView();
mSystemVisibilityToRestore = decor.getSystemUiVisibility();
mWasFullscreenBeforeShowing = (
(mSystemVisibilityToRestore & View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN) != 0);
}
void restoreSystemVisibility(Activity activity) {
if (!mWasFullscreenBeforeShowing) return;
FrameLayout decor = (FrameLayout) activity.getWindow().getDecorView();
// In some cases we come out of fullscreen before closing this dialog. In these
// cases we don't want to restore the system UI visibility state.
boolean isStillFullscreen =
(decor.getSystemUiVisibility() & View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN) == 0;
if (!isStillFullscreen) return;
decor.setSystemUiVisibility(mSystemVisibilityToRestore);
}
void saveSystemVisibility(Activity activity) {
// If we are in fullscreen we may have also have hidden the system UI. This
// is overridden when we display the dialog. Save the system UI visibility
// state so we can restore it.
FrameLayout decor = (FrameLayout) activity.getWindow().getDecorView();
mSystemVisibility = decor.getSystemUiVisibility();
mRestoreSystemVisibility = (
(mSystemVisibility & View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN) != 0);
}
void restoreSystemVisibility(Activity activity) {
if (mRestoreSystemVisibility) {
FrameLayout decor = (FrameLayout) activity.getWindow().getDecorView();
// In some cases we come out of fullscreen before closing this dialog. In these
// cases we don't want to restore the system UI visibility state.
int systemVisibility = decor.getSystemUiVisibility();
if ((systemVisibility & View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN) != 0) {
decor.setSystemUiVisibility(mSystemVisibility);
}
}
}
void saveSystemVisibility(Activity activity) {
// If we are in fullscreen we may have also have hidden the system UI. This
// is overridden when we display the dialog. Save the system UI visibility
// state so we can restore it.
FrameLayout decor = (FrameLayout) activity.getWindow().getDecorView();
mSystemVisibility = decor.getSystemUiVisibility();
mRestoreSystemVisibility = (
(mSystemVisibility & View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN) != 0);
}
void restoreSystemVisibility(Activity activity) {
if (mRestoreSystemVisibility) {
FrameLayout decor = (FrameLayout) activity.getWindow().getDecorView();
// In some cases we come out of fullscreen before closing this dialog. In these
// cases we don't want to restore the system UI visibility state.
int systemVisibility = decor.getSystemUiVisibility();
if ((systemVisibility & View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN) != 0) {
decor.setSystemUiVisibility(mSystemVisibility);
}
}
}
void saveSystemVisibility(Activity activity) {
// If we are in fullscreen we may have also have hidden the system UI. This
// is overridden when we display the dialog. Save the system UI visibility
// state so we can restore it.
FrameLayout decor = (FrameLayout) activity.getWindow().getDecorView();
mSystemVisibilityToRestore = decor.getSystemUiVisibility();
mWasFullscreenBeforeShowing = (
(mSystemVisibilityToRestore & View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN) != 0);
}
void restoreSystemVisibility(Activity activity) {
if (!mWasFullscreenBeforeShowing) return;
FrameLayout decor = (FrameLayout) activity.getWindow().getDecorView();
// In some cases we come out of fullscreen before closing this dialog. In these
// cases we don't want to restore the system UI visibility state.
boolean isStillFullscreen =
(decor.getSystemUiVisibility() & View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN) == 0;
if (!isStillFullscreen) return;
decor.setSystemUiVisibility(mSystemVisibilityToRestore);
}
void saveSystemVisibility(Activity activity) {
// If we are in fullscreen we may have also have hidden the system UI. This
// is overridden when we display the dialog. Save the system UI visibility
// state so we can restore it.
FrameLayout decor = (FrameLayout) activity.getWindow().getDecorView();
mSystemVisibility = decor.getSystemUiVisibility();
mRestoreSystemVisibility = (
(mSystemVisibility & View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN) != 0);
}
void restoreSystemVisibility(Activity activity) {
if (mRestoreSystemVisibility) {
FrameLayout decor = (FrameLayout) activity.getWindow().getDecorView();
// In some cases we come out of fullscreen before closing this dialog. In these
// cases we don't want to restore the system UI visibility state.
int systemVisibility = decor.getSystemUiVisibility();
if ((systemVisibility & View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN) != 0) {
decor.setSystemUiVisibility(mSystemVisibility);
}
}
}
void saveSystemVisibility(Activity activity) {
// If we are in fullscreen we may have also have hidden the system UI. This
// is overridden when we display the dialog. Save the system UI visibility
// state so we can restore it.
FrameLayout decor = (FrameLayout) activity.getWindow().getDecorView();
mSystemVisibility = decor.getSystemUiVisibility();
mRestoreSystemVisibility = (
(mSystemVisibility & View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN) != 0);
}
void restoreSystemVisibility(Activity activity) {
if (mRestoreSystemVisibility) {
FrameLayout decor = (FrameLayout) activity.getWindow().getDecorView();
// In some cases we come out of fullscreen before closing this dialog. In these
// cases we don't want to restore the system UI visibility state.
int systemVisibility = decor.getSystemUiVisibility();
if ((systemVisibility & View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN) != 0) {
decor.setSystemUiVisibility(mSystemVisibility);
}
}
}
void saveSystemVisibility(Activity activity) {
// If we are in fullscreen we may have also have hidden the system UI. This
// is overridden when we display the dialog. Save the system UI visibility
// state so we can restore it.
FrameLayout decor = (FrameLayout) activity.getWindow().getDecorView();
mSystemVisibilityToRestore = decor.getSystemUiVisibility();
mWasFullscreenBeforeShowing = (
(mSystemVisibilityToRestore & View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN) != 0);
}
void restoreSystemVisibility(Activity activity) {
if (!mWasFullscreenBeforeShowing) return;
FrameLayout decor = (FrameLayout) activity.getWindow().getDecorView();
// In some cases we come out of fullscreen before closing this dialog. In these
// cases we don't want to restore the system UI visibility state.
boolean isStillFullscreen =
(decor.getSystemUiVisibility() & View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN) == 0;
if (!isStillFullscreen) return;
decor.setSystemUiVisibility(mSystemVisibilityToRestore);
}