From 0c89e5ea8d35457dbbee3a1855cbebbf916a3369 Mon Sep 17 00:00:00 2001 From: Charles Lombardo Date: Wed, 10 Aug 2022 15:53:45 -0400 Subject: [PATCH] Add AndroidTV splash screen --- Source/Android/app/src/main/AndroidManifest.xml | 4 ++-- .../org/dolphinemu/dolphinemu/ui/main/TvMainActivity.java | 5 +++++ Source/Android/app/src/main/res/values/themes.xml | 8 +++++++- 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 @@ + android:theme="@style/Theme.Dolphin.Splash.Main"> @@ -62,7 +62,7 @@ + android:theme="@style/Theme.Dolphin.Splash.TV"> 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 @@ - + +