VERY experimental Nintendo Switch 2 emulator
C++
android: Use androidx splash screen
Charles Lombardo923821483703
diff --git a/src/android/app/build.gradle b/src/android/app/build.gradleindex 68e11bb664..8b621f5d50 100644--- a/src/android/app/build.gradle+++ b/src/android/app/build.gradle@@ -136,6 +136,7 @@ dependencies {implementation 'androidx.preference:preference:1.2.0'implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1"implementation "io.coil-kt:coil:2.2.2"+ implementation 'androidx.core:core-splashscreen:1.0.0'// Allows FRP-style asynchronous operations in Android.implementation 'io.reactivex:rxandroid:1.2.1'diff --git a/src/android/app/src/main/AndroidManifest.xml b/src/android/app/src/main/AndroidManifest.xmlindex 6c6720222e..7d3eccc5c2 100644--- a/src/android/app/src/main/AndroidManifest.xml+++ b/src/android/app/src/main/AndroidManifest.xml@@ -32,7 +32,7 @@<activityandroid:name="org.yuzu.yuzu_emu.ui.main.MainActivity"android:exported="true"- android:theme="@style/Theme.Yuzu.Main"+ android:theme="@style/Theme.Yuzu.Splash.Main"android:resizeableActivity="false"><!-- This intentfilter marks this Activity as the one that gets launched from Home screen. -->diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.ktindex 7681598571..f87f134632 100644--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt@@ -14,12 +14,12 @@ import android.widget.FrameLayoutimport android.widget.Toastimport androidx.appcompat.app.AppCompatActivityimport androidx.appcompat.widget.Toolbar+import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreenimport androidx.core.view.ViewCompatimport androidx.core.view.WindowCompatimport androidx.core.view.WindowInsetsCompatimport androidx.core.view.updatePaddingimport com.google.android.material.appbar.AppBarLayout-import com.google.android.material.color.MaterialColorsimport com.google.android.material.dialog.MaterialAlertDialogBuilderimport org.yuzu.yuzu_emu.NativeLibraryimport org.yuzu.yuzu_emu.R@@ -35,6 +35,9 @@ class MainActivity : AppCompatActivity(), MainView {private val presenter = MainPresenter(this)override fun onCreate(savedInstanceState: Bundle?) {+ val splashScreen = installSplashScreen()+ splashScreen.setKeepOnScreenCondition { !DirectoryInitialization.areDirectoriesReady() }+ThemeHelper.setTheme(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.xmlindex 268e72c4b2..b2ed1d4b97 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 @@<?xml version="1.0" encoding="utf-8"?><resources>+ <style name="Theme.Yuzu.Splash.Main" parent="Theme.SplashScreen">+ <item name="windowSplashScreenBackground">@color/yuzu_surface</item>+ <item name="windowSplashScreenAnimatedIcon">@drawable/ic_yuzu</item>+ <item name="postSplashScreenTheme">@style/Theme.Yuzu.Main</item>+ </style>+<style name="Theme.Yuzu" parent="Theme.Material3.DayNight.NoActionBar"><item name="colorPrimary">@color/yuzu_primary</item><item name="colorOnPrimary">@color/yuzu_onPrimary</item>