feat(theme): add Theme.YaYa.Starting aligned with Compose background

This commit is contained in:
xfy 2026-06-15 17:00:58 +08:00
parent e97c2f3015
commit 7ae0e80baf
5 changed files with 36 additions and 1 deletions

View File

@ -11,7 +11,8 @@
android:theme="@style/Theme.YaYa">
<activity
android:exported="true"
android:name=".MainActivity">
android:name=".MainActivity"
android:theme="@style/Theme.YaYa.Starting">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--
启动窗口背景使用的 Material 3 静态基准色Dark
Android 12+ 上 Compose 使用动态颜色,该值作为 fallback
在动态颜色获取前减少启动窗口与首帧的色差闪烁。
-->
<color name="splash_background">#FF1C1B1F</color>
</resources>

View File

@ -1,4 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.YaYa" parent="@android:style/Theme.Material.NoActionBar" />
<style name="Theme.YaYa.Starting" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">@color/splash_background</item>
<item name="postSplashScreenTheme">@style/Theme.YaYa</item>
</style>
</resources>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--
启动窗口背景使用的 Material 3 静态基准色Light
Android 12+ 上 Compose 使用动态颜色,该值作为 fallback
在动态颜色获取前减少启动窗口与首帧的色差闪烁。
-->
<color name="splash_background">#FFFBFE</color>
</resources>

View File

@ -1,4 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.YaYa" parent="@android:style/Theme.Material.Light.NoActionBar" />
<!--
启动主题:用于 MAIN/LAUNCHER Activity。
继承 Theme.SplashScreen保证 Android 12 以下也能获得一致的启动窗口行为。
windowSplashScreenBackground 使用 Material 3 静态基准色,作为动态颜色不可用时
的 fallback以减少启动窗口与 Compose 首帧之间的色差闪烁。
-->
<style name="Theme.YaYa.Starting" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">@color/splash_background</item>
<item name="postSplashScreenTheme">@style/Theme.YaYa</item>
</style>
</resources>