Commit 1a3690c1 authored by maxiaoliang's avatar maxiaoliang

1

parent cb525120
......@@ -12,15 +12,17 @@ import com.test.easy.easycleanerjunk.helps.ConfigHelper
import com.test.easy.easycleanerjunk.helps.ads.AdmobUtils
import com.test.easy.easycleanerjunk.helps.ads.MaxAdUtils
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlin.random.Random
class AppManagerAnimationActivity : BaseActivity<ActivityAppManagerAnimationBinding>() {
override val isLightMode =true
override val binding: ActivityAppManagerAnimationBinding by lazy {
ActivityAppManagerAnimationBinding.inflate(layoutInflater)
}
private var job: Job? = null
override fun initView() {
playLottie()
......@@ -37,8 +39,21 @@ class AppManagerAnimationActivity : BaseActivity<ActivityAppManagerAnimationBind
binding.lottie.imageAssetsFolder = "easy_app_manager/images/"
binding.lottie.setAnimation("easy_app_manager/data.json")
binding.lottie.playAnimation()
lifecycleScope.launch(Dispatchers.Main) {
delay(Random.nextLong(4000, 6000))
}
override fun onPause() {
super.onPause()
binding.lottie.pauseAnimation()
job?.cancel()
}
override fun onResume() {
super.onResume()
playLottie()
job = waitJob()
}
private fun waitJob() = lifecycleScope.launch(Dispatchers.Main) {
delay(Random.nextLong(3000, 4500))
binding.lottie.visibility = View.GONE
binding.lottieCompleted.visibility = View.VISIBLE
binding.lottieCompleted.playAnimation()
......@@ -57,8 +72,6 @@ class AppManagerAnimationActivity : BaseActivity<ActivityAppManagerAnimationBind
finish()
}
}
}
}
}
\ No newline at end of file
......@@ -17,7 +17,7 @@ import kotlinx.coroutines.launch
import kotlin.random.Random
class BatteryInfoAnimationActivity : BaseActivity<ActivityBatteryInfoAnimationBinding>() {
override val isLightMode=true
override val binding: ActivityBatteryInfoAnimationBinding by lazy {
ActivityBatteryInfoAnimationBinding.inflate(layoutInflater)
}
......
......@@ -12,8 +12,10 @@ import com.test.easy.easycleanerjunk.helps.ConfigHelper
import com.test.easy.easycleanerjunk.helps.ads.AdmobUtils
import com.test.easy.easycleanerjunk.helps.ads.MaxAdUtils
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlin.random.Random
class LargeFileAnimationActivity : BaseActivity<ActivityLargeFileAnimationBinding>() {
override val isLightMode = true
......@@ -21,7 +23,7 @@ class LargeFileAnimationActivity : BaseActivity<ActivityLargeFileAnimationBindin
ActivityLargeFileAnimationBinding.inflate(layoutInflater)
}
private var job: Job? = null
override fun initView() {
playLottie()
}
......@@ -31,13 +33,24 @@ class LargeFileAnimationActivity : BaseActivity<ActivityLargeFileAnimationBindin
Toast.makeText(this@LargeFileAnimationActivity, "wait a moment", Toast.LENGTH_SHORT).show()
}
}
override fun onPause() {
super.onPause()
binding.lottie.pauseAnimation()
job?.cancel()
}
override fun onResume() {
super.onResume()
playLottie()
job = waitJob()
}
@SuppressLint("SetTextI18n")
private fun playLottie(showFinish: (() -> Unit)? = null) {
lifecycleScope.launch(Dispatchers.Main) {
delay(5000)
private fun playLottie() {
binding.lottie.playAnimation()
}
private fun waitJob() = lifecycleScope.launch(Dispatchers.Main) {
delay(Random.nextLong(3000, 4500))
binding.lottie.visibility = View.GONE
binding.lottie.clearAnimation()
binding.lottieCompleted.visibility = View.VISIBLE
......@@ -46,18 +59,14 @@ class LargeFileAnimationActivity : BaseActivity<ActivityLargeFileAnimationBindin
delay(1000)
if(ConfigHelper.admobTrueMaxFlase==0){
MaxAdUtils.showInterstitialAd(this@LargeFileAnimationActivity) {
showFinish?.invoke()
startActivity(Intent(this@LargeFileAnimationActivity, LargeFileCleanActivity::class.java))
finish()
}
}else{
AdmobUtils.showInterstitialAd(this@LargeFileAnimationActivity) {
showFinish?.invoke()
startActivity(Intent(this@LargeFileAnimationActivity, LargeFileCleanActivity::class.java))
finish()
}
}
}
}
}
\ No newline at end of file
package com.test.easy.easycleanerjunk.activity.photocompress.photo
import android.annotation.SuppressLint
import android.content.Intent
import android.graphics.Color
import android.view.View
......@@ -11,10 +10,14 @@ import androidx.lifecycle.lifecycleScope
import com.test.easy.easycleanerjunk.databinding.ActivityStartCompressionPhotoBinding
import com.test.easy.easycleanerjunk.helps.BaseActivity
import com.test.easy.easycleanerjunk.helps.ConfigHelper
import com.test.easy.easycleanerjunk.helps.PermissionHelp.checkStorePermission
import com.test.easy.easycleanerjunk.helps.PermissionHelp.requestStorePermission
import com.test.easy.easycleanerjunk.helps.ads.AdmobUtils
import com.test.easy.easycleanerjunk.helps.ads.MaxAdUtils
import com.test.easy.easycleanerjunk.utils.BarUtils
import com.test.easy.easycleanerjunk.view.DialogViews.showGerPermission
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlin.random.Random
......@@ -26,7 +29,7 @@ class StartCompressionPhotoActivity : BaseActivity<ActivityStartCompressionPhoto
ActivityStartCompressionPhotoBinding.inflate(layoutInflater)
}
private var job: Job? = null
override fun initView() {
BarUtils.setStatusBarColor(this, Color.TRANSPARENT)
binding.root.updatePadding(top = BarUtils.getStatusBarHeight())
......@@ -36,34 +39,42 @@ class StartCompressionPhotoActivity : BaseActivity<ActivityStartCompressionPhoto
Toast.makeText(this@StartCompressionPhotoActivity, "wait a moment", Toast.LENGTH_SHORT).show()
}
})
if (!checkStorePermission()) {
showGerPermission(
deny = { finishToMain() },
allow = {
requestStorePermission(launcher, result = {
if (it) {
} else {
finishToMain()
}
})
})
}
override fun onStart() {
super.onStart()
checkPermission()
}
var isplay = 0
override fun onPermissionsResult(isGranted: Boolean) {
if (isGranted) {
isplay += 1
if (isplay == 1) {
playLottie()
override fun onPause() {
super.onPause()
binding.lottie.pauseAnimation()
job?.cancel()
}
} else {
finishToMain()
override fun onResume() {
super.onResume()
if (checkStorePermission()) {
resumeLottie()
job = waitJob()
}
}
private fun resumeLottie() {
@SuppressLint("SetTextI18n")
private fun playLottie() {
binding.lottie.imageAssetsFolder = "easy_imgcompress/images/"
binding.lottie.setAnimation("easy_imgcompress/data.json")
binding.lottie.playAnimation()
}
lifecycleScope.launch(Dispatchers.Main) {
private fun waitJob() = lifecycleScope.launch(Dispatchers.Main) {
delay(Random.nextLong(2500, 4000))
val aContext = this@StartCompressionPhotoActivity
binding.lottie.cancelAnimation()
......@@ -95,10 +106,9 @@ class StartCompressionPhotoActivity : BaseActivity<ActivityStartCompressionPhoto
}
}
}
}
}
override fun onDestroy() {
super.onDestroy()
binding.lottie.clearAnimation()
......
package com.test.easy.easycleanerjunk.activity.screenshot
import android.annotation.SuppressLint
import android.content.Intent
import android.view.View
import android.widget.Toast
......@@ -12,6 +11,7 @@ import com.test.easy.easycleanerjunk.helps.ConfigHelper
import com.test.easy.easycleanerjunk.helps.ads.AdmobUtils
import com.test.easy.easycleanerjunk.helps.ads.MaxAdUtils
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlin.random.Random
......@@ -22,9 +22,9 @@ class ScreenShotAnimationActivity : BaseActivity<ActivityScreenShotAnimationBind
override val binding: ActivityScreenShotAnimationBinding by lazy {
ActivityScreenShotAnimationBinding.inflate(layoutInflater)
}
private var job: Job? = null
override fun initView() {
playLottie()
}
override fun initListener() {
......@@ -38,13 +38,25 @@ class ScreenShotAnimationActivity : BaseActivity<ActivityScreenShotAnimationBind
}
@SuppressLint("SetTextI18n")
private fun playLottie() {
override fun onPause() {
super.onPause()
binding.lottie.pauseAnimation()
job?.cancel()
}
override fun onResume() {
super.onResume()
resumeLottie()
job = waitJob()
}
fun resumeLottie(){
binding.lottie.imageAssetsFolder = "easy_imgcompress/images/"
binding.lottie.setAnimation("easy_imgcompress/data.json")
binding.lottie.playAnimation()
lifecycleScope.launch(Dispatchers.Main) {
}
private fun waitJob() = lifecycleScope.launch(Dispatchers.Main) {
delay(Random.nextLong(3000, 4500))
delay(Random.nextLong(2500, 4000))
binding.lottie.cancelAnimation()
binding.lottie.visibility = View.GONE
......@@ -63,10 +75,6 @@ class ScreenShotAnimationActivity : BaseActivity<ActivityScreenShotAnimationBind
finish()
}
}
}
}
}
\ No newline at end of file
......@@ -12,6 +12,7 @@ import com.test.easy.easycleanerjunk.helps.ConfigHelper
import com.test.easy.easycleanerjunk.helps.ads.AdmobUtils
import com.test.easy.easycleanerjunk.helps.ads.MaxAdUtils
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlin.random.Random
......@@ -21,13 +22,35 @@ class RepeatPhotoAnimationActivity : BaseActivity<ActivityRepeatPhotoAnimationBi
override val binding: ActivityRepeatPhotoAnimationBinding by lazy {
ActivityRepeatPhotoAnimationBinding.inflate(layoutInflater)
}
private var job: Job? = null
@SuppressLint("SetTextI18n")
override fun initView() {
lifecycleScope.launch(Dispatchers.Main) {
delay(Random.nextLong(2500, 4000))
resumeLottie()
}
override fun initListener() {
onBackPressedDispatcher.addCallback {
Toast.makeText(this@RepeatPhotoAnimationActivity, "wait a moment", Toast.LENGTH_SHORT).show()
}
}
override fun onPause() {
super.onPause()
binding.lottie.pauseAnimation()
job?.cancel()
}
override fun onResume() {
super.onResume()
resumeLottie()
job = waitJob()
}
fun resumeLottie(){
binding.lottie.playAnimation()
}
private fun waitJob() = lifecycleScope.launch(Dispatchers.Main) {
delay(Random.nextLong(3000, 4500))
binding.lottie.cancelAnimation()
binding.lottie.visibility = View.GONE
binding.lottieCompleted.visibility = View.VISIBLE
......@@ -45,14 +68,6 @@ class RepeatPhotoAnimationActivity : BaseActivity<ActivityRepeatPhotoAnimationBi
finish()
}
}
}
}
override fun initListener() {
onBackPressedDispatcher.addCallback {
Toast.makeText(this@RepeatPhotoAnimationActivity, "wait a moment", Toast.LENGTH_SHORT).show()
}
}
}
\ No newline at end of file
package com.test.easy.easycleanerjunk.activity.whatsapp
import android.annotation.SuppressLint
import android.content.Intent
import android.view.View
import android.widget.Toast
......@@ -11,6 +10,8 @@ import com.test.easy.easycleanerjunk.helps.BaseActivity
import com.test.easy.easycleanerjunk.helps.ConfigHelper
import com.test.easy.easycleanerjunk.helps.ads.AdmobUtils
import com.test.easy.easycleanerjunk.helps.ads.MaxAdUtils
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlin.random.Random
......@@ -20,9 +21,9 @@ class WhatsAppCleanerAnimationActivity : BaseActivity<ActivityWhatsAppCleanerAni
override val binding: ActivityWhatsAppCleanerAnimationBinding by lazy {
ActivityWhatsAppCleanerAnimationBinding.inflate(layoutInflater)
}
private var job: Job? = null
override fun initView() {
playLottie()
resumeLottie()
}
override fun initListener() {
......@@ -31,13 +32,24 @@ class WhatsAppCleanerAnimationActivity : BaseActivity<ActivityWhatsAppCleanerAni
}
}
@SuppressLint("SetTextI18n")
private fun playLottie() {
override fun onPause() {
super.onPause()
binding.lottie.pauseAnimation()
job?.cancel()
}
override fun onResume() {
super.onResume()
resumeLottie()
job = waitJob()
}
fun resumeLottie(){
binding.lottie.imageAssetsFolder = "easy_junk_scan/images/"
binding.lottie.setAnimation("easy_junk_scan/data.json")
binding.lottie.playAnimation()
lifecycleScope.launch {
delay(Random.nextLong(3500, 4500))
}
private fun waitJob() = lifecycleScope.launch(Dispatchers.Main) {
delay(Random.nextLong(3000, 4500))
binding.lottie.cancelAnimation()
binding.lottie.visibility = View.GONE
binding.lottieCompleted.visibility = View.VISIBLE
......@@ -58,7 +70,5 @@ class WhatsAppCleanerAnimationActivity : BaseActivity<ActivityWhatsAppCleanerAni
}
}
}
\ 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