feat(theme): add Theme.YaYa.Starting aligned with Compose background
This commit is contained in:
parent
e97c2f3015
commit
7ae0e80baf
@ -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" />
|
||||
|
||||
|
||||
9
app/src/main/res/values-night/colors.xml
Normal file
9
app/src/main/res/values-night/colors.xml
Normal 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>
|
||||
@ -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>
|
||||
|
||||
9
app/src/main/res/values/colors.xml
Normal file
9
app/src/main/res/values/colors.xml
Normal 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>
|
||||
@ -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>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user