diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 7c566c8f0d..e109e33199 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -47,6 +47,7 @@ android:label="@string/application_name" android:requestLegacyExternalStorage="true" android:roundIcon="@mipmap/ic_launcher_round" + android:resizeableActivity="true" android:supportsRtl="false" android:theme="@style/Theme.TermuxApp.DayNight.DarkActionBar" tools:targetApi="m"> @@ -74,6 +75,14 @@ + + + + + + + + + + = 30) { + // getWindow().setDecorFitsSystemWindows(false); + // WindowInsetsController insetsController = getWindow().getInsetsController(); + // if (insetsController != null) { + // insetsController.hide(WindowInsets.Type.navigationBars() | WindowInsets.Type.statusBars()); + // insetsController.setSystemBarsBehavior(WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE); + // } + // } else { + View decorView = getWindow().getDecorView(); + int flags = View.SYSTEM_UI_FLAG_LAYOUT_STABLE + | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION + | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN + | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION + | View.SYSTEM_UI_FLAG_FULLSCREEN + | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; + decorView.setSystemUiVisibility(flags); + decorView.setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() { + @Override + public void onSystemUiVisibilityChange(int visibility) { + if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) { + decorView.setSystemUiVisibility(flags); + } + } + }); + // } + } + + @SuppressWarnings("deprecation") + private void disableImmersiveMode() { + // if (Build.VERSION.SDK_INT >= 30) { + // getWindow().setDecorFitsSystemWindows(true); + // WindowInsetsController insetsController = getWindow().getInsetsController(); + // if (insetsController != null) { + // insetsController.show(WindowInsets.Type.navigationBars() | WindowInsets.Type.statusBars()); + // insetsController.setSystemBarsBehavior( + // Build.VERSION.SDK_INT >= 31 + // ? WindowInsetsController.BEHAVIOR_DEFAULT + // : WindowInsetsController.BEHAVIOR_SHOW_BARS_BY_SWIPE + // ); + // } + // } else { + View decorView = getWindow().getDecorView(); + int flags = View.SYSTEM_UI_FLAG_LAYOUT_STABLE + | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION + | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN; + decorView.setSystemUiVisibility(flags); + decorView.setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() { + @Override + public void onSystemUiVisibilityChange(int visibility) { + if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) { + decorView.setSystemUiVisibility(flags); + } + } + }); + // } + } }