Browse Source

1.添加更新策略按钮

20241218TB223FC(测试jar包)
wangwanlei 11 months ago
parent
commit
d69fa10cd5

+ 4
- 0
app/src/main/java/com/xhly/manageapp/AppAdapter.kt View File

@@ -11,6 +11,7 @@ import com.xhkjedu.manageapp.R
11 11
 import com.xhkjedu.manageapp.databinding.ItemAppBinding
12 12
 import com.xhly.corelib.Const
13 13
 import com.xhly.corelib.bean.AppInfo
14
+import com.xhly.corelib.eventbus.UIEvent
14 15
 import com.xhly.corelib.utils.LogShow
15 16
 import com.xhly.corelib.utils.SystemUtil
16 17
 import com.xhly.manageapp.utils.StrategyUtils
@@ -56,6 +57,9 @@ class AppAdapter(var context: Context, var data: ArrayList<AppInfo>) :
56 57
                 changePwdListener?.let {
57 58
                     it.changeCode()
58 59
                 }
60
+            }else if (appInfo.packageName.equals(Const.UPDATESTRATEGYPKGNAME)){
61
+                Toaster.show(R.string.updatetips)
62
+                UIEvent(Const.CODE2004.toString()).post()
59 63
             }else if (appInfo.packageName.equals(Const.STOREAPPPKG)){
60 64
                 //跳转应用商店
61 65
                 try {

+ 8
- 3
app/src/main/java/com/xhly/manageapp/utils/CustomAppUtils.kt View File

@@ -11,6 +11,11 @@ import com.xhly.corelib.bean.AppInfo
11 11
 class CustomAppUtils {
12 12
     public fun getCustomAppList(context: Context): ArrayList<AppInfo> {
13 13
         val appList= arrayListOf<AppInfo>()
14
+        appList.add(getCusomAppBean(
15
+            context.getString(R.string.appstore),
16
+            Const.STOREAPPPKG,
17
+            AppCompatResources.getDrawable(context,R.drawable.icon_store)!!
18
+        ))
14 19
         appList.add(getCusomAppBean(
15 20
             context.getString(R.string.speed),
16 21
             Const.CUSTOMSPEEDAPP,
@@ -32,9 +37,9 @@ class CustomAppUtils {
32 37
             AppCompatResources.getDrawable(context,R.drawable.icon_changepwd)!!
33 38
         ))
34 39
         appList.add(getCusomAppBean(
35
-            context.getString(R.string.appstore),
36
-            Const.STOREAPPPKG,
37
-            AppCompatResources.getDrawable(context,R.drawable.icon_store)!!
40
+            context.getString(R.string.updatestrategy),
41
+            Const.UPDATESTRATEGYPKGNAME,
42
+            AppCompatResources.getDrawable(context,R.drawable.icon_updatestrategy)!!
38 43
         ))
39 44
         return appList
40 45
     }

BIN
app/src/main/res/drawable/icon_updatestrategy.png View File


+ 2
- 0
app/src/main/res/values/strings.xml View File

@@ -41,4 +41,6 @@
41 41
     <string name="synctime">同步时间</string>
42 42
     <string name="syncsucess">同步完成。</string>
43 43
     <string name="exitcontrol">解除管控</string>
44
+    <string name="updatestrategy">更新策略</string>
45
+    <string name="updatetips">开始请求策略</string>
44 46
 </resources>

+ 6
- 0
corelib/src/main/java/com/xhly/corelib/Const.kt View File

@@ -19,6 +19,12 @@ object Const {
19 19
      */
20 20
     const val STOREAPPPKG = "com.xhkjedu.xh_control_appstore"
21 21
 
22
+    /**
23
+     * 更新策略包名
24
+     */
25
+    const val UPDATESTRATEGYPKGNAME = "UPDATESTRATEGYPKGNAME"
26
+
27
+
22 28
     /**
23 29
      * 存储管控是否已解除的key
24 30
      */

Loading…
Cancel
Save