From 27c280534d6ed9cc4c41bba01c5bdcc9bf024235 Mon Sep 17 00:00:00 2001 From: Charles Lombardo Date: Thu, 16 Mar 2023 02:30:47 -0400 Subject: [PATCH] citra_android: Use androidx splash screen (#6355) --- src/android/app/build.gradle | 1 + src/android/app/src/main/AndroidManifest.xml | 2 +- .../main/java/org/citra/citra_emu/ui/main/MainActivity.java | 4 ++++ src/android/app/src/main/res/values/themes.xml | 6 ++++++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/android/app/build.gradle b/src/android/app/build.gradle index 7f4c64e55..8e665274e 100644 --- a/src/android/app/build.gradle +++ b/src/android/app/build.gradle @@ -126,6 +126,7 @@ dependencies { implementation 'androidx.fragment:fragment:1.5.3' implementation "androidx.slidingpanelayout:slidingpanelayout:1.2.0" implementation 'com.google.android.material:material:1.6.1' + implementation 'androidx.core:core-splashscreen:1.0.0' // For loading huge screenshots from the disk. implementation 'com.squareup.picasso:picasso:2.71828' diff --git a/src/android/app/src/main/AndroidManifest.xml b/src/android/app/src/main/AndroidManifest.xml index 7d35fe910..6df877dc9 100644 --- a/src/android/app/src/main/AndroidManifest.xml +++ b/src/android/app/src/main/AndroidManifest.xml @@ -44,7 +44,7 @@ diff --git a/src/android/app/src/main/java/org/citra/citra_emu/ui/main/MainActivity.java b/src/android/app/src/main/java/org/citra/citra_emu/ui/main/MainActivity.java index 75e25c4b1..710910887 100644 --- a/src/android/app/src/main/java/org/citra/citra_emu/ui/main/MainActivity.java +++ b/src/android/app/src/main/java/org/citra/citra_emu/ui/main/MainActivity.java @@ -11,6 +11,7 @@ import android.widget.Toast; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; +import androidx.core.splashscreen.SplashScreen; import org.citra.citra_emu.NativeLibrary; import org.citra.citra_emu.R; @@ -48,6 +49,9 @@ public final class MainActivity extends AppCompatActivity implements MainView { @Override protected void onCreate(Bundle savedInstanceState) { + SplashScreen splashScreen = SplashScreen.installSplashScreen(this); + splashScreen.setKeepOnScreenCondition(() -> !DirectoryInitialization.areCitraDirectoriesReady()); + ThemeUtil.applyTheme(this); super.onCreate(savedInstanceState); diff --git a/src/android/app/src/main/res/values/themes.xml b/src/android/app/src/main/res/values/themes.xml index edff173fe..e74e37030 100644 --- a/src/android/app/src/main/res/values/themes.xml +++ b/src/android/app/src/main/res/values/themes.xml @@ -1,6 +1,12 @@ + +