mirror of
https://github.com/PabloMK7/citra
synced 2024-11-15 05:08:23 +00:00
citra_android: Use androidx splash screen (#6355)
This commit is contained in:
parent
e18e30a8cc
commit
27c280534d
4 changed files with 12 additions and 1 deletions
|
@ -126,6 +126,7 @@ dependencies {
|
|||
implementation 'androidx.fragment:fragment:1.5.3'
|
||||
implementation "androidx.slidingpanelayout:slidingpanelayout:1.2.0"
|
||||
implementation 'com.google.android.material:material:1.6.1'
|
||||
implementation 'androidx.core:core-splashscreen:1.0.0'
|
||||
|
||||
// For loading huge screenshots from the disk.
|
||||
implementation 'com.squareup.picasso:picasso:2.71828'
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
|
||||
<activity
|
||||
android:name="org.citra.citra_emu.ui.main.MainActivity"
|
||||
android:theme="@style/Theme.Citra.Main"
|
||||
android:theme="@style/Theme.Citra.Splash.Main"
|
||||
android:resizeableActivity="false">
|
||||
|
||||
<!-- This intentfilter marks this Activity as the one that gets launched from Home screen. -->
|
||||
|
|
|
@ -11,6 +11,7 @@ import android.widget.Toast;
|
|||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.splashscreen.SplashScreen;
|
||||
|
||||
import org.citra.citra_emu.NativeLibrary;
|
||||
import org.citra.citra_emu.R;
|
||||
|
@ -48,6 +49,9 @@ public final class MainActivity extends AppCompatActivity implements MainView {
|
|||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
SplashScreen splashScreen = SplashScreen.installSplashScreen(this);
|
||||
splashScreen.setKeepOnScreenCondition(() -> !DirectoryInitialization.areCitraDirectoriesReady());
|
||||
|
||||
ThemeUtil.applyTheme(this);
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="Theme.Citra.Splash.Main" parent="Theme.SplashScreen">
|
||||
<item name="windowSplashScreenBackground">@color/citra_surface</item>
|
||||
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_citra</item>
|
||||
<item name="postSplashScreenTheme">@style/Theme.Citra.Main</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Citra.Main" parent="Theme.Material3.DayNight.NoActionBar">
|
||||
<!-- Main theme colors -->
|
||||
<item name="colorPrimary">@color/citra_primary</item>
|
||||
|
|
Loading…
Reference in a new issue