diff options
| author | Charles Lombardo <clombardo169@gmail.com> | 2022-08-10 15:53:45 -0400 |
|---|---|---|
| committer | Charles Lombardo <clombardo169@gmail.com> | 2022-08-10 15:53:45 -0400 |
| commit | 0c89e5ea8d35457dbbee3a1855cbebbf916a3369 (patch) | |
| tree | 367f57aa3897c894119d602da1cf9cf1f494ccd3 /Source/Android | |
| parent | 1dff1c3fe833f5b690ad6324914f5dff7813fb11 (diff) | |
Add AndroidTV splash screen
Diffstat (limited to 'Source/Android')
3 files changed, 14 insertions, 3 deletions
diff --git a/Source/Android/app/src/main/AndroidManifest.xml b/Source/Android/app/src/main/AndroidManifest.xml index e1352b47c2..cb493596e8 100644 --- a/Source/Android/app/src/main/AndroidManifest.xml +++ b/Source/Android/app/src/main/AndroidManifest.xml @@ -49,7 +49,7 @@ <activity android:name=".ui.main.MainActivity" android:exported="true" - android:theme="@style/Theme.Dolphin.Splash"> + android:theme="@style/Theme.Dolphin.Splash.Main"> <!-- This intentfilter marks this Activity as the one that gets launched from Home screen. --> <intent-filter> @@ -62,7 +62,7 @@ <activity android:name=".ui.main.TvMainActivity" android:exported="true" - android:theme="@style/Theme.Dolphin.TV"> + android:theme="@style/Theme.Dolphin.Splash.TV"> <!-- This intentfilter marks this Activity as the one that gets launched from Home screen. --> <intent-filter> diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/main/TvMainActivity.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/main/TvMainActivity.java index d486533c55..8e9c96442c 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/main/TvMainActivity.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/main/TvMainActivity.java @@ -10,6 +10,7 @@ import android.util.TypedValue; import androidx.annotation.NonNull; import androidx.core.content.ContextCompat; +import androidx.core.splashscreen.SplashScreen; import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentManager; import androidx.leanback.app.BrowseSupportFragment; @@ -53,6 +54,10 @@ public final class TvMainActivity extends FragmentActivity @Override protected void onCreate(Bundle savedInstanceState) { + SplashScreen splashScreen = SplashScreen.installSplashScreen(this); + splashScreen.setKeepOnScreenCondition( + () -> !DirectoryInitialization.areDolphinDirectoriesReady()); + super.onCreate(savedInstanceState); setContentView(R.layout.activity_tv_main); diff --git a/Source/Android/app/src/main/res/values/themes.xml b/Source/Android/app/src/main/res/values/themes.xml index 5b9dd6859d..34f476380f 100644 --- a/Source/Android/app/src/main/res/values/themes.xml +++ b/Source/Android/app/src/main/res/values/themes.xml @@ -1,11 +1,17 @@ <?xml version="1.0" encoding="utf-8"?> <resources> - <style name="Theme.Dolphin.Splash" parent="Theme.SplashScreen"> + <style name="Theme.Dolphin.Splash.Main" parent="Theme.SplashScreen"> <item name="windowSplashScreenBackground">@color/dolphin_surface</item> <item name="windowSplashScreenAnimatedIcon">@drawable/ic_dolphin</item> <item name="postSplashScreenTheme">@style/Theme.Dolphin.Main</item> </style> + <style name="Theme.Dolphin.Splash.TV" parent="Theme.SplashScreen"> + <item name="windowSplashScreenBackground">@color/dolphin_surface</item> + <item name="windowSplashScreenAnimatedIcon">@drawable/ic_dolphin</item> + <item name="postSplashScreenTheme">@style/Theme.Dolphin.TV</item> + </style> + <!-- Base theme --> <style name="Theme.Dolphin.Main" parent="Theme.Material3.DayNight.NoActionBar"> <item name="colorSurface">@color/dolphin_blue</item> |
