Commit fcaffe7a authored by wanglei's avatar wanglei

...

parent 0d6a6274
......@@ -62,6 +62,8 @@ object ConstObject {
const val FUNCTION_SCAM_JUNK = "function_scam_junk"
const val FUNCTION_APP_PROCESS = "function_app_process"
const val FUNCTION_SCREEN_SHORT = "function_app_screen"
const val FUNCTION_SIMILAR = "function_similar"
const val FUNCTION_WHATSAPP = "function_whatsapp"
var ifAgreePrivacy = false
get() {
......
......@@ -45,6 +45,15 @@ abstract class BaseActivity<T : ViewBinding> : AppCompatActivity() {
finish()
}
fun finishToMainTop() {
val intent = Intent(this, MainActivity::class.java)
intent.putExtra("where", "finishToMainTop")
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
startActivity(intent)
finish()
}
var dialog: Dialog? = null
override fun onDestroy() {
super.onDestroy()
......
......@@ -193,12 +193,12 @@ open class BaseActivity2 : AppCompatActivity() {
fun handleBackPressed(activity: Activity) {
when (activity) {
// is CleanJunkActivity -> exit(ExitType.CLEAN)
// is SimilarPhotosActivity -> exit(ExitType.SIMILAR_PHOTOS)
is SimilarPhotosActivity -> exit(ExitType.SIMILAR_PHOTOS)
is ScreenshotCleanActivity -> exit(ExitType.SCREENSHOT)
// is WhatsappCleanActivity -> exit(ExitType.WHATSAPP)
// is WhatsappCleanDetailActivity -> exit(ExitType.WHATSAPP)
is WhatsappCleanActivity -> exit(ExitType.WHATSAPP)
is WhatsappCleanDetailActivity -> exit(ExitType.WHATSAPP)
is AppProcessActivity -> exit(ExitType.APP_PROCESS)
is LargeFileCleanActivity -> exit(ExitType.LARGE_FILE)
else -> finishToMainTop()
}
}
......
package com.base.pdfviewerscannerwhite.mix
import android.media.tv.TvTrackInfo.TYPE_AUDIO
import android.media.tv.TvTrackInfo.TYPE_VIDEO
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
......@@ -9,6 +7,8 @@ import android.widget.ImageView
import com.base.pdfviewerscannerwhite.R
import com.base.pdfviewerscannerwhite.databinding.ItemCleanDetailBinding
import com.base.pdfviewerscannerwhite.mix.AppHelps.dpToPx
import com.base.pdfviewerscannerwhite.mix.MineTypeHelps.TYPE_AUDIO
import com.base.pdfviewerscannerwhite.mix.MineTypeHelps.TYPE_VIDEO
import com.bumptech.glide.load.resource.bitmap.RoundedCorners
import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.bitmap.CenterCrop
......
......@@ -9,4 +9,6 @@ enum class ExitType(val title: Int, val content: Int) {
SIMILAR_PHOTOS(R.string.exit_similar_photos, R.string.exit_similar_photos_content),
WHATSAPP(R.string.exit_whatsapp_clean, R.string.exit_whatsapp_clean_content),
CLEAN(R.string.exit_clean_junk, R.string.exit_clean_junk_content),
LARGE_FILE(R.string.exit_large_file_clean, R.string.exit_large_file_clean_content),
}
\ No newline at end of file
......@@ -74,7 +74,7 @@ class ScreenshotCleanActivity : BaseActivity2() {
DialogHelps.showDeleteDialog(this, binding.tvDelete) {
AdmobInterstitialUtils.showInterstitialAd(this, false, false) {
startActivity(Intent(this, ResultActivity::class.java).apply {
putExtra("from", ConstObject.FUNCTION_SCREEN_SHORT)
putExtra("from", ConstObject.FUNCTION_WHATSAPP)
putExtra("clean_size", total)
LogEx.logDebug("clean_size", "total=$total")
})
......
......@@ -8,8 +8,12 @@ import androidx.activity.addCallback
import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.LinearLayoutManager
import com.base.pdfviewerscannerwhite.R
import com.base.pdfviewerscannerwhite.ads.admob.AdmobInterstitialUtils
import com.base.pdfviewerscannerwhite.bean.ConstObject
import com.base.pdfviewerscannerwhite.bean.SimilarBean
import com.base.pdfviewerscannerwhite.databinding.ActivitySimilarPhotosBinding
import com.base.pdfviewerscannerwhite.ui.result.ResultActivity
import com.base.pdfviewerscannerwhite.utils.LogEx
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.async
import kotlinx.coroutines.launch
......@@ -75,8 +79,12 @@ class SimilarPhotosActivity : BaseActivity2() {
if (list.isEmpty()) return@setOnClickListener
val total = list.sumOf { it.size }
DialogHelps.showDeleteDialog(this, binding.tvDelete) {
showAnimationAd {
AdmobInterstitialUtils.showInterstitialAd(this, false, false) {
startActivity(Intent(this, ResultActivity::class.java).apply {
putExtra("from", ConstObject.FUNCTION_SIMILAR)
putExtra("clean_size", total)
})
finish()
}
deleteFiles(list)
}
......
......@@ -2,13 +2,19 @@ package com.base.pdfviewerscannerwhite.mix
import android.content.Context
import android.content.Intent
import android.content.Intent.FLAG_ACTIVITY_CLEAR_TASK
import android.content.Intent.FLAG_ACTIVITY_NEW_TASK
import android.os.Bundle
import android.view.View
import androidx.activity.addCallback
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import com.base.pdfviewerscannerwhite.R
import com.base.pdfviewerscannerwhite.ads.admob.AdmobInterstitialUtils
import com.base.pdfviewerscannerwhite.bean.ConstObject
import com.base.pdfviewerscannerwhite.databinding.ActivityWhatsappCleanDetailBinding
import com.base.pdfviewerscannerwhite.ui.result.ResultActivity
import com.base.pdfviewerscannerwhite.utils.LogEx
class WhatsappCleanDetailActivity : BaseActivity2() {
......@@ -71,7 +77,14 @@ class WhatsappCleanDetailActivity : BaseActivity2() {
binding.tvDelete.setOnClickListener {
if (total <= 0) return@setOnClickListener
DialogHelps.showDeleteDialog(this, binding.tvDelete) {
showAnimationAd {
AdmobInterstitialUtils.showInterstitialAd(this, false, false) {
startActivity(Intent(this, ResultActivity::class.java).apply {
putExtra("from", ConstObject.FUNCTION_WHATSAPP)
putExtra("clean_size", total)
// flags = FLAG_ACTIVITY_NEW_TASK or FLAG_ACTIVITY_CLEAR_TASK
LogEx.logDebug("clean_size", "total=$total")
})
finish()
}
cleanFiles(adapter.list)
}
......
......@@ -9,9 +9,13 @@ import com.base.pdfviewerscannerwhite.ads.admob.AdmobNativeUtils
import com.base.pdfviewerscannerwhite.bean.ConstObject.FUNCTION_APP_PROCESS
import com.base.pdfviewerscannerwhite.bean.ConstObject.FUNCTION_SCAM_JUNK
import com.base.pdfviewerscannerwhite.bean.ConstObject.FUNCTION_SCREEN_SHORT
import com.base.pdfviewerscannerwhite.bean.ConstObject.FUNCTION_SIMILAR
import com.base.pdfviewerscannerwhite.bean.ConstObject.FUNCTION_WHATSAPP
import com.base.pdfviewerscannerwhite.databinding.ActivityResultBinding
import com.base.pdfviewerscannerwhite.helper.BaseActivity
import com.base.pdfviewerscannerwhite.mix.LargeFileCleanActivity
import com.base.pdfviewerscannerwhite.mix.ScreenshotCleanActivity
import com.base.pdfviewerscannerwhite.mix.SimilarPhotosActivity
import com.base.pdfviewerscannerwhite.ui.appprocess.AppProcessLoadingActivity
import com.base.pdfviewerscannerwhite.ui.cleanjunk.ScanJunkActivity
import com.base.pdfviewerscannerwhite.utils.BarUtils
......@@ -80,6 +84,42 @@ class ResultActivity : BaseActivity<ActivityResultBinding>() {
finish()
}
}
FUNCTION_SIMILAR -> {
binding.tvTitle.text = getString(R.string.similar_photos)
val s = intent.extras?.getLong("clean_size") ?: 0L
if (s != 0L) {
binding.tvSize.text = "Cleaned up ${s.toFormatSize(1)}"
}
binding.tvFunction.text = getString(R.string.screenshot_clean)
binding.ivFunction.setImageResource(R.mipmap.icon_screenshot_tools)
binding.tvFunctionDesc.text = getString(R.string.find_your_screenshot_clean_it)
binding.tvFunctionBtn.text = getString(R.string.scan_now)
binding.tvFunctionBtn.setOnClickListener {
startActivity(Intent(this, ScreenshotCleanActivity::class.java))
finish()
}
}
FUNCTION_WHATSAPP -> {
binding.tvTitle.text = getString(R.string.whatsapp_clean)
val s = intent.extras?.getLong("clean_size") ?: 0L
if (s != 0L) {
binding.tvSize.text = "Cleaned up ${s.toFormatSize(1)}"
}
binding.tvFunction.text = getString(R.string.similar_photos)
binding.ivFunction.setImageResource(R.mipmap.icon_similar_tool)
binding.tvFunctionDesc.text = getString(R.string.find_your_similar_photos_to_clean_it)
binding.tvFunctionBtn.text = getString(R.string.scan_now)
binding.tvFunctionBtn.setOnClickListener {
startActivity(Intent(this, SimilarPhotosActivity::class.java))
finish()
}
}
}
......@@ -88,7 +128,7 @@ class ResultActivity : BaseActivity<ActivityResultBinding>() {
override fun initListener() {
super.initListener()
onBackPressedDispatcher.addCallback {
finishToMain()
finishToMainTop()
}
binding.flFanhui.setOnClickListener {
onBackPressedDispatcher.onBackPressed()
......
......@@ -361,8 +361,11 @@
<string name="screen_pop">Clear screenshot clutter to free up space!</string>
<string name="similar_pop">Clear similar file to free up space!</string>
<string name="zodiac">Zodiac</string>
<string name="find_your_screenshot_clean_it">Find your screenshot clean it!</string>
<string name="find_your_screenshot_clean_it">Find your screenshot to clean it!</string>
<string name="find_your_large_file_to_clean_it">Find your large file to clean it!</string>
<string name="exit_large_file_clean">Exit Large Files</string>
<string name="exit_large_file_clean_content">Exit Large Files? Undeleted large files may be occupying valuable space.</string>
<string name="find_your_similar_photos_to_clean_it">Find your similar photos to clean it!</string>
</resources>
\ No newline at end of file
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