updated ndk & sdk use immersive mode

This commit is contained in:
izzy2lost
2025-08-28 05:11:34 -04:00
parent a4a14ac508
commit dd50b6959b
5 changed files with 41 additions and 9 deletions
@@ -206,19 +206,35 @@ public class MainActivity extends AppCompatActivity implements GamesCoverDialogF
}
private void hideStatusBar() {
// Make immersive (hide status + navigation) and allow swipe to reveal temporarily
Window w = getWindow();
if (w == null) return;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
// Tell Window to lay out edge-to-edge and hide all system bars
w.setDecorFitsSystemWindows(false);
WindowInsetsController controller = w.getInsetsController();
if (controller != null) {
controller.hide(WindowInsets.Type.statusBars());
controller.hide(WindowInsets.Type.systemBars());
controller.setSystemBarsBehavior(WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE);
}
} else {
w.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
View decor = w.getDecorView();
int flags = View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
decor.setSystemUiVisibility(flags);
}
}
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (hasFocus) hideStatusBar();
}
private void pickGamesFolder() {
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION