Commit eda17d5e authored by 周文华's avatar 周文华

【调整&修复】1.调整权限弹出逻辑。2.修复通知栏没有图标问题。3.修复扫描崩溃问题。4.调整减短常驻显示延迟。

parent 7b265b0a
...@@ -179,8 +179,8 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() { ...@@ -179,8 +179,8 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
var totalSize = 0L var totalSize = 0L
val list = arrayListOf<ChildBean>() val list1= async(Dispatchers.IO) {
async { val list = arrayListOf<ChildBean>()
val emptyFolder1 = FileHelp.getFileFolder(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM)) val emptyFolder1 = FileHelp.getFileFolder(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM))
val emptyFolder2 = FileHelp.getFileFolder(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)) val emptyFolder2 = FileHelp.getFileFolder(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS))
val emptyFolder3 = FileHelp.getFileFolder(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS)) val emptyFolder3 = FileHelp.getFileFolder(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS))
...@@ -197,13 +197,14 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() { ...@@ -197,13 +197,14 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
emptyFolder.filter { it.listFiles().isNullOrEmpty() }.forEach { l -> emptyFolder.filter { it.listFiles().isNullOrEmpty() }.forEach { l ->
list.add(ChildBean(R.mipmap.kongwenjian, l.name, l.path, 1)) list.add(ChildBean(R.mipmap.kongwenjian, l.name, l.path, 1))
} }
delay(Random.nextLong(1500, 2000)) delay(Random.nextLong(1000, 1500))
list
}.await() }.await()
junkExpandAdapter.addChildData(0, list) junkExpandAdapter.addChildData(0, list1)
list.clear() val list2= async(Dispatchers.IO) {
async { val list = arrayListOf<ChildBean>()
val apk = MediaStoreUtils.queryFiles(this@CleanJunkActivity, MediaStoreUtils.FileType.APK) ?: listOf() val apk = MediaStoreUtils.queryFiles(this@CleanJunkActivity, MediaStoreUtils.FileType.APK) ?: listOf()
apk.forEach { l -> apk.forEach { l ->
totalSize += l.size totalSize += l.size
...@@ -216,13 +217,15 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() { ...@@ -216,13 +217,15 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
// list.add(ChildBean(R.mipmap.apk, "1", "apl$it", size)) // list.add(ChildBean(R.mipmap.apk, "1", "apl$it", size))
// } // }
// } // }
delay(Random.nextLong(1500, 2000)) delay(Random.nextLong(1000, 1500))
list
}.await() }.await()
junkExpandAdapter.addChildData(1, list) junkExpandAdapter.addChildData(1, list2)
list.clear()
async { val list3= async(Dispatchers.IO) {
val list = arrayListOf<ChildBean>()
val temp = MediaStoreUtils.queryFiles(this@CleanJunkActivity, MediaStoreUtils.FileType.TMP) ?: listOf() val temp = MediaStoreUtils.queryFiles(this@CleanJunkActivity, MediaStoreUtils.FileType.TMP) ?: listOf()
temp.forEach { l -> temp.forEach { l ->
totalSize += l.size totalSize += l.size
...@@ -235,12 +238,14 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() { ...@@ -235,12 +238,14 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
// list.add(ChildBean(R.mipmap.temp_clean, "1", "temp$it", size)) // list.add(ChildBean(R.mipmap.temp_clean, "1", "temp$it", size))
// } // }
// } // }
delay(Random.nextLong(1500, 2000)) delay(Random.nextLong(1000, 1500))
list
}.await() }.await()
junkExpandAdapter.addChildData(2, list) junkExpandAdapter.addChildData(2, list3)
list.clear() val list4= async(Dispatchers.IO) {
async { val list = arrayListOf<ChildBean>()
val log = MediaStoreUtils.queryFiles(this@CleanJunkActivity, MediaStoreUtils.FileType.LOG) ?: listOf() val log = MediaStoreUtils.queryFiles(this@CleanJunkActivity, MediaStoreUtils.FileType.LOG) ?: listOf()
log.forEach { l -> log.forEach { l ->
totalSize += l.size totalSize += l.size
...@@ -253,11 +258,12 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() { ...@@ -253,11 +258,12 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
// list.add(ChildBean(R.mipmap.log_clean, "1", "log$it", size)) // list.add(ChildBean(R.mipmap.log_clean, "1", "log$it", size))
// } // }
// } // }
delay(Random.nextLong(1500, 2000)) delay(Random.nextLong(1000, 1500))
list
}.await() }.await()
scanFinish = true scanFinish = true
junkExpandAdapter.addChildData(3, list) junkExpandAdapter.addChildData(3, list4)
} }
......
...@@ -76,6 +76,7 @@ object NotificationUtil { ...@@ -76,6 +76,7 @@ object NotificationUtil {
bigRemoteViews.setImageViewResource(R.id.iv_icon, icon) bigRemoteViews.setImageViewResource(R.id.iv_icon, icon)
bigRemoteViews.setTextViewText(R.id.tv_desc, desc) bigRemoteViews.setTextViewText(R.id.tv_desc, desc)
bigRemoteViews.setTextViewText(R.id.tv_btn, btn) bigRemoteViews.setTextViewText(R.id.tv_btn, btn)
smallRemoteViews.setImageViewResource(R.id.iv_icon, icon)
smallRemoteViews.setTextViewText(R.id.tv_desc, desc) smallRemoteViews.setTextViewText(R.id.tv_desc, desc)
smallRemoteViews.setTextViewText(R.id.tv_btn, btn) smallRemoteViews.setTextViewText(R.id.tv_btn, btn)
sendCustomNotification(context, actionId, intent, bigRemoteViews, smallRemoteViews) sendCustomNotification(context, actionId, intent, bigRemoteViews, smallRemoteViews)
...@@ -88,6 +89,7 @@ object NotificationUtil { ...@@ -88,6 +89,7 @@ object NotificationUtil {
bigRemoteViews.setImageViewResource(R.id.iv_icon, icon) bigRemoteViews.setImageViewResource(R.id.iv_icon, icon)
bigRemoteViews.setTextViewText(R.id.tv_desc, desc) bigRemoteViews.setTextViewText(R.id.tv_desc, desc)
bigRemoteViews.setTextViewText(R.id.tv_btn, btn) bigRemoteViews.setTextViewText(R.id.tv_btn, btn)
smallRemoteViews.setImageViewResource(R.id.iv_icon, icon)
smallRemoteViews.setTextViewText(R.id.tv_desc, desc) smallRemoteViews.setTextViewText(R.id.tv_desc, desc)
smallRemoteViews.setTextViewText(R.id.tv_btn, btn) smallRemoteViews.setTextViewText(R.id.tv_btn, btn)
sendCustomNotification(context, actionId, intent, bigRemoteViews, smallRemoteViews) sendCustomNotification(context, actionId, intent, bigRemoteViews, smallRemoteViews)
...@@ -100,6 +102,7 @@ object NotificationUtil { ...@@ -100,6 +102,7 @@ object NotificationUtil {
bigRemoteViews.setImageViewResource(R.id.iv_icon, icon) bigRemoteViews.setImageViewResource(R.id.iv_icon, icon)
bigRemoteViews.setTextViewText(R.id.tv_desc, desc) bigRemoteViews.setTextViewText(R.id.tv_desc, desc)
bigRemoteViews.setTextViewText(R.id.tv_btn, btn) bigRemoteViews.setTextViewText(R.id.tv_btn, btn)
smallRemoteViews.setImageViewResource(R.id.iv_icon, icon)
smallRemoteViews.setTextViewText(R.id.tv_desc, desc) smallRemoteViews.setTextViewText(R.id.tv_desc, desc)
smallRemoteViews.setTextViewText(R.id.tv_btn, btn) smallRemoteViews.setTextViewText(R.id.tv_btn, btn)
sendCustomNotification(context, actionId, intent, bigRemoteViews, smallRemoteViews) sendCustomNotification(context, actionId, intent, bigRemoteViews, smallRemoteViews)
...@@ -112,6 +115,7 @@ object NotificationUtil { ...@@ -112,6 +115,7 @@ object NotificationUtil {
bigRemoteViews.setImageViewResource(R.id.iv_icon, icon) bigRemoteViews.setImageViewResource(R.id.iv_icon, icon)
bigRemoteViews.setTextViewText(R.id.tv_desc, desc) bigRemoteViews.setTextViewText(R.id.tv_desc, desc)
bigRemoteViews.setTextViewText(R.id.tv_btn, btn) bigRemoteViews.setTextViewText(R.id.tv_btn, btn)
smallRemoteViews.setImageViewResource(R.id.iv_icon, icon)
smallRemoteViews.setTextViewText(R.id.tv_desc, desc) smallRemoteViews.setTextViewText(R.id.tv_desc, desc)
smallRemoteViews.setTextViewText(R.id.tv_btn, btn) smallRemoteViews.setTextViewText(R.id.tv_btn, btn)
sendCustomNotification(context, actionId, intent, bigRemoteViews, smallRemoteViews) sendCustomNotification(context, actionId, intent, bigRemoteViews, smallRemoteViews)
...@@ -124,6 +128,7 @@ object NotificationUtil { ...@@ -124,6 +128,7 @@ object NotificationUtil {
bigRemoteViews.setImageViewResource(R.id.iv_icon, icon) bigRemoteViews.setImageViewResource(R.id.iv_icon, icon)
bigRemoteViews.setTextViewText(R.id.tv_desc, desc) bigRemoteViews.setTextViewText(R.id.tv_desc, desc)
bigRemoteViews.setTextViewText(R.id.tv_btn, btn) bigRemoteViews.setTextViewText(R.id.tv_btn, btn)
smallRemoteViews.setImageViewResource(R.id.iv_icon, icon)
smallRemoteViews.setTextViewText(R.id.tv_desc, desc) smallRemoteViews.setTextViewText(R.id.tv_desc, desc)
smallRemoteViews.setTextViewText(R.id.tv_btn, btn) smallRemoteViews.setTextViewText(R.id.tv_btn, btn)
sendCustomNotification(context, actionId, intent, bigRemoteViews, smallRemoteViews) sendCustomNotification(context, actionId, intent, bigRemoteViews, smallRemoteViews)
...@@ -136,6 +141,7 @@ object NotificationUtil { ...@@ -136,6 +141,7 @@ object NotificationUtil {
bigRemoteViews.setImageViewResource(R.id.iv_icon, icon) bigRemoteViews.setImageViewResource(R.id.iv_icon, icon)
bigRemoteViews.setTextViewText(R.id.tv_desc, desc) bigRemoteViews.setTextViewText(R.id.tv_desc, desc)
bigRemoteViews.setTextViewText(R.id.tv_btn, btn) bigRemoteViews.setTextViewText(R.id.tv_btn, btn)
smallRemoteViews.setImageViewResource(R.id.iv_icon, icon)
smallRemoteViews.setTextViewText(R.id.tv_desc, desc) smallRemoteViews.setTextViewText(R.id.tv_desc, desc)
smallRemoteViews.setTextViewText(R.id.tv_btn, btn) smallRemoteViews.setTextViewText(R.id.tv_btn, btn)
sendCustomNotification(context, actionId, intent, bigRemoteViews, smallRemoteViews) sendCustomNotification(context, actionId, intent, bigRemoteViews, smallRemoteViews)
...@@ -148,6 +154,7 @@ object NotificationUtil { ...@@ -148,6 +154,7 @@ object NotificationUtil {
bigRemoteViews.setImageViewResource(R.id.iv_icon, icon) bigRemoteViews.setImageViewResource(R.id.iv_icon, icon)
bigRemoteViews.setTextViewText(R.id.tv_desc, desc) bigRemoteViews.setTextViewText(R.id.tv_desc, desc)
bigRemoteViews.setTextViewText(R.id.tv_btn, btn) bigRemoteViews.setTextViewText(R.id.tv_btn, btn)
smallRemoteViews.setImageViewResource(R.id.iv_icon, icon)
smallRemoteViews.setTextViewText(R.id.tv_desc, desc) smallRemoteViews.setTextViewText(R.id.tv_desc, desc)
smallRemoteViews.setTextViewText(R.id.tv_btn, btn) smallRemoteViews.setTextViewText(R.id.tv_btn, btn)
sendCustomNotification(context, actionId, intent, bigRemoteViews, smallRemoteViews) sendCustomNotification(context, actionId, intent, bigRemoteViews, smallRemoteViews)
...@@ -160,6 +167,7 @@ object NotificationUtil { ...@@ -160,6 +167,7 @@ object NotificationUtil {
bigRemoteViews.setImageViewResource(R.id.iv_icon, icon) bigRemoteViews.setImageViewResource(R.id.iv_icon, icon)
bigRemoteViews.setTextViewText(R.id.tv_desc, desc) bigRemoteViews.setTextViewText(R.id.tv_desc, desc)
bigRemoteViews.setTextViewText(R.id.tv_btn, btn) bigRemoteViews.setTextViewText(R.id.tv_btn, btn)
smallRemoteViews.setImageViewResource(R.id.iv_icon, icon)
smallRemoteViews.setTextViewText(R.id.tv_desc, desc) smallRemoteViews.setTextViewText(R.id.tv_desc, desc)
smallRemoteViews.setTextViewText(R.id.tv_btn, btn) smallRemoteViews.setTextViewText(R.id.tv_btn, btn)
sendCustomNotification(context, actionId, intent, bigRemoteViews, smallRemoteViews) sendCustomNotification(context, actionId, intent, bigRemoteViews, smallRemoteViews)
...@@ -172,6 +180,7 @@ object NotificationUtil { ...@@ -172,6 +180,7 @@ object NotificationUtil {
bigRemoteViews.setImageViewResource(R.id.iv_icon, icon) bigRemoteViews.setImageViewResource(R.id.iv_icon, icon)
bigRemoteViews.setTextViewText(R.id.tv_desc, desc) bigRemoteViews.setTextViewText(R.id.tv_desc, desc)
bigRemoteViews.setTextViewText(R.id.tv_btn, btn) bigRemoteViews.setTextViewText(R.id.tv_btn, btn)
smallRemoteViews.setImageViewResource(R.id.iv_icon, icon)
smallRemoteViews.setTextViewText(R.id.tv_desc, desc) smallRemoteViews.setTextViewText(R.id.tv_desc, desc)
smallRemoteViews.setTextViewText(R.id.tv_btn, btn) smallRemoteViews.setTextViewText(R.id.tv_btn, btn)
sendCustomNotification(context, actionId, intent, bigRemoteViews, smallRemoteViews) sendCustomNotification(context, actionId, intent, bigRemoteViews, smallRemoteViews)
...@@ -184,6 +193,7 @@ object NotificationUtil { ...@@ -184,6 +193,7 @@ object NotificationUtil {
bigRemoteViews.setImageViewResource(R.id.iv_icon, icon) bigRemoteViews.setImageViewResource(R.id.iv_icon, icon)
bigRemoteViews.setTextViewText(R.id.tv_desc, desc) bigRemoteViews.setTextViewText(R.id.tv_desc, desc)
bigRemoteViews.setTextViewText(R.id.tv_btn, btn) bigRemoteViews.setTextViewText(R.id.tv_btn, btn)
smallRemoteViews.setImageViewResource(R.id.iv_icon, icon)
smallRemoteViews.setTextViewText(R.id.tv_desc, desc) smallRemoteViews.setTextViewText(R.id.tv_desc, desc)
smallRemoteViews.setTextViewText(R.id.tv_btn, btn) smallRemoteViews.setTextViewText(R.id.tv_btn, btn)
sendCustomNotification(context, actionId, intent, bigRemoteViews, smallRemoteViews) sendCustomNotification(context, actionId, intent, bigRemoteViews, smallRemoteViews)
......
...@@ -5,7 +5,6 @@ import android.content.Intent ...@@ -5,7 +5,6 @@ import android.content.Intent
import androidx.core.view.isVisible import androidx.core.view.isVisible
import com.base.filerecoveryrecyclebin.R import com.base.filerecoveryrecyclebin.R
import com.base.filerecoveryrecyclebin.activity.MainActivity import com.base.filerecoveryrecyclebin.activity.MainActivity
import com.base.filerecoveryrecyclebin.activity.guide.CleanGuideActivity
import com.base.filerecoveryrecyclebin.activity.guide.GuideActivity import com.base.filerecoveryrecyclebin.activity.guide.GuideActivity
import com.base.filerecoveryrecyclebin.ads.AdmobMaxHelper import com.base.filerecoveryrecyclebin.ads.AdmobMaxHelper
import com.base.filerecoveryrecyclebin.bean.ConstObject import com.base.filerecoveryrecyclebin.bean.ConstObject
...@@ -74,8 +73,7 @@ class GuideFragment : BaseFragment<FragmentGuideBinding>() { ...@@ -74,8 +73,7 @@ class GuideFragment : BaseFragment<FragmentGuideBinding>() {
// isInstallVip = false // isInstallVip = false
} else { } else {
if(!ConstObject.isCLeanGuide){ if(!ConstObject.isCLeanGuide){
startActivity(Intent(requireContext(), CleanGuideActivity::class.java)) (requireActivity() as GuideActivity).lauchPermisson()
requireActivity().finish()
}else{ }else{
val showAd = AppPreferences.getInstance().getString("isShowGuideAd", "0")?.toInt() val showAd = AppPreferences.getInstance().getString("isShowGuideAd", "0")?.toInt()
if (showAd == 1) { if (showAd == 1) {
......
...@@ -51,7 +51,7 @@ class StayJobService : JobService() { ...@@ -51,7 +51,7 @@ class StayJobService : JobService() {
val jobScheduler = getSystemService(JOB_SCHEDULER_SERVICE) as JobScheduler val jobScheduler = getSystemService(JOB_SCHEDULER_SERVICE) as JobScheduler
val componentName = ComponentName(this, StayJobService::class.java) val componentName = ComponentName(this, StayJobService::class.java)
val jobInfo = JobInfo.Builder(JOB_INFO_ID, componentName) val jobInfo = JobInfo.Builder(JOB_INFO_ID, componentName)
.setMinimumLatency(30000) .setMinimumLatency(5000)
.build() .build()
jobScheduler.schedule(jobInfo) jobScheduler.schedule(jobInfo)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment