Skip to content

Commit ce893fb

Browse files
committed
优化适配 Android 12 SplashScreen 特性的代码写法
1 parent 7239cc4 commit ce893fb

2 files changed

Lines changed: 6 additions & 20 deletions

File tree

app/src/main/res/values-v31/styles.xml

Lines changed: 0 additions & 19 deletions
This file was deleted.

app/src/main/res/values/styles.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<resources>
2+
<resources xmlns:tools="http://schemas.android.com/tools">
33

44
<!-- 应用主题样式 -->
55
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
@@ -46,6 +46,11 @@
4646
<!-- https://www.jianshu.com/p/d0d907754603 -->
4747
<item name="android:windowIsTranslucent">false</item>
4848
<item name="android:windowDisablePreview">true</item>
49+
<!-- 适配 Android 12 SplashScreen 特性 -->
50+
<item name="android:windowSplashScreenBackground" tools:targetApi="31">@color/transparent</item>
51+
<item name="android:windowSplashScreenIconBackgroundColor" tools:targetApi="31">@color/transparent</item>
52+
<item name="android:windowSplashScreenAnimatedIcon" tools:targetApi="31">@color/transparent</item>
53+
<item name="android:windowSplashScreenBrandingImage" tools:targetApi="31">@color/transparent</item>
4954
</style>
5055

5156
</resources>

0 commit comments

Comments
 (0)