summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Charles Lombardo2023-03-15 16:37:14 -0400
committerGravatar bunnei2023-06-03 00:05:43 -0700
commit55e4c2d87b4f1e1cb40680a2b00fb08ef96e5cb5 (patch)
tree0abdf14958b58beb3577b53402fc527da80a1866 /src
parentandroid: Replace Picasso with Coil (diff)
downloadyuzu-55e4c2d87b4f1e1cb40680a2b00fb08ef96e5cb5.tar.gz
yuzu-55e4c2d87b4f1e1cb40680a2b00fb08ef96e5cb5.tar.xz
yuzu-55e4c2d87b4f1e1cb40680a2b00fb08ef96e5cb5.zip
android: Use androidx splash screen
Diffstat (limited to 'src')
-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 {
136 implementation 'androidx.preference:preference:1.2.0' 136 implementation 'androidx.preference:preference:1.2.0'
137 implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1" 137 implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1"
138 implementation "io.coil-kt:coil:2.2.2" 138 implementation "io.coil-kt:coil:2.2.2"
139 implementation 'androidx.core:core-splashscreen:1.0.0'
139 140
140 // Allows FRP-style asynchronous operations in Android. 141 // Allows FRP-style asynchronous operations in Android.
141 implementation 'io.reactivex:rxandroid:1.2.1' 142 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 @@
32 <activity 32 <activity
33 android:name="org.yuzu.yuzu_emu.ui.main.MainActivity" 33 android:name="org.yuzu.yuzu_emu.ui.main.MainActivity"
34 android:exported="true" 34 android:exported="true"
35 android:theme="@style/Theme.Yuzu.Main" 35 android:theme="@style/Theme.Yuzu.Splash.Main"
36 android:resizeableActivity="false"> 36 android:resizeableActivity="false">
37 37
38 <!-- This intentfilter marks this Activity as the one that gets launched from Home screen. --> 38 <!-- 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
14import android.widget.Toast 14import android.widget.Toast
15import androidx.appcompat.app.AppCompatActivity 15import androidx.appcompat.app.AppCompatActivity
16import androidx.appcompat.widget.Toolbar 16import androidx.appcompat.widget.Toolbar
17import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
17import androidx.core.view.ViewCompat 18import androidx.core.view.ViewCompat
18import androidx.core.view.WindowCompat 19import androidx.core.view.WindowCompat
19import androidx.core.view.WindowInsetsCompat 20import androidx.core.view.WindowInsetsCompat
20import androidx.core.view.updatePadding 21import androidx.core.view.updatePadding
21import com.google.android.material.appbar.AppBarLayout 22import com.google.android.material.appbar.AppBarLayout
22import com.google.android.material.color.MaterialColors
23import com.google.android.material.dialog.MaterialAlertDialogBuilder 23import com.google.android.material.dialog.MaterialAlertDialogBuilder
24import org.yuzu.yuzu_emu.NativeLibrary 24import org.yuzu.yuzu_emu.NativeLibrary
25import org.yuzu.yuzu_emu.R 25import org.yuzu.yuzu_emu.R
@@ -35,6 +35,9 @@ class MainActivity : AppCompatActivity(), MainView {
35 private val presenter = MainPresenter(this) 35 private val presenter = MainPresenter(this)
36 36
37 override fun onCreate(savedInstanceState: Bundle?) { 37 override fun onCreate(savedInstanceState: Bundle?) {
38 val splashScreen = installSplashScreen()
39 splashScreen.setKeepOnScreenCondition { !DirectoryInitialization.areDirectoriesReady() }
40
38 ThemeHelper.setTheme(this) 41 ThemeHelper.setTheme(this)
39 42
40 super.onCreate(savedInstanceState) 43 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 @@
1<?xml version="1.0" encoding="utf-8"?> 1<?xml version="1.0" encoding="utf-8"?>
2<resources> 2<resources>
3 3
4 <style name="Theme.Yuzu.Splash.Main" parent="Theme.SplashScreen">
5 <item name="windowSplashScreenBackground">@color/yuzu_surface</item>
6 <item name="windowSplashScreenAnimatedIcon">@drawable/ic_yuzu</item>
7 <item name="postSplashScreenTheme">@style/Theme.Yuzu.Main</item>
8 </style>
9
4 <style name="Theme.Yuzu" parent="Theme.Material3.DayNight.NoActionBar"> 10 <style name="Theme.Yuzu" parent="Theme.Material3.DayNight.NoActionBar">
5 <item name="colorPrimary">@color/yuzu_primary</item> 11 <item name="colorPrimary">@color/yuzu_primary</item>
6 <item name="colorOnPrimary">@color/yuzu_onPrimary</item> 12 <item name="colorOnPrimary">@color/yuzu_onPrimary</item>