Browse Source

1.添加缓存清理功能。

2.添加获得应用旋转方向的方法。
3.添加引用字符串。
20241218TB223FC(测试jar包)
wangwanlei 9 months ago
parent
commit
678a322775
1 changed files with 12 additions and 5 deletions
  1. 12
    5
      app/src/main/java/com/xhly/manageapp/AppAdapter.kt

+ 12
- 5
app/src/main/java/com/xhly/manageapp/AppAdapter.kt View File

14
 import com.xhly.corelib.Const
14
 import com.xhly.corelib.Const
15
 import com.xhly.corelib.bean.AppInfo
15
 import com.xhly.corelib.bean.AppInfo
16
 import com.xhly.corelib.utils.LogShow
16
 import com.xhly.corelib.utils.LogShow
17
+import com.xhly.corelib.utils.SystemUtil
17
 import com.xhly.manageapp.databinding.ItemAppBinding
18
 import com.xhly.manageapp.databinding.ItemAppBinding
18
 import com.xhly.manageapp.utils.StrategyUtils
19
 import com.xhly.manageapp.utils.StrategyUtils
19
 import java.util.Calendar
20
 import java.util.Calendar
41
         holder.mBinding.itemCv.setOnClickListener {
42
         holder.mBinding.itemCv.setOnClickListener {
42
             if (appInfo.packageName.equals(Const.CUSTOMSPEEDAPP)){
43
             if (appInfo.packageName.equals(Const.CUSTOMSPEEDAPP)){
43
                 StrategyUtils.clearMemory(context,data)
44
                 StrategyUtils.clearMemory(context,data)
44
-                Toaster.show("加速完成。")
45
+                Toaster.show(context.getString(R.string.speedend))
45
             }else if (appInfo.packageName.equals(Const.CUSTOMCLEARAPP)){
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
             }else if (appInfo.packageName.equals(Const.CUSTOMROTATIONAPP)){
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
             }else if (appInfo.packageName.equals(Const.CUSTOMCHANGEPSD)){
58
             }else if (appInfo.packageName.equals(Const.CUSTOMCHANGEPSD)){
52
                 changePwdListener?.let {
59
                 changePwdListener?.let {
53
                     it.changeCode()
60
                     it.changeCode()

Loading…
Cancel
Save