summaryrefslogtreecommitdiffstats
path: root/src/android/app
diff options
context:
space:
mode:
authorCharles Lombardo <clombardo169@gmail.com>2023-03-15 21:37:14 +0100
committerbunnei <bunneidev@gmail.com>2023-06-03 09:05:43 +0200
commit55e4c2d87b4f1e1cb40680a2b00fb08ef96e5cb5 (patch)
tree0abdf14958b58beb3577b53402fc527da80a1866 /src/android/app
parentandroid: Replace Picasso with Coil (diff)
downloadyuzu-55e4c2d87b4f1e1cb40680a2b00fb08ef96e5cb5.tar
yuzu-55e4c2d87b4f1e1cb40680a2b00fb08ef96e5cb5.tar.gz
yuzu-55e4c2d87b4f1e1cb40680a2b00fb08ef96e5cb5.tar.bz2
yuzu-55e4c2d87b4f1e1cb40680a2b00fb08ef96e5cb5.tar.lz
yuzu-55e4c2d87b4f1e1cb40680a2b00fb08ef96e5cb5.tar.xz
yuzu-55e4c2d87b4f1e1cb40680a2b00fb08ef96e5cb5.tar.zst
yuzu-55e4c2d87b4f1e1cb40680a2b00fb08ef96e5cb5.zip
Diffstat (limited to 'src/android/app')
-rw-r--r--src/android/app/build.gradle1
-rw-r--r--src/android/app/src/main/AndroidManifest.xml2
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt5
-rw-r--r--src/android/app/src/main/res/values/themes.xml6
4 files changed, 12 insertions, 2 deletions
diff --git a/src/android/app/build.gradle b/src/android/app/build.gradle
index 68e11bb66..8b621f5d5 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.xml
index 6c6720222..7d3eccc5c 100644
--- a/src/android/app/src/main/AndroidManifest.xml
+++ b/src/android/app/src/main/AndroidManifest.xml
@@ -32,7 +32,7 @@
<activity
android: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.kt
index 768159857..f87f13463 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.FrameLayout
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.Toolbar
+import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import androidx.core.view.ViewCompat
import androidx.core.view.WindowCompat
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.updatePadding
import com.google.android.material.appbar.AppBarLayout
-import com.google.android.material.color.MaterialColors
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import org.yuzu.yuzu_emu.NativeLibrary
import 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.xml
index 268e72c4b..b2ed1d4b9 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>