desc="This feature requires access to your storage to scan your files and clean up junk files and unused APK files. We will not transmit your data to any third-party service. Please grant permission so that we can provide you with better service.",
deny={finishToMain()},
allow={
requestStorePermission(launcher,result={
if(it){
onResumePlay=true
}else{
finishToMain()
}
})
})
}
}
...
...
@@ -63,16 +60,13 @@ class ScanJunkActivity : BaseActivity<ActivityLayoutScanJunkBinding>() {
}
}
privatevarisPause=false
overridefunonResume(){
super.onResume()
if(onResumePlay){
playLottie()
}
if(isPause){
binding.lottie.resumeAnimation()
if(checkStorePermission()){
resumeLottie()
job=waitJob()
}
isPause=false
}
overridefunonDestroy(){
...
...
@@ -85,17 +79,18 @@ class ScanJunkActivity : BaseActivity<ActivityLayoutScanJunkBinding>() {
overridefunonPause(){
super.onPause()
isPause=true
animator1?.pause()
animator2?.pause()
animator3?.pause()
binding.lottie.pauseAnimation()
job?.cancel()
}
@SuppressLint("SetTextI18n")
privatefunplayLottie(){
vala1=ValueAnimator.ofFloat(0f,360f)
a1.run{
privatefunresumeLottie(){
if(animator1==null){
animator1=ValueAnimator.ofFloat(0f,360f)
animator1?.run{
duration=1000
repeatMode=ValueAnimator.RESTART
repeatCount=ValueAnimator.INFINITE
...
...
@@ -103,10 +98,12 @@ class ScanJunkActivity : BaseActivity<ActivityLayoutScanJunkBinding>() {
addUpdateListener{
binding.idView1.rotation=it.animatedValueasFloat
}
start()
}
vala2=ValueAnimator.ofFloat(0f,360f)
a2.run{
}
animator1?.start()
if(animator2==null){
animator1=ValueAnimator.ofFloat(0f,360f)
animator2?.run{
duration=1000
repeatMode=ValueAnimator.RESTART
repeatCount=ValueAnimator.INFINITE
...
...
@@ -114,10 +111,12 @@ class ScanJunkActivity : BaseActivity<ActivityLayoutScanJunkBinding>() {
addUpdateListener{
binding.idView2.rotation=it.animatedValueasFloat
}
start()
}
vala3=ValueAnimator.ofFloat(0f,360f)
a3.run{
}
animator2?.start()
if(animator3==null){
animator3=ValueAnimator.ofFloat(0f,360f)
animator3?.run{
duration=1000
repeatMode=ValueAnimator.RESTART
repeatCount=ValueAnimator.INFINITE
...
...
@@ -125,29 +124,30 @@ class ScanJunkActivity : BaseActivity<ActivityLayoutScanJunkBinding>() {