Commit acc452a1 authored by wanglei's avatar wanglei

...垃圾清理功能

parent c444c479
...@@ -124,7 +124,7 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() { ...@@ -124,7 +124,7 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
val bean = ChildBean(R.mipmap.apk, l.name, l.path, l.size) val bean = ChildBean(R.mipmap.apk, l.name, l.path, l.size)
child3.add(bean) child3.add(bean)
} }
testApk() // testApk()
scanCount += 1 scanCount += 1
updateSize(doneIndex = 0) updateSize(doneIndex = 0)
......
...@@ -3,6 +3,7 @@ package com.base.datarecovery.activity.junkclean ...@@ -3,6 +3,7 @@ package com.base.datarecovery.activity.junkclean
import android.animation.ValueAnimator import android.animation.ValueAnimator
import android.content.Intent import android.content.Intent
import android.graphics.Color import android.graphics.Color
import android.view.animation.LinearInterpolator
import android.widget.Toast import android.widget.Toast
import androidx.activity.addCallback import androidx.activity.addCallback
import androidx.core.view.updatePadding import androidx.core.view.updatePadding
...@@ -83,16 +84,57 @@ class ScanJunkActivity : BaseActivity<ActivityLayoutScanJunkBinding>() { ...@@ -83,16 +84,57 @@ class ScanJunkActivity : BaseActivity<ActivityLayoutScanJunkBinding>() {
} }
private fun playLottie(showAd: Boolean = true) { private fun playLottie(showAd: Boolean = true) {
val a1 = ValueAnimator.ofFloat(0f, 360f)
a1.run {
duration = 1000
repeatMode = ValueAnimator.RESTART
repeatCount = ValueAnimator.INFINITE
interpolator = LinearInterpolator()
addUpdateListener {
binding.idView1.rotation = it.animatedValue as Float
}
start()
}
val a2 = ValueAnimator.ofFloat(0f, 360f)
a2.run {
duration = 1000
repeatMode = ValueAnimator.RESTART
repeatCount = ValueAnimator.INFINITE
interpolator = LinearInterpolator()
addUpdateListener {
binding.idView2.rotation = it.animatedValue as Float
}
start()
}
val a3 = ValueAnimator.ofFloat(0f, 360f)
a3.run {
duration = 1000
repeatMode = ValueAnimator.RESTART
repeatCount = ValueAnimator.INFINITE
interpolator = LinearInterpolator()
addUpdateListener {
binding.idView3.rotation = it.animatedValue as Float
}
start()
}
binding.idJunkScan.imageAssetsFolder = "junk_scan/images/" binding.idJunkScan.imageAssetsFolder = "junk_scan/images/"
binding.idJunkScan.setAnimation("junk_scan/data.json") binding.idJunkScan.setAnimation("junk_scan/data.json")
binding.idJunkScan.playAnimation() binding.idJunkScan.playAnimation()
binding.root.postDelayed({ binding.root.postDelayed({
if (showAd) { if (showAd) {
AdmobInterstitialUtils.showInterstitialAd(this) { AdmobInterstitialUtils.showInterstitialAd(this) {
a1.cancel()
a2.cancel()
a3.cancel()
startActivity(Intent(this, CleanJunkActivity::class.java)) startActivity(Intent(this, CleanJunkActivity::class.java))
finish() finish()
} }
} else { } else {
a1.cancel()
a2.cancel()
a3.cancel()
startActivity(Intent(this, CleanJunkActivity::class.java)) startActivity(Intent(this, CleanJunkActivity::class.java))
finish() finish()
} }
......
...@@ -60,4 +60,83 @@ ...@@ -60,4 +60,83 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent" /> app:layout_constraintBottom_toBottomOf="parent" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginBottom="75dp"
android:gravity="center_horizontal"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/id_view1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@mipmap/cjxuanzhuan" />
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@mipmap/cleantu1" />
</FrameLayout>
<View
android:layout_width="39dp"
android:layout_height="1dp"
android:layout_gravity="center"
android:layout_marginHorizontal="20dp"
android:background="#DCDCDC" />
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/id_view2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/cjxuanzhuan" />
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@mipmap/cleantu2" />
</FrameLayout>
<View
android:layout_width="39dp"
android:layout_height="1dp"
android:layout_gravity="center"
android:layout_marginHorizontal="20dp"
android:background="#DCDCDC" />
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/id_view3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/cjxuanzhuan" />
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@mipmap/cleantu2" />
</FrameLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
\ 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