Improve splash screen compatibility

This commit is contained in:
Oscar Mira 2025-04-04 18:57:59 +02:00
parent 875045fafa
commit 33421c167f
No known key found for this signature in database
GPG key ID: B371B98C5DC32237
8 changed files with 28 additions and 16 deletions

View file

@ -467,6 +467,7 @@ dependencies {
implementation(libs.androidx.asynclayoutinflater)
implementation(libs.androidx.asynclayoutinflater.appcompat)
implementation(libs.androidx.emoji2)
implementation(libs.androidx.splashscreen)
implementation(libs.androidx.webkit)
"gmsImplementation"(libs.firebase.messaging) {
exclude(group = "com.google.firebase", module = "firebase-core")

View file

@ -103,7 +103,7 @@
android:fullBackupOnly="false"
android:allowBackup="true"
android:backupAgent=".absbackup.SignalBackupAgent"
android:theme="@style/TextSecure.LightTheme"
android:theme="@style/Theme.Molly.Starting"
android:largeHeap="true"
android:networkSecurityConfig="@xml/network_security_config">
@ -1005,7 +1005,7 @@
android:exported="false"/>
<activity android:name=".MainActivity"
android:theme="@style/Theme.Signal.DayNight.NoActionBar"
android:theme="@style/Theme.Molly.Starting"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
android:resizeableActivity="true"
android:exported="false"/>

View file

@ -23,10 +23,10 @@ public final class SplashScreenUtil {
switch (theme) {
case LIGHT:
activity.getSplashScreen().setSplashScreenTheme(R.style.Theme_Signal_DayNight_NoActionBar_LightSplash);
activity.getSplashScreen().setSplashScreenTheme(R.style.Theme_Molly_Starting_Light);
break;
case DARK:
activity.getSplashScreen().setSplashScreenTheme(R.style.Theme_Signal_DayNight_NoActionBar_DarkSplash);
activity.getSplashScreen().setSplashScreenTheme(R.style.Theme_Molly_Starting_Dark);
break;
case SYSTEM:
activity.getSplashScreen().setSplashScreenTheme(Resources.ID_NULL);

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Signal.DayNight.NoActionBar" parent="TextSecure.DarkNoActionBar">
<item name="android:windowSplashScreenBackground">@color/core_ultramarine_icon_dark</item>
<item name="android:windowSplashScreenAnimatedIcon">@drawable/ic_splash_animated_dark</item>
<style name="Theme.Molly.Starting" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">@color/core_ultramarine_icon_dark</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_splash_animated_dark</item>
</style>
</resources>

View file

@ -1,19 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Signal.DayNight.NoActionBar" parent="TextSecure.LightNoActionBar">
<item name="android:windowSplashScreenBackground">@color/core_ultramarine_icon</item>
<item name="android:windowSplashScreenAnimatedIcon">@drawable/ic_splash_animated</item>
<style name="Theme.Molly.Starting" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">@color/core_ultramarine_icon</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_splash_animated</item>
</style>
<!-- Exists for manual override of Splash theme when setting app theme-->
<style name="Theme.Signal.DayNight.NoActionBar.LightSplash" parent="Theme.Signal.DayNight.NoActionBar">
<item name="android:windowSplashScreenBackground">@color/core_ultramarine_icon</item>
<item name="android:windowSplashScreenAnimatedIcon">@drawable/ic_splash_animated</item>
<style name="Theme.Molly.Starting.Light" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">@color/core_ultramarine_icon</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_splash_animated</item>
</style>
<!-- Exists for manual override of Splash theme when setting app theme-->
<style name="Theme.Signal.DayNight.NoActionBar.DarkSplash" parent="Theme.Signal.DayNight.NoActionBar">
<item name="android:windowSplashScreenBackground">@color/core_ultramarine_icon_dark</item>
<item name="android:windowSplashScreenAnimatedIcon">@drawable/ic_splash_animated_dark</item>
<style name="Theme.Molly.Starting.Dark" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">@color/core_ultramarine_icon_dark</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_splash_animated_dark</item>
</style>
</resources>

View file

@ -15,6 +15,8 @@
<!-- MOLLY: Theme.Signal.DayNight.NoActionBar now in light_themes.xml -->
<style name="Theme.Molly.Starting" parent="Theme.SplashScreen" />
<style name="TextSecure.LightNoActionBar" parent="@style/TextSecure.BaseLightNoActionBar">
<!-- leave empty to allow overriding -->
</style>

View file

@ -110,6 +110,7 @@ androidx-asynclayoutinflater = "androidx.asynclayoutinflater:asynclayoutinflater
androidx-asynclayoutinflater-appcompat = "androidx.asynclayoutinflater:asynclayoutinflater-appcompat:1.1.0-alpha01"
androidx-emoji2 = "androidx.emoji2:emoji2:1.5.0"
androidx-documentfile = "androidx.documentfile:documentfile:1.0.1"
androidx-splashscreen = "androidx.core:core-splashscreen:1.0.1"
androidx-webkit = "androidx.webkit:webkit:1.4.0"
android-billing = "com.android.billingclient:billing-ktx:7.1.1"

View file

@ -1215,6 +1215,14 @@ https://docs.gradle.org/current/userguide/dependency_verification.html
<sha256 value="4d46646066c794f2812d5b33a9422d37e4f918c4d809cd1fb2579c7022ef2818" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="androidx.core" name="core-splashscreen" version="1.0.1">
<artifact name="core-splashscreen-1.0.1.aar">
<sha256 value="25c813ae7795c99dd20628527043f8d0425eb2e826e6c42cb77acbb6c01dde68" origin="Generated by Gradle"/>
</artifact>
<artifact name="core-splashscreen-1.0.1.module">
<sha256 value="0d02b8beee2ff62afd3a79393b4fd3ccb7c9f73266dbfdd29350875d5430abc7" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="androidx.cursoradapter" name="cursoradapter" version="1.0.0">
<artifact name="cursoradapter-1.0.0.aar">
<sha256 value="a81c8fe78815fa47df5b749deb52727ad11f9397da58b16017f4eb2c11e28564" origin="Generated by Gradle"/>