Commit 9d1e6f03 authored by wanglei's avatar wanglei

Merge remote-tracking branch 'origin/free-master-ad-legal' into free-master-ad-legal

parents c62a087e f7c0eeb5
...@@ -15,6 +15,7 @@ import com.test.easy.easycleanerjunk.helps.KotlinExt.toFormatSize ...@@ -15,6 +15,7 @@ import com.test.easy.easycleanerjunk.helps.KotlinExt.toFormatSize
import com.test.easy.easycleanerjunk.helps.PermissionHelp.checkStorePermission import com.test.easy.easycleanerjunk.helps.PermissionHelp.checkStorePermission
import com.test.easy.easycleanerjunk.helps.PermissionHelp.requestStorePermission import com.test.easy.easycleanerjunk.helps.PermissionHelp.requestStorePermission
import com.test.easy.easycleanerjunk.helps.ads.AdmobUtils import com.test.easy.easycleanerjunk.helps.ads.AdmobUtils
import com.test.easy.easycleanerjunk.utils.SPUtils
import com.test.easy.easycleanerjunk.view.AFunOb import com.test.easy.easycleanerjunk.view.AFunOb
import com.test.easy.easycleanerjunk.view.DialogViews.showDialogFunctionExit import com.test.easy.easycleanerjunk.view.DialogViews.showDialogFunctionExit
import com.test.easy.easycleanerjunk.view.DialogViews.showGerPermission import com.test.easy.easycleanerjunk.view.DialogViews.showGerPermission
...@@ -103,9 +104,24 @@ class ScreenShotActivity : BaseActivity<ActivityScreenShotBinding>() { ...@@ -103,9 +104,24 @@ class ScreenShotActivity : BaseActivity<ActivityScreenShotBinding>() {
setCleanUpUi(size) setCleanUpUi(size)
} }
binding.tvClean.setOnClickListener { binding.tvClean.setOnClickListener {
val files = screenShotAdapter.getSelectData()
val s = SPUtils.getInstance().getInt("isShowBackIntAd", 0)
if (s == 0) {
doDelete()
} else {
showFileDeleteDialog { showFileDeleteDialog {
AdmobUtils.showInterstitialAd(this) { AdmobUtils.showInterstitialAd(this) {
doDelete()
}
}
}
}
}
private fun doDelete() {
val files = screenShotAdapter.getSelectData()
lifecycleScope.launch(Dispatchers.IO) { lifecycleScope.launch(Dispatchers.IO) {
async { async {
files.forEach { screenFile -> files.forEach { screenFile ->
...@@ -122,10 +138,6 @@ class ScreenShotActivity : BaseActivity<ActivityScreenShotBinding>() { ...@@ -122,10 +138,6 @@ class ScreenShotActivity : BaseActivity<ActivityScreenShotBinding>() {
} }
} }
} }
}
}
}
private fun getScreenshotBean(): ArrayList<ScreenshotBean> { private fun getScreenshotBean(): ArrayList<ScreenshotBean> {
val dcim = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM) val dcim = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM)
......
...@@ -23,6 +23,7 @@ import com.test.easy.easycleanerjunk.helps.MediaStoreUtils ...@@ -23,6 +23,7 @@ import com.test.easy.easycleanerjunk.helps.MediaStoreUtils
import com.test.easy.easycleanerjunk.helps.ads.AdmobUtils import com.test.easy.easycleanerjunk.helps.ads.AdmobUtils
import com.test.easy.easycleanerjunk.utils.BarUtils import com.test.easy.easycleanerjunk.utils.BarUtils
import com.test.easy.easycleanerjunk.utils.NewFileUtils import com.test.easy.easycleanerjunk.utils.NewFileUtils
import com.test.easy.easycleanerjunk.utils.SPUtils
import com.test.easy.easycleanerjunk.view.AFunOb import com.test.easy.easycleanerjunk.view.AFunOb
import com.test.easy.easycleanerjunk.view.DialogViews.showDialogFunctionExit import com.test.easy.easycleanerjunk.view.DialogViews.showDialogFunctionExit
import com.test.easy.easycleanerjunk.view.FileDeleteDialog.showFileDeleteDialog import com.test.easy.easycleanerjunk.view.FileDeleteDialog.showFileDeleteDialog
...@@ -74,7 +75,20 @@ class RepeatPhotoActivity : BaseActivity<ActivityLayoutRepeatPhotoBinding>() { ...@@ -74,7 +75,20 @@ class RepeatPhotoActivity : BaseActivity<ActivityLayoutRepeatPhotoBinding>() {
} }
binding.idTvDelete.setOnClickListener { binding.idTvDelete.setOnClickListener {
showFileDeleteDialog { showFileDeleteDialog {
val s = SPUtils.getInstance().getInt("isShowBackIntAd", 0)
if (s == 0) {
doDeleteFile()
} else {
AdmobUtils.showInterstitialAd(this) { AdmobUtils.showInterstitialAd(this) {
doDeleteFile()
}
}
}
}
}
private fun doDeleteFile() {
val list = fileList.toList().filter { it.isSelect } val list = fileList.toList().filter { it.isSelect }
if (list.isNotEmpty() && list.all { NewFileUtils.delete(it.path) }) { if (list.isNotEmpty() && list.all { NewFileUtils.delete(it.path) }) {
fileList.removeAll(list) fileList.removeAll(list)
...@@ -85,9 +99,6 @@ class RepeatPhotoActivity : BaseActivity<ActivityLayoutRepeatPhotoBinding>() { ...@@ -85,9 +99,6 @@ class RepeatPhotoActivity : BaseActivity<ActivityLayoutRepeatPhotoBinding>() {
MediaStoreUtils.updateMediaStore(this, array) MediaStoreUtils.updateMediaStore(this, array)
} }
} }
}
}
}
private var fileList = mutableListOf<ImageDataBean>() private var fileList = mutableListOf<ImageDataBean>()
......
...@@ -65,6 +65,7 @@ object ComUtils { ...@@ -65,6 +65,7 @@ object ComUtils {
SPUtils.getInstance().put("timerInterval", bean.timerInterval) SPUtils.getInstance().put("timerInterval", bean.timerInterval)
SPUtils.getInstance().put("naAdS", bean.naAdS) SPUtils.getInstance().put("naAdS", bean.naAdS)
SPUtils.getInstance().put("isShowBackIntAd", bean.isShowBackIntAd) SPUtils.getInstance().put("isShowBackIntAd", bean.isShowBackIntAd)
SPUtils.getInstance().put("isShowResultNaAd", bean.isShowResultNaAd)
SPUtils.getInstance().put("loading_page_time", bean.loadingPageTime) SPUtils.getInstance().put("loading_page_time", bean.loadingPageTime)
adDisplayInterval = bean.adInterval adDisplayInterval = bean.adInterval
maxMultiClick = bean.maxMultiClick maxMultiClick = bean.maxMultiClick
......
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