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,27 +39,38 @@ 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))
binding.lottie.visibility = View.GONE
binding.lottieCompleted.visibility = View.VISIBLE
binding.lottieCompleted.playAnimation()
binding.tv.text = "Completed!"
delay(1000)
if(ConfigHelper.admobTrueMaxFlase==0){
MaxAdUtils.showInterstitialAd(this@AppManagerAnimationActivity) {
binding.lottie.cancelAnimation()
startActivity(Intent(this@AppManagerAnimationActivity, AppManagerActivity::class.java))
finish()
}
}else{
AdmobUtils.showInterstitialAd(this@AppManagerAnimationActivity) {
binding.lottie.cancelAnimation()
startActivity(Intent(this@AppManagerAnimationActivity, AppManagerActivity::class.java))
finish()
}
}
}
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()
binding.tv.text = "Completed!"
delay(1000)
if(ConfigHelper.admobTrueMaxFlase==0){
MaxAdUtils.showInterstitialAd(this@AppManagerAnimationActivity) {
binding.lottie.cancelAnimation()
startActivity(Intent(this@AppManagerAnimationActivity, AppManagerActivity::class.java))
finish()
}
}else{
AdmobUtils.showInterstitialAd(this@AppManagerAnimationActivity) {
binding.lottie.cancelAnimation()
startActivity(Intent(this@AppManagerAnimationActivity, AppManagerActivity::class.java))
finish()
}
}
}
......
......@@ -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,33 +33,40 @@ 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)
binding.lottie.visibility = View.GONE
binding.lottie.clearAnimation()
binding.lottieCompleted.visibility = View.VISIBLE
binding.lottieCompleted.playAnimation()
binding.tv.text = "Completed!"
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()
}
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
binding.lottieCompleted.playAnimation()
binding.tv.text = "Completed!"
delay(1000)
if(ConfigHelper.admobTrueMaxFlase==0){
MaxAdUtils.showInterstitialAd(this@LargeFileAnimationActivity) {
startActivity(Intent(this@LargeFileAnimationActivity, LargeFileCleanActivity::class.java))
finish()
}
}else{
AdmobUtils.showInterstitialAd(this@LargeFileAnimationActivity) {
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,69 +39,76 @@ 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()
override fun onPause() {
super.onPause()
binding.lottie.pauseAnimation()
job?.cancel()
}
var isplay = 0
override fun onPermissionsResult(isGranted: Boolean) {
if (isGranted) {
isplay += 1
if (isplay == 1) {
playLottie()
}
} 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) {
delay(Random.nextLong(2500, 4000))
val aContext = this@StartCompressionPhotoActivity
binding.lottie.cancelAnimation()
binding.lottie.visibility = View.GONE
binding.lottieCompleted.visibility = View.VISIBLE
binding.lottieCompleted.playAnimation()
binding.tv.text = "Completed!"
delay(1000)
if(ConfigHelper.admobTrueMaxFlase==0){
MaxAdUtils.showInterstitialAd(aContext) {
val mList = ImagesMediaUtils.getAlbums(aContext)
if (mList.isNotEmpty()) {
startActivity(Intent(aContext, CompressionPhotoListActivity::class.java))
finish()
} else {
startActivity(Intent(aContext, CompressionPhotoListActivity::class.java))
finish()
}
private fun waitJob() = lifecycleScope.launch(Dispatchers.Main) {
delay(Random.nextLong(2500, 4000))
val aContext = this@StartCompressionPhotoActivity
binding.lottie.cancelAnimation()
binding.lottie.visibility = View.GONE
binding.lottieCompleted.visibility = View.VISIBLE
binding.lottieCompleted.playAnimation()
binding.tv.text = "Completed!"
delay(1000)
if(ConfigHelper.admobTrueMaxFlase==0){
MaxAdUtils.showInterstitialAd(aContext) {
val mList = ImagesMediaUtils.getAlbums(aContext)
if (mList.isNotEmpty()) {
startActivity(Intent(aContext, CompressionPhotoListActivity::class.java))
finish()
} else {
startActivity(Intent(aContext, CompressionPhotoListActivity::class.java))
finish()
}
}else{
AdmobUtils.showInterstitialAd(aContext) {
val mList = ImagesMediaUtils.getAlbums(aContext)
if (mList.isNotEmpty()) {
startActivity(Intent(aContext, CompressionPhotoListActivity::class.java))
finish()
} else {
startActivity(Intent(aContext, CompressionPhotoListActivity::class.java))
finish()
}
}
}else{
AdmobUtils.showInterstitialAd(aContext) {
val mList = ImagesMediaUtils.getAlbums(aContext)
if (mList.isNotEmpty()) {
startActivity(Intent(aContext, CompressionPhotoListActivity::class.java))
finish()
} else {
startActivity(Intent(aContext, CompressionPhotoListActivity::class.java))
finish()
}
}
}
}
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,35 +38,43 @@ 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) {
delay(Random.nextLong(2500, 4000))
binding.lottie.cancelAnimation()
binding.lottie.visibility = View.GONE
binding.lottieCompleted.visibility = View.VISIBLE
binding.lottieCompleted.playAnimation()
binding.tv.text = "Completed!"
delay(1000)
if(ConfigHelper.admobTrueMaxFlase==0){
MaxAdUtils.showInterstitialAd(this@ScreenShotAnimationActivity) {
startActivity(Intent(this@ScreenShotAnimationActivity, ScreenShotActivity::class.java))
finish()
}
}else{
AdmobUtils.showInterstitialAd(this@ScreenShotAnimationActivity) {
startActivity(Intent(this@ScreenShotAnimationActivity, ScreenShotActivity::class.java))
finish()
}
}
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
binding.lottieCompleted.visibility = View.VISIBLE
binding.lottieCompleted.playAnimation()
binding.tv.text = "Completed!"
delay(1000)
if(ConfigHelper.admobTrueMaxFlase==0){
MaxAdUtils.showInterstitialAd(this@ScreenShotAnimationActivity) {
startActivity(Intent(this@ScreenShotAnimationActivity, ScreenShotActivity::class.java))
finish()
}
}else{
AdmobUtils.showInterstitialAd(this@ScreenShotAnimationActivity) {
startActivity(Intent(this@ScreenShotAnimationActivity, ScreenShotActivity::class.java))
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,32 +22,12 @@ 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))
binding.lottie.cancelAnimation()
binding.lottie.visibility = View.GONE
binding.lottieCompleted.visibility = View.VISIBLE
binding.lottieCompleted.playAnimation()
binding.tv.text = "Completed!"
delay(1000)
if(ConfigHelper.admobTrueMaxFlase==0){
MaxAdUtils.showInterstitialAd(this@RepeatPhotoAnimationActivity){
startActivity(Intent(this@RepeatPhotoAnimationActivity, RepeatPhotoActivity::class.java))
finish()
}
}else{
AdmobUtils.showInterstitialAd(this@RepeatPhotoAnimationActivity){
startActivity(Intent(this@RepeatPhotoAnimationActivity, RepeatPhotoActivity::class.java))
finish()
}
}
}
resumeLottie()
}
override fun initListener() {
......@@ -54,5 +35,39 @@ class RepeatPhotoAnimationActivity : BaseActivity<ActivityRepeatPhotoAnimationBi
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
binding.lottieCompleted.playAnimation()
binding.tv.text = "Completed!"
delay(1000)
if(ConfigHelper.admobTrueMaxFlase==0){
MaxAdUtils.showInterstitialAd(this@RepeatPhotoAnimationActivity){
startActivity(Intent(this@RepeatPhotoAnimationActivity, RepeatPhotoActivity::class.java))
finish()
}
}else{
AdmobUtils.showInterstitialAd(this@RepeatPhotoAnimationActivity){
startActivity(Intent(this@RepeatPhotoAnimationActivity, RepeatPhotoActivity::class.java))
finish()
}
}
}
}
\ 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,31 +32,40 @@ 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))
binding.lottie.cancelAnimation()
binding.lottie.visibility = View.GONE
binding.lottieCompleted.visibility = View.VISIBLE
binding.lottieCompleted.playAnimation()
binding.tv.text="Completed!"
delay(1000)
if(ConfigHelper.admobTrueMaxFlase==0){
MaxAdUtils.showInterstitialAd(this@WhatsAppCleanerAnimationActivity) {
startActivity(Intent(this@WhatsAppCleanerAnimationActivity, WhatsAppCleanerActivity::class.java))
finish()
}
}else{
AdmobUtils.showInterstitialAd(this@WhatsAppCleanerAnimationActivity) {
startActivity(Intent(this@WhatsAppCleanerAnimationActivity, WhatsAppCleanerActivity::class.java))
finish()
}
}
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
binding.lottieCompleted.playAnimation()
binding.tv.text="Completed!"
delay(1000)
if(ConfigHelper.admobTrueMaxFlase==0){
MaxAdUtils.showInterstitialAd(this@WhatsAppCleanerAnimationActivity) {
startActivity(Intent(this@WhatsAppCleanerAnimationActivity, WhatsAppCleanerActivity::class.java))
finish()
}
}else{
AdmobUtils.showInterstitialAd(this@WhatsAppCleanerAnimationActivity) {
startActivity(Intent(this@WhatsAppCleanerAnimationActivity, WhatsAppCleanerActivity::class.java))
finish()
}
}
}
......
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