Commit 1d899f4e authored by wanglei's avatar wanglei

...

parent 0ed93907
...@@ -35,7 +35,6 @@ class ScanJunkActivity : BaseActivity<ActivityLayoutScanJunkBinding>() { ...@@ -35,7 +35,6 @@ class ScanJunkActivity : BaseActivity<ActivityLayoutScanJunkBinding>() {
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
if (isPause) { if (isPause) {
startAnimation()
binding.idJunkScan.resumeAnimation() binding.idJunkScan.resumeAnimation()
} }
isPause = false isPause = false
...@@ -70,7 +69,6 @@ class ScanJunkActivity : BaseActivity<ActivityLayoutScanJunkBinding>() { ...@@ -70,7 +69,6 @@ class ScanJunkActivity : BaseActivity<ActivityLayoutScanJunkBinding>() {
} }
private fun playLottie() { private fun playLottie() {
startAnimation()
binding.idJunkScan.imageAssetsFolder = "easy_junk_scan/images/" binding.idJunkScan.imageAssetsFolder = "easy_junk_scan/images/"
binding.idJunkScan.setAnimation("easy_junk_scan/data.json") binding.idJunkScan.setAnimation("easy_junk_scan/data.json")
binding.idJunkScan.playAnimation() binding.idJunkScan.playAnimation()
...@@ -86,38 +84,4 @@ class ScanJunkActivity : BaseActivity<ActivityLayoutScanJunkBinding>() { ...@@ -86,38 +84,4 @@ class ScanJunkActivity : BaseActivity<ActivityLayoutScanJunkBinding>() {
private var animator1: ValueAnimator? = null private var animator1: ValueAnimator? = null
private var animator2: ValueAnimator? = null private var animator2: ValueAnimator? = null
private var animator3: ValueAnimator? = null private var animator3: ValueAnimator? = null
private fun startAnimation() {
animator1 = ValueAnimator.ofFloat(0f, 360f).apply {
duration = 1000
repeatMode = ValueAnimator.RESTART
repeatCount = ValueAnimator.INFINITE
interpolator = LinearInterpolator()
addUpdateListener {
binding.idView1.rotation = it.animatedValue as Float
}
start()
}
animator2 = ValueAnimator.ofFloat(0f, 360f).apply {
duration = 1000
repeatMode = ValueAnimator.RESTART
repeatCount = ValueAnimator.INFINITE
interpolator = LinearInterpolator()
addUpdateListener {
binding.idView2.rotation = it.animatedValue as Float
}
start()
}
animator3 = ValueAnimator.ofFloat(0f, 360f).apply {
duration = 1000
repeatMode = ValueAnimator.RESTART
repeatCount = ValueAnimator.INFINITE
interpolator = LinearInterpolator()
addUpdateListener {
binding.idView3.rotation = it.animatedValue as Float
}
start()
}
}
} }
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
...@@ -29,7 +30,8 @@ ...@@ -29,7 +30,8 @@
android:text="Clean Junk" android:text="Clean Junk"
android:textColor="#333333" android:textColor="#333333"
android:textSize="18sp" android:textSize="18sp"
android:textStyle="bold" /> android:textStyle="bold"
tools:ignore="HardcodedText" />
</RelativeLayout> </RelativeLayout>
...@@ -55,86 +57,12 @@ ...@@ -55,86 +57,12 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:text="Scanning..." android:layout_marginBottom="150dp"
android:text="Wait a moment..."
android:textColor="#666666" android:textColor="#666666"
android:textSize="16sp" /> android:textSize="16sp"
tools:ignore="HardcodedText" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginBottom="75dp"
android:gravity="center_horizontal">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/id_view1"
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/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/cleantu3" />
</FrameLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat> </androidx.appcompat.widget.LinearLayoutCompat>
......
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