소스 검색

enhance(android): enable android 12 style splash screen

Andelf 3 년 전
부모
커밋
00dcf5980c

+ 6 - 0
android/app/src/main/res/drawable/splash_centered.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layer-list  xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:drawable="@color/logoPrimary" />
+    <item android:drawable="@drawable/splash" android:gravity="center" />
+</layer-list>
+

+ 4 - 0
android/app/src/main/res/values/colors.xml

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <color name="logoPrimary">#002b36</color>
+</resources>

+ 7 - 2
android/app/src/main/res/values/styles.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<resources>
+<resources xmlns:tools="http://schemas.android.com/tools">
 
     <!-- Base application theme. -->
     <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
@@ -16,7 +16,12 @@
         <item name="android:windowIsTranslucent">true</item>
     </style>
 
+    <!-- App Starting -->
     <style name="AppTheme.NoActionBarLaunch" parent="Theme.SplashScreen">
-        <item name="android:background">@drawable/splash</item>
+        <item name="android:windowBackground">@drawable/splash_centered</item>
+
+        <item name="windowSplashScreenAnimationDuration">200</item>
+        <item name="windowSplashScreenIconBackgroundColor">@color/logoPrimary</item>
+        <item name="postSplashScreenTheme">@style/AppTheme</item>
     </style>
 </resources>