Ver código fonte

1.添加缓存清理功能。

2.添加获得应用旋转方向的方法。
3.添加引用字符串。
20241218TB223FC(测试jar包)
wangwanlei 9 meses atrás
pai
commit
678a322775
1 arquivos alterados com 12 adições e 5 exclusões
  1. 12
    5
      app/src/main/java/com/xhly/manageapp/AppAdapter.kt

+ 12
- 5
app/src/main/java/com/xhly/manageapp/AppAdapter.kt Ver arquivo

@@ -14,6 +14,7 @@ import com.hjq.toast.Toaster
14 14
 import com.xhly.corelib.Const
15 15
 import com.xhly.corelib.bean.AppInfo
16 16
 import com.xhly.corelib.utils.LogShow
17
+import com.xhly.corelib.utils.SystemUtil
17 18
 import com.xhly.manageapp.databinding.ItemAppBinding
18 19
 import com.xhly.manageapp.utils.StrategyUtils
19 20
 import java.util.Calendar
@@ -41,13 +42,19 @@ class AppAdapter(var context: Context, var data: ArrayList<AppInfo>) :
41 42
         holder.mBinding.itemCv.setOnClickListener {
42 43
             if (appInfo.packageName.equals(Const.CUSTOMSPEEDAPP)){
43 44
                 StrategyUtils.clearMemory(context,data)
44
-                Toaster.show("加速完成。")
45
+                Toaster.show(context.getString(R.string.speedend))
45 46
             }else if (appInfo.packageName.equals(Const.CUSTOMCLEARAPP)){
46
-                //TODO 没有清理内存的方法
47
-                Toaster.showLong("清理缓存")
47
+                StrategyUtils.clearAppData(context)
48
+                Toaster.show(context.getString(R.string.clearend))
48 49
             }else if (appInfo.packageName.equals(Const.CUSTOMROTATIONAPP)){
49
-                Toaster.showLong("旋转木马")
50
-                ManageApplication.disallowSetAutoRotation(true)
50
+                val rotationAllowed = SystemUtil.isRotationAllowed(context)
51
+                ManageApplication.disallowSetAutoRotation(!rotationAllowed)
52
+                val tips=if (!rotationAllowed){
53
+                    context.getString(R.string.openrotation)
54
+                }else{
55
+                    context.getString(R.string.closerotation)
56
+                }
57
+                Toaster.showLong(tips)
51 58
             }else if (appInfo.packageName.equals(Const.CUSTOMCHANGEPSD)){
52 59
                 changePwdListener?.let {
53 60
                     it.changeCode()

Carregando…
Cancelar
Salvar