From dd50b6959b11476edfeab6ec6371185df6793134 Mon Sep 17 00:00:00 2001 From: izzy2lost Date: Thu, 28 Aug 2025 05:11:34 -0400 Subject: [PATCH] updated ndk & sdk use immersive mode --- app/build.gradle | 12 ++++++----- .../java/com/izzy2lost/psx2/MainActivity.java | 20 +++++++++++++++++-- app/src/main/res/layout/activity_main.xml | 14 +++++++++++++ build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- 5 files changed, 41 insertions(+), 9 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index d07601b..765523b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -4,13 +4,14 @@ plugins { android { namespace 'com.izzy2lost.psx2' - compileSdk 34 - ndkVersion '27.0.12077973' + compileSdk 35 + buildToolsVersion '35.0.0' + ndkVersion '28.2.13676358' defaultConfig { applicationId "com.izzy2lost.psx2" minSdk 26 - targetSdk 34 + targetSdk 35 versionCode 1 versionName "1.0" @@ -38,8 +39,8 @@ android { } } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } externalNativeBuild { cmake { @@ -62,5 +63,6 @@ dependencies { implementation 'androidx.documentfile:documentfile:1.0.1' implementation 'androidx.recyclerview:recyclerview:1.3.2' implementation 'com.github.bumptech.glide:glide:4.16.0' + implementation 'androidx.activity:activity:1.9.3' annotationProcessor 'com.github.bumptech.glide:compiler:4.16.0' } diff --git a/app/src/main/java/com/izzy2lost/psx2/MainActivity.java b/app/src/main/java/com/izzy2lost/psx2/MainActivity.java index bb7bc53..e9b6f31 100644 --- a/app/src/main/java/com/izzy2lost/psx2/MainActivity.java +++ b/app/src/main/java/com/izzy2lost/psx2/MainActivity.java @@ -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 diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 931143f..861a571 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -19,6 +19,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="settings" + android:focusable="false" + android:focusableInTouchMode="false" app:rippleColor="#80cdcdcd" app:layout_constraintTop_toTopOf="parent" @@ -73,6 +75,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="controls" + android:focusable="false" + android:focusableInTouchMode="false" app:rippleColor="#80cdcdcd" app:layout_constraintTop_toTopOf="parent" @@ -86,6 +90,8 @@ android:layout_width="40dp" android:layout_height="40dp" android:visibility="gone" + android:focusable="false" + android:focusableInTouchMode="false" app:icon="@drawable/ic_unhide" app:iconSize="24dp" app:iconGravity="textStart" @@ -128,6 +134,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="GAMES" + android:focusable="false" + android:focusableInTouchMode="false" app:rippleColor="#80cdcdcd" /> @@ -137,6 +145,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="bios" + android:focusable="false" + android:focusableInTouchMode="false" app:rippleColor="#80cdcdcd" /> @@ -146,6 +156,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="saves" + android:focusable="false" + android:focusableInTouchMode="false" app:rippleColor="#80cdcdcd" /> @@ -155,6 +167,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="hide" + android:focusable="false" + android:focusableInTouchMode="false" app:rippleColor="#80cdcdcd" /> diff --git a/build.gradle b/build.gradle index ef3604a..9c6650e 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { -id 'com.android.application' version '8.1.4' apply false + id 'com.android.application' version '8.7.3' apply false } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1af9e09..dedd5d1 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME