Sfoglia il codice sorgente

修改启动页面,升级优化

weizhengliang 2 anni fa
parent
commit
2224aff279

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

@@ -25,7 +25,7 @@
     <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"/>
     <application
         android:allowBackup="true"
-        android:icon="@mipmap/launcher"
+        android:icon="@mipmap/ic_launcher"
         android:label="@string/javashop_app_name"
         android:supportsRtl="true"
         tools:replace="android:label"

+ 1 - 0
common/build.gradle

@@ -199,6 +199,7 @@ dependencies {
      * 汉字辅助
      */
     compile files('libs/chinese2py.jar')
+    //compile files('libs/toolkit.jar')
 
     /**
      * 二维码扫描

BIN
common/libs/toolkit.jar


+ 12 - 0
lcd_board/src/main/java/com/wdkl/lcd_board/helper/AppUpdateHelper.java

@@ -157,6 +157,18 @@ public class AppUpdateHelper {
             printWriter.println("pm install -r " + path);
             printWriter.flush();
             printWriter.close();
+
+            Intent intent = new Intent(BaseApplication.appContext, WelcomeActivity.class);
+            PendingIntent restartIntent = PendingIntent.getActivity(BaseApplication.appContext, 0, intent, PendingIntent.FLAG_ONE_SHOT);
+            AlarmManager mgr = (AlarmManager) BaseApplication.appContext.getSystemService(Context.ALARM_SERVICE);
+
+            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {// 6.0及以上
+                mgr.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + 45000, restartIntent);
+
+            } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {// 4.4及以上
+                mgr.setExact(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + 45000, restartIntent);
+            }
+
             int res = process.waitFor();
             Log.e(TAG, "silent install res: " + res);
             if (res == 0) {

+ 7 - 5
welcome/src/main/res/layout/activity_welcome.xml

@@ -5,13 +5,15 @@
         android:id="@+id/activity_main_inference"
         android:layout_width="match_parent"
         android:layout_height="match_parent">
-        <ImageView
+
+        <TextView
             android:layout_width="match_parent"
             android:layout_height="match_parent"
-            android:src="@mipmap/welcome"
-            android:scaleType="centerInside" />
-    </android.support.constraint.ConstraintLayout>
+            android:gravity="center"
+            android:text="Loading..."
+            android:textSize="32sp"
+            android:textColor="@color/black"/>
 
-    <!--未注册显示界面-->
+    </android.support.constraint.ConstraintLayout>
 
 </layout>