Bläddra i källkod

1.添加更新策略按钮

20241218TB223FC(测试jar包)
wangwanlei 1 år sedan
förälder
incheckning
d69fa10cd5

+ 4
- 0
app/src/main/java/com/xhly/manageapp/AppAdapter.kt Visa fil

11
 import com.xhkjedu.manageapp.databinding.ItemAppBinding
11
 import com.xhkjedu.manageapp.databinding.ItemAppBinding
12
 import com.xhly.corelib.Const
12
 import com.xhly.corelib.Const
13
 import com.xhly.corelib.bean.AppInfo
13
 import com.xhly.corelib.bean.AppInfo
14
+import com.xhly.corelib.eventbus.UIEvent
14
 import com.xhly.corelib.utils.LogShow
15
 import com.xhly.corelib.utils.LogShow
15
 import com.xhly.corelib.utils.SystemUtil
16
 import com.xhly.corelib.utils.SystemUtil
16
 import com.xhly.manageapp.utils.StrategyUtils
17
 import com.xhly.manageapp.utils.StrategyUtils
56
                 changePwdListener?.let {
57
                 changePwdListener?.let {
57
                     it.changeCode()
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
             }else if (appInfo.packageName.equals(Const.STOREAPPPKG)){
63
             }else if (appInfo.packageName.equals(Const.STOREAPPPKG)){
60
                 //跳转应用商店
64
                 //跳转应用商店
61
                 try {
65
                 try {

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

11
 class CustomAppUtils {
11
 class CustomAppUtils {
12
     public fun getCustomAppList(context: Context): ArrayList<AppInfo> {
12
     public fun getCustomAppList(context: Context): ArrayList<AppInfo> {
13
         val appList= arrayListOf<AppInfo>()
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
         appList.add(getCusomAppBean(
19
         appList.add(getCusomAppBean(
15
             context.getString(R.string.speed),
20
             context.getString(R.string.speed),
16
             Const.CUSTOMSPEEDAPP,
21
             Const.CUSTOMSPEEDAPP,
32
             AppCompatResources.getDrawable(context,R.drawable.icon_changepwd)!!
37
             AppCompatResources.getDrawable(context,R.drawable.icon_changepwd)!!
33
         ))
38
         ))
34
         appList.add(getCusomAppBean(
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
         return appList
44
         return appList
40
     }
45
     }

Binär
app/src/main/res/drawable/icon_updatestrategy.png Visa fil


+ 2
- 0
app/src/main/res/values/strings.xml Visa fil

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

+ 6
- 0
corelib/src/main/java/com/xhly/corelib/Const.kt Visa fil

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

Laddar…
Avbryt
Spara