浏览代码

1.优化启动activity白屏问题

王鹏鹏 1 年之前
父节点
当前提交
001f1b6eb2

+ 2 - 0
game/src/main/AndroidManifest.xml

@@ -25,6 +25,7 @@
             android:configChanges="keyboardHidden|orientation|screenSize"
             android:launchMode="singleInstance"
             android:screenOrientation="landscape"
+            android:theme="@style/IntroduceFullActivity"
             android:windowSoftInputMode="adjustResize|adjustPan" />
 
         <activity
@@ -32,6 +33,7 @@
             android:configChanges="keyboardHidden|orientation|screenSize"
             android:launchMode="singleInstance"
             android:screenOrientation="landscape"
+            android:theme="@style/PlayeFullActivity"
             android:windowSoftInputMode="adjustResize|adjustPan" />
 
         <activity

+ 4 - 1
game/src/main/manifest/AndroidManifest.xml

@@ -13,7 +13,8 @@
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
 
-    <application android:networkSecurityConfig="@xml/network_security_config"
+    <application
+        android:networkSecurityConfig="@xml/network_security_config"
         tools:targetApi="n">
         <activity
             android:name="com.yingyangfly.game.loading.GameLoadingActivity"
@@ -26,6 +27,7 @@
             android:configChanges="keyboardHidden|orientation|screenSize"
             android:launchMode="singleInstance"
             android:screenOrientation="landscape"
+            android:theme="@style/IntroduceFullActivity"
             android:windowSoftInputMode="adjustResize|adjustPan" />
 
         <activity
@@ -33,6 +35,7 @@
             android:configChanges="keyboardHidden|orientation|screenSize"
             android:launchMode="singleInstance"
             android:screenOrientation="landscape"
+            android:theme="@style/PlayeFullActivity"
             android:windowSoftInputMode="adjustResize|adjustPan" />
 
         <activity

+ 3 - 3
game/src/main/res/layout/activity_game_introduction.xml

@@ -175,8 +175,8 @@
                                     android:id="@+id/tvTrainingSkill"
                                     android:layout_width="@dimen/divider_180px"
                                     android:layout_height="@dimen/divider_53px"
-                                    android:layout_marginTop="@dimen/divider_18px"
-                                    android:layout_marginBottom="@dimen/divider_29px"
+                                    android:layout_marginTop="@dimen/divider_10px"
+                                    android:layout_marginBottom="@dimen/divider_16px"
                                     android:background="@drawable/bg_scientific_principle"
                                     android:fontFamily="@font/lcb"
                                     android:gravity="center"
@@ -193,7 +193,7 @@
                                     android:id="@+id/tvGameType"
                                     android:layout_width="@dimen/divider_146px"
                                     android:layout_height="@dimen/divider_46px"
-                                    android:layout_marginBottom="@dimen/divider_39px"
+                                    android:layout_marginBottom="@dimen/divider_16px"
                                     android:background="@drawable/bg_game_type"
                                     android:fontFamily="@font/lcb"
                                     android:gravity="center"

+ 21 - 0
game/src/main/res/values/themes.xml

@@ -0,0 +1,21 @@
+<resources xmlns:tools="http://schemas.android.com/tools">
+
+    <style name="IntroduceFullActivity" parent="Theme.AppCompat.Light.NoActionBar" tools:ignore="ResourceName">
+        <item name="windowNoTitle">true</item>
+        <item name="windowActionBar">false</item>
+        <item name="android:windowFullscreen">true</item>
+        <item name="android:windowContentOverlay">@null</item>
+        <item name="android:windowIsTranslucent">false</item>
+        <item name="android:windowBackground">@drawable/bg_game_loading</item>
+    </style>
+
+    <style name="PlayeFullActivity" parent="Theme.AppCompat.Light.NoActionBar" tools:ignore="ResourceName">
+        <item name="windowNoTitle">true</item>
+        <item name="windowActionBar">false</item>
+        <item name="android:windowFullscreen">true</item>
+        <item name="android:windowContentOverlay">@null</item>
+        <item name="android:windowIsTranslucent">false</item>
+        <item name="android:windowBackground">@drawable/bg_game_background_settlement</item>
+    </style>
+
+</resources>