|
@@ -1012,10 +1012,22 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|
|
}
|
|
}
|
|
|
SDLActivity.mFullscreenModeActive = true;
|
|
SDLActivity.mFullscreenModeActive = true;
|
|
|
} else {
|
|
} else {
|
|
|
- int flags = View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_VISIBLE;
|
|
|
|
|
- window.getDecorView().setSystemUiVisibility(flags);
|
|
|
|
|
- window.addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
|
|
|
|
|
- window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
|
|
|
|
|
|
+ if (Build.VERSION.SDK_INT >= 30 /* Android 11 (R) */) {
|
|
|
|
|
+ // The legacy setSystemUiVisibility() flags are ignored on
|
|
|
|
|
+ // API 30+, so the bars hidden by the modern enter path above
|
|
|
|
|
+ // would never come back. Restore them via WindowInsetsController.
|
|
|
|
|
+ final WindowInsetsController controller = window.getInsetsController();
|
|
|
|
|
+ if (controller != null) {
|
|
|
|
|
+ controller.setSystemBarsBehavior(
|
|
|
|
|
+ WindowInsetsController.BEHAVIOR_DEFAULT);
|
|
|
|
|
+ controller.show(WindowInsets.Type.systemBars());
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ int flags = View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_VISIBLE;
|
|
|
|
|
+ window.getDecorView().setSystemUiVisibility(flags);
|
|
|
|
|
+ window.addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
|
|
|
|
|
+ window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
|
|
|
|
+ }
|
|
|
SDLActivity.mFullscreenModeActive = false;
|
|
SDLActivity.mFullscreenModeActive = false;
|
|
|
}
|
|
}
|
|
|
if (Build.VERSION.SDK_INT >= 30 /* Android 11 (R) */) {
|
|
if (Build.VERSION.SDK_INT >= 30 /* Android 11 (R) */) {
|