소스 검색

Added a app loading splash Screen (#2185)

* Added a app loading splash Screen. Just a theme that plays on start up before loading the actual app theme

* Added a app loading splash Screen. Just a theme that plays on start up before loading the actual app theme

* Update splash_background.xml
markelgaston 5 년 전
부모
커밋
141b7ac554
4개의 변경된 파일22개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      app/src/main/AndroidManifest.xml
  2. 8 0
      app/src/main/res/drawable/splash_background.xml
  3. 2 0
      app/src/main/res/values/colors.xml
  4. 10 0
      app/src/main/res/values/styles.xml

+ 2 - 1
app/src/main/AndroidManifest.xml

@@ -26,7 +26,8 @@
         android:theme="@style/Theme.Tachiyomi">
         <activity
             android:name=".ui.main.MainActivity"
-            android:launchMode="singleTask">
+            android:launchMode="singleTask"
+            android:theme="@style/SplashScreenBackground">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.LAUNCHER" />

+ 8 - 0
app/src/main/res/drawable/splash_background.xml

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

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

@@ -84,4 +84,6 @@
 
     <color name="md_teal_500">#009688</color>
 
+    <color name="colorSplash">#455A64</color>
+
 </resources>

+ 10 - 0
app/src/main/res/values/styles.xml

@@ -1,6 +1,16 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
 
+
+    <!--=============-->
+    <!--Splash Screen-->
+    <!--=============-->
+
+    <style name="SplashScreenBackground" parent="Theme.Tachiyomi">
+        <item name="android:windowBackground">@drawable/splash_background</item>
+    </style>
+
+
     <!--========-->
     <!--Toolbars-->
     <!--========-->