Commit d9c769cf authored by wanglei's avatar wanglei

...

parent d4e8ed74
......@@ -10,6 +10,7 @@ import com.base.datarecovery.ads.AdmobMaxHelper
import com.base.datarecovery.databinding.ActivityAppManagerAnimationBinding
import com.base.datarecovery.help.BaseActivity
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlin.random.Random
......@@ -19,6 +20,7 @@ class AppProcessAnimationActivity : BaseActivity<ActivityAppManagerAnimationBind
override val binding: ActivityAppManagerAnimationBinding by lazy {
ActivityAppManagerAnimationBinding.inflate(layoutInflater)
}
private var job: Job? = null
override fun initView() {
playLottie()
......@@ -35,7 +37,10 @@ class AppProcessAnimationActivity : BaseActivity<ActivityAppManagerAnimationBind
binding.lottie.imageAssetsFolder = "app_manager/images/"
binding.lottie.setAnimation("app_manager/data.json")
binding.lottie.playAnimation()
lifecycleScope.launch(Dispatchers.Main) {
}
@SuppressLint("SetTextI18n")
private fun jumpJob() = lifecycleScope.launch(Dispatchers.Main) {
delay(Random.nextLong(4000, 6000))
binding.lottie.visibility = View.GONE
binding.lottieCompleted.visibility = View.VISIBLE
......@@ -49,6 +54,18 @@ class AppProcessAnimationActivity : BaseActivity<ActivityAppManagerAnimationBind
}
}
override fun onResume() {
super.onResume()
if (job?.isActive == false && job == null) {
job = jumpJob()
}
}
override fun onPause() {
super.onPause()
job?.cancel()
job = null
}
}
\ No newline at end of file
......@@ -10,6 +10,7 @@ import com.base.datarecovery.ads.AdmobMaxHelper
import com.base.datarecovery.databinding.ActivityLargeFileAnimationBinding
import com.base.datarecovery.help.BaseActivity
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
......@@ -19,9 +20,9 @@ class LargeFileAnimationActivity : BaseActivity<ActivityLargeFileAnimationBindin
ActivityLargeFileAnimationBinding.inflate(layoutInflater)
}
private var job: Job? = null
override fun initView() {
playLottie()
}
override fun initListener() {
......@@ -31,10 +32,7 @@ class LargeFileAnimationActivity : BaseActivity<ActivityLargeFileAnimationBindin
}
@SuppressLint("SetTextI18n")
private fun playLottie(showFinish: (() -> Unit)? = null) {
lifecycleScope.launch(Dispatchers.Main) {
fun jumpJob() = lifecycleScope.launch(Dispatchers.Main) {
delay(5000)
binding.lottie.visibility = View.GONE
binding.lottie.clearAnimation()
......@@ -43,11 +41,22 @@ class LargeFileAnimationActivity : BaseActivity<ActivityLargeFileAnimationBindin
binding.tv.text = "Completed!"
delay(1000)
AdmobMaxHelper.admobMaxShowInterstitialAd(this@LargeFileAnimationActivity) {
showFinish?.invoke()
startActivity(Intent(this@LargeFileAnimationActivity, LargeFileActivity::class.java))
finish()
}
}
override fun onResume() {
super.onResume()
if (job?.isActive == false && job == null) {
job = jumpJob()
}
}
override fun onPause() {
super.onPause()
job?.cancel()
job = null
}
}
\ No newline at end of file
......@@ -9,6 +9,7 @@ import com.base.datarecovery.ads.AdmobMaxHelper
import com.base.datarecovery.databinding.ActivityScreenShotAnimationBinding
import com.base.datarecovery.help.BaseActivity
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlin.random.Random
......@@ -18,9 +19,14 @@ class PhotoManagerAnimationActivity : BaseActivity<ActivityScreenShotAnimationBi
override val binding: ActivityScreenShotAnimationBinding by lazy {
ActivityScreenShotAnimationBinding.inflate(layoutInflater)
}
;
private var job: Job? = null
override fun initView() {
lifecycleScope.launch(Dispatchers.Main) {
}
fun jumpJob() = lifecycleScope.launch(Dispatchers.Main) {
delay(Random.nextLong(4000, 4500))
binding.lottie.visibility = View.INVISIBLE
binding.lottieCompleted.visibility = View.VISIBLE
......@@ -32,8 +38,6 @@ class PhotoManagerAnimationActivity : BaseActivity<ActivityScreenShotAnimationBi
}
}
}
override fun initListener() {
super.initListener()
onBackPressedDispatcher.addCallback {
......@@ -41,4 +45,16 @@ class PhotoManagerAnimationActivity : BaseActivity<ActivityScreenShotAnimationBi
}
}
override fun onResume() {
super.onResume()
if (job?.isActive == false) {
job = jumpJob()
}
}
override fun onPause() {
super.onPause()
job?.cancel()
}
}
\ No newline at end of file
......@@ -33,6 +33,7 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.channels.BufferOverflow
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.SharedFlow
import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch
import java.io.File
......@@ -161,7 +162,9 @@ class FileScanResultActivity : BaseActivity<ActivityFileScanResultBinding>() {
lifecycleScope.launch(Dispatchers.Main) {
binding.ivWancheng.visibility = View.VISIBLE
binding.tvScanning.text = "Completed"
if (isActive) {
AdmobMaxHelper.admobMaxShowInterstitialAd(this@FileScanResultActivity)
}
binding.flEmpty.isVisible = pathList.isEmpty()
setAdapterData(null)
dialogClass.finishScan {
......
......@@ -3,12 +3,13 @@ package com.base.datarecovery.activity.repeat
import android.content.Intent
import android.widget.Toast
import androidx.activity.addCallback
import androidx.lifecycle.lifecycleScope
import com.base.datarecovery.ads.AdmobMaxHelper
import com.base.datarecovery.ads.admob.AdmobInterstitialUtils
import com.base.datarecovery.ads.max.AdMaxInterstitialUtils
import com.base.datarecovery.databinding.ActivityRepeatAnimationBinding
import com.base.datarecovery.help.BaseActivity
import com.base.datarecovery.help.ConfigHelper
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlin.random.Random
class RepeatAnimationActivity : BaseActivity<ActivityRepeatAnimationBinding>() {
......@@ -17,14 +18,10 @@ class RepeatAnimationActivity : BaseActivity<ActivityRepeatAnimationBinding>() {
ActivityRepeatAnimationBinding.inflate(layoutInflater)
}
private var job: Job? = null
override fun initView() {
binding.root.postDelayed({
AdmobMaxHelper.admobMaxShowInterstitialAd(this){
startActivity(Intent(this, RepeatActivity::class.java))
finish()
}
}, Random.nextLong(3000, 4500))
}
override fun initListener() {
......@@ -33,4 +30,26 @@ class RepeatAnimationActivity : BaseActivity<ActivityRepeatAnimationBinding>() {
}
}
fun jumpJob() = lifecycleScope.launch {
delay(Random.nextLong(3000, 4500))
AdmobMaxHelper.admobMaxShowInterstitialAd(this@RepeatAnimationActivity) {
startActivity(Intent(this@RepeatAnimationActivity, RepeatActivity::class.java))
finish()
}
}
override fun onResume() {
super.onResume()
if (job?.isActive == false && job == null) {
job = jumpJob()
}
}
override fun onPause() {
super.onPause()
job?.cancel()
job = null
}
}
\ No newline at end of file
......@@ -3,11 +3,15 @@ package com.base.datarecovery.activity.screenshot
import android.content.Intent
import android.widget.Toast
import androidx.activity.addCallback
import androidx.lifecycle.lifecycleScope
import com.base.datarecovery.ads.AdmobMaxHelper
import com.base.datarecovery.ads.admob.AdmobInterstitialUtils
import com.base.datarecovery.databinding.ActivityScreenShotAnimationBinding
import com.base.datarecovery.help.BaseActivity
import com.base.datarecovery.utils.LogEx
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlin.random.Random
class ScreenShotAnimationActivity : BaseActivity<ActivityScreenShotAnimationBinding>() {
......@@ -15,14 +19,18 @@ class ScreenShotAnimationActivity : BaseActivity<ActivityScreenShotAnimationBind
override val binding: ActivityScreenShotAnimationBinding by lazy {
ActivityScreenShotAnimationBinding.inflate(layoutInflater)
}
private var job: Job? = null
override fun initView() {
binding.root.postDelayed({
AdmobMaxHelper.admobMaxShowInterstitialAd(this) {
startActivity(Intent(this, ScreenShotActivity::class.java))
}
fun jumpJob() = lifecycleScope.launch {
delay(Random.nextLong(3000, 4500))
AdmobMaxHelper.admobMaxShowInterstitialAd(this@ScreenShotAnimationActivity) {
startActivity(Intent(this@ScreenShotAnimationActivity, ScreenShotActivity::class.java))
finish()
}
}, Random.nextLong(3000, 4500))
}
override fun initListener() {
......@@ -32,4 +40,17 @@ class ScreenShotAnimationActivity : BaseActivity<ActivityScreenShotAnimationBind
}
}
override fun onResume() {
super.onResume()
if (job?.isActive == false && job == null) {
job = jumpJob()
}
}
override fun onPause() {
super.onPause()
job?.cancel()
job = null
}
}
\ No newline at end of file
......@@ -9,6 +9,8 @@ import androidx.lifecycle.lifecycleScope
import com.base.datarecovery.ads.AdmobMaxHelper
import com.base.datarecovery.databinding.ActivityWhatsAppCleanerAnimationBinding
import com.base.datarecovery.help.BaseActivity
import com.ironsource.j
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlin.random.Random
......@@ -20,6 +22,7 @@ class WhatsAppCleanerAnimationActivity : BaseActivity<ActivityWhatsAppCleanerAni
ActivityWhatsAppCleanerAnimationBinding.inflate(layoutInflater)
}
private var job: Job? = null
override fun initView() {
playLottie()
}
......@@ -35,21 +38,33 @@ class WhatsAppCleanerAnimationActivity : BaseActivity<ActivityWhatsAppCleanerAni
binding.lottie.imageAssetsFolder = "junk_scan/images/"
binding.lottie.setAnimation("junk_scan/data.json")
binding.lottie.playAnimation()
lifecycleScope.launch {
}
fun jumpJob() = lifecycleScope.launch {
delay(Random.nextLong(3500, 4500))
binding.lottie.cancelAnimation()
binding.lottie.visibility = View.GONE
binding.lottieCompleted.visibility = View.VISIBLE
binding.lottieCompleted.playAnimation()
binding.tv.text="Completed!"
binding.tv.text = "Completed!"
delay(1000)
AdmobMaxHelper.admobMaxShowInterstitialAd(this@WhatsAppCleanerAnimationActivity){
AdmobMaxHelper.admobMaxShowInterstitialAd(this@WhatsAppCleanerAnimationActivity) {
startActivity(Intent(this@WhatsAppCleanerAnimationActivity, WhatsAppCleanerActivity::class.java))
finish()
}
}
override fun onResume() {
super.onResume()
if (job?.isActive == false && job == null) {
job = jumpJob()
}
}
override fun onPause() {
super.onPause()
job?.cancel()
job = null
}
}
\ 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