Commit 6d534df0 authored by wanglei's avatar wanglei

[拆包]修改动画

parent 3d9c463a
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
...@@ -300,7 +300,6 @@ abstract class BaseActivity<VB : ViewBinding>( ...@@ -300,7 +300,6 @@ abstract class BaseActivity<VB : ViewBinding>(
) { ) {
if (isBackDisable) return if (isBackDisable) return
isBackDisable = true isBackDisable = true
...@@ -315,7 +314,6 @@ abstract class BaseActivity<VB : ViewBinding>( ...@@ -315,7 +314,6 @@ abstract class BaseActivity<VB : ViewBinding>(
val flAd: NativeParentView? = findViewById(R.id.include_flAd) val flAd: NativeParentView? = findViewById(R.id.include_flAd)
var tvProgress: AppCompatTextView? = findViewById(R.id.tv_progress) var tvProgress: AppCompatTextView? = findViewById(R.id.tv_progress)
val lottie: LottieAnimationView? = findViewById(R.id.lottie_animation) val lottie: LottieAnimationView? = findViewById(R.id.lottie_animation)
val llTrustlook: LinearLayout = findViewById(R.id.llTrustlook)
include?.let { include?.let {
it.visibility = View.VISIBLE it.visibility = View.VISIBLE
...@@ -331,27 +329,18 @@ abstract class BaseActivity<VB : ViewBinding>( ...@@ -331,27 +329,18 @@ abstract class BaseActivity<VB : ViewBinding>(
it.playAnimation() it.playAnimation()
} }
val lottieAnimation = {
when (lottieConfig) {
LottieEnum.CLEAN_LOTTIE -> {
lottie?.addAnimatorUpdateListener { animation -> lottie?.addAnimatorUpdateListener { animation ->
val value = animation.animatedValue as Float * 100 val value = animation.animatedValue as Float * 100
tvProgress?.text = "${value.toInt()}%" tvProgress?.text = "${value.toInt()}%"
if (value.toInt() == 100) { if (value.toInt() == 100) {
include?.visibility = View.GONE include?.visibility = View.GONE
actionFinsh.invoke() actionFinsh.invoke()
} }
} }
} }
else -> { val valueAnimation = {
if (lottieConfig == LottieEnum.MALWARE_SCAN) {
llTrustlook.visibility = View.VISIBLE
}
lifecycleScope.launch {
val durationTime = Random.Default.nextLong(3000, 4000) val durationTime = Random.Default.nextLong(3000, 4000)
ValueAnimator.ofInt(0, 100).apply { ValueAnimator.ofInt(0, 100).apply {
duration = durationTime duration = durationTime
...@@ -369,6 +358,16 @@ abstract class BaseActivity<VB : ViewBinding>( ...@@ -369,6 +358,16 @@ abstract class BaseActivity<VB : ViewBinding>(
}) })
}.start() }.start()
} }
when (lottieConfig) {
LottieEnum.CLEAN_LOTTIE -> {
lottieAnimation.invoke()
}
else -> {
lifecycleScope.launch {
valueAnimation.invoke()
}
} }
} }
...@@ -464,11 +463,18 @@ fun Activity.jumpAction(key: String) { ...@@ -464,11 +463,18 @@ fun Activity.jumpAction(key: String) {
enum class LottieEnum(val data: String, val images: String? = null, val isLoop: Boolean = true) { enum class LottieEnum(val data: String, val images: String? = null, val isLoop: Boolean = true) {
BATTERY_INFO_LOTTIE("battery_info/scan/data.json", "battery_info/scan/images", true),
BATTERY_INFO_LOTTIE("batteryinfoscan.json"),
SCREENSHOT_LOTTIE("screenshotsmanagerscan.json"),
UNINSTALL_APP_LOTTIE("appmanagerscan.json"),
SIMILAR_PHOTOS_LOTTIE("similar_photos/scan/data.json", "similar_photos/scan/images"),
CLEAN_LOTTIE("clean.json"), CLEAN_LOTTIE("clean.json"),
LARGE_FILE_LOTTIE("large_files/scan/data.json", "large_files/scan/images"), LARGE_FILE_LOTTIE("large_files/scan/data.json", "large_files/scan/images"),
SCREENSHOT_LOTTIE("screenshot/scan/data.json", "screenshot/scan/images"),
SIMILAR_PHOTOS_LOTTIE("similar_photos/scan/data.json", "similar_photos/scan/images"),
PHOTO_COMPRESSION_LOTTIE("photo_compression/scan/data.json", "photo_compression/scan/images"), PHOTO_COMPRESSION_LOTTIE("photo_compression/scan/data.json", "photo_compression/scan/images"),
MALWARE_SCAN("malware_scan/scan/data.json", "malware_scan/scan/images"), MALWARE_SCAN("malware_scan/scan/data.json", "malware_scan/scan/images"),
} }
......
...@@ -28,7 +28,7 @@ class AppUninstallActivity : BaseActivity<ActivityAppUninstallBinding>(ActivityA ...@@ -28,7 +28,7 @@ class AppUninstallActivity : BaseActivity<ActivityAppUninstallBinding>(ActivityA
binding.rv.adapter = adapter binding.rv.adapter = adapter
showAdAnimation(LottieEnum.SCREENSHOT_LOTTIE) { showAdAnimation(LottieEnum.UNINSTALL_APP_LOTTIE) {
} }
AdsMgr.showNative(binding.flAd, R.layout.layout_admob_native_custom) AdsMgr.showNative(binding.flAd, R.layout.layout_admob_native_custom)
...@@ -38,6 +38,7 @@ class AppUninstallActivity : BaseActivity<ActivityAppUninstallBinding>(ActivityA ...@@ -38,6 +38,7 @@ class AppUninstallActivity : BaseActivity<ActivityAppUninstallBinding>(ActivityA
override fun handleBackCallBack() { override fun handleBackCallBack() {
super.handleBackCallBack() super.handleBackCallBack()
} }
override fun initListener() { override fun initListener() {
super.initListener() super.initListener()
......
package com.base.appzxhy.ui.batteryinfo package com.base.appzxhy.ui.batteryinfo
import android.annotation.SuppressLint
import android.content.Intent import android.content.Intent
import android.content.IntentFilter import android.content.IntentFilter
import androidx.core.view.ViewCompat import androidx.core.view.ViewCompat
...@@ -35,6 +36,7 @@ class BatteryInfoActivity : BaseActivity<ActivityBatteryInfoBinding>(ActivityBat ...@@ -35,6 +36,7 @@ class BatteryInfoActivity : BaseActivity<ActivityBatteryInfoBinding>(ActivityBat
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
batteryReceiver?.let { unregisterReceiver(batteryReceiver) } batteryReceiver?.let { unregisterReceiver(batteryReceiver) }
R.id.layout_animation
} }
override fun useDefaultImmersive() { override fun useDefaultImmersive() {
...@@ -81,6 +83,7 @@ class BatteryInfoActivity : BaseActivity<ActivityBatteryInfoBinding>(ActivityBat ...@@ -81,6 +83,7 @@ class BatteryInfoActivity : BaseActivity<ActivityBatteryInfoBinding>(ActivityBat
} }
// @SuppressLint("SetTextI18n") // @SuppressLint("SetTextI18n")
@SuppressLint("SetTextI18n")
private fun updateBatteryInfo() { private fun updateBatteryInfo() {
val percent = BatteryReceiver.level / BatteryReceiver.scale.toFloat() val percent = BatteryReceiver.level / BatteryReceiver.scale.toFloat()
val remainingCapacity = BatteryReceiver.mAh * percent val remainingCapacity = BatteryReceiver.mAh * percent
......
...@@ -2,6 +2,7 @@ package com.base.appzxhy.ui.dialog ...@@ -2,6 +2,7 @@ package com.base.appzxhy.ui.dialog
import android.animation.ValueAnimator import android.animation.ValueAnimator
import android.app.Activity import android.app.Activity
import android.view.Gravity
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.animation.LinearInterpolator import android.view.animation.LinearInterpolator
...@@ -27,13 +28,14 @@ class AppExitDialog(val activity: Activity) { ...@@ -27,13 +28,14 @@ class AppExitDialog(val activity: Activity) {
dialog.show() dialog.show()
val params = dialog.window?.attributes val params = dialog.window?.attributes
// params?.width = ConstraintLayout.LayoutParams.MATCH_PARENT params?.width = ConstraintLayout.LayoutParams.MATCH_PARENT
params?.width = activity.resources.getDimensionPixelSize(R.dimen.dp_295) // params?.width = activity.resources.getDimensionPixelSize(R.dimen.dp_295)
params?.height = ConstraintLayout.LayoutParams.WRAP_CONTENT params?.height = ConstraintLayout.LayoutParams.WRAP_CONTENT
// params?.gravity = Gravity.BOTTOM params?.gravity = Gravity.CENTER
dialog.window?.attributes = params dialog.window?.attributes = params
dialog.window?.setBackgroundDrawableResource(android.R.color.transparent) dialog.window?.setBackgroundDrawableResource(android.R.color.transparent)
val exit = activity.getString(R.string.exit) val exit = activity.getString(R.string.exit)
ValueAnimator.ofInt(0, 3).apply { ValueAnimator.ofInt(0, 3).apply {
duration = 3000 duration = 3000
......
...@@ -34,7 +34,6 @@ import pokercc.android.expandablerecyclerview.ExpandableAdapter ...@@ -34,7 +34,6 @@ import pokercc.android.expandablerecyclerview.ExpandableAdapter
class ScreenshotCleanActivity : BaseActivity<ActivityScreenshotCleanBinding>(ActivityScreenshotCleanBinding::inflate) { class ScreenshotCleanActivity : BaseActivity<ActivityScreenshotCleanBinding>(ActivityScreenshotCleanBinding::inflate) {
private var list = mutableListOf<FileBean>() private var list = mutableListOf<FileBean>()
private var isSelectAll = false private var isSelectAll = false
private var total: Long = 0 private var total: Long = 0
...@@ -125,7 +124,6 @@ class ScreenshotCleanActivity : BaseActivity<ActivityScreenshotCleanBinding>(Act ...@@ -125,7 +124,6 @@ class ScreenshotCleanActivity : BaseActivity<ActivityScreenshotCleanBinding>(Act
updateView(selectedFiles.isNotEmpty()) updateView(selectedFiles.isNotEmpty())
} }
private fun updateView(isSelection: Boolean) { private fun updateView(isSelection: Boolean) {
binding.ivSelectAll.isSelected = isSelectAll binding.ivSelectAll.isSelected = isSelectAll
...@@ -222,4 +220,5 @@ class ScreenshotCleanActivity : BaseActivity<ActivityScreenshotCleanBinding>(Act ...@@ -222,4 +220,5 @@ class ScreenshotCleanActivity : BaseActivity<ActivityScreenshotCleanBinding>(Act
return if (expandableAdapter.isGroup(viewType)) spanCount else 1 return if (expandableAdapter.isGroup(viewType)) spanCount else 1
} }
} }
} }
\ No newline at end of file
...@@ -183,7 +183,6 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>(ActivitySplashBinding ...@@ -183,7 +183,6 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>(ActivitySplashBinding
val acAction = { val acAction = {
initUMP { initUMP {
return@initUMP
LogEx.logDebug(TAG, "initUMP callback") LogEx.logDebug(TAG, "initUMP callback")
AdsMgr.showOpen(this, showCallBack = object : AdsShowCallBack() { AdsMgr.showOpen(this, showCallBack = object : AdsShowCallBack() {
......
...@@ -153,7 +153,8 @@ ...@@ -153,7 +153,8 @@
<include <include
android:id="@+id/layout_animation" android:id="@+id/layout_animation"
layout="@layout/layout_animation" layout="@layout/layout_animation_2"
android:visibility="gone" /> android:visibility="visible"
tools:visibility="invisible" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
...@@ -571,7 +571,7 @@ ...@@ -571,7 +571,7 @@
<include <include
android:id="@+id/layout_animation" android:id="@+id/layout_animation"
layout="@layout/layout_animation" layout="@layout/layout_animation_2"
android:visibility="visible" android:visibility="visible"
tools:visibility="invisible" /> tools:visibility="invisible" />
......
...@@ -28,7 +28,8 @@ ...@@ -28,7 +28,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_8" android:layout_marginStart="@dimen/dp_8"
android:padding="@dimen/dp_8" android:padding="@dimen/dp_8"
android:src="@drawable/icon_return_w" /> android:src="@drawable/icon_return_w"
tools:ignore="ImageContrastCheck" />
<androidx.appcompat.widget.AppCompatTextView <androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -37,7 +38,8 @@ ...@@ -37,7 +38,8 @@
android:text="@string/screenshot_clean" android:text="@string/screenshot_clean"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="20sp" android:textSize="20sp"
android:textStyle="bold" /> android:textStyle="bold"
tools:ignore="TextContrastCheck" />
</FrameLayout> </FrameLayout>
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
...@@ -59,7 +61,7 @@ ...@@ -59,7 +61,7 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
tools:ignore="HardcodedText" /> tools:ignore="HardcodedText,TextContrastCheck" />
<androidx.appcompat.widget.AppCompatTextView <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_unit" android:id="@+id/tv_unit"
...@@ -129,12 +131,14 @@ ...@@ -129,12 +131,14 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/expandable_files" app:layout_constraintTop_toTopOf="@id/expandable_files"
app:layout_constraintVertical_bias="0.2" app:layout_constraintVertical_bias="0.2"
tools:ignore="TextSizeCheck"
tools:visibility="visible"> tools:visibility="visible">
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:src="@drawable/img_queshengye" /> android:src="@drawable/img_queshengye"
tools:ignore="ImageContrastCheck" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -142,7 +146,8 @@ ...@@ -142,7 +146,8 @@
android:layout_marginTop="@dimen/dp_18" android:layout_marginTop="@dimen/dp_18"
android:text="@string/content_not_found" android:text="@string/content_not_found"
android:textColor="#AEB4BD" android:textColor="#AEB4BD"
android:textSize="@dimen/sp_14" /> android:textSize="@dimen/sp_14"
tools:ignore="TextContrastCheck" />
</LinearLayout> </LinearLayout>
<androidx.appcompat.widget.LinearLayoutCompat <androidx.appcompat.widget.LinearLayoutCompat
...@@ -196,6 +201,7 @@ ...@@ -196,6 +201,7 @@
<include <include
android:id="@+id/layout_animation" android:id="@+id/layout_animation"
layout="@layout/layout_animation" layout="@layout/layout_animation_2"
android:visibility="gone" /> android:visibility="gone" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_8" android:layout_marginTop="@dimen/dp_8"
android:text="@string/app_name" android:text="@string/app_name"
android:textColor="@color/black" android:textColor="@color/white"
android:textSize="20sp" android:textSize="20sp"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
......
<?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"
android:layout_width="@dimen/dp_330" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/dp_40">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_top" android:id="@+id/cl_top"
...@@ -68,7 +69,7 @@ ...@@ -68,7 +69,7 @@
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:layout_marginEnd="4dp" android:layout_marginEnd="4dp"
android:background="#F2F3F6" android:background="@drawable/bg_stroke_999999_50"
android:paddingVertical="10dp" android:paddingVertical="10dp"
android:text="@string/exit" android:text="@string/exit"
android:textAlignment="center" android:textAlignment="center"
...@@ -87,7 +88,7 @@ ...@@ -87,7 +88,7 @@
android:layout_marginStart="@dimen/dp_8" android:layout_marginStart="@dimen/dp_8"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:background="@drawable/bg_68d2ff_0456ed" android:background="@drawable/bg_btn_50"
android:paddingVertical="10dp" android:paddingVertical="10dp"
android:text="@string/clean_now" android:text="@string/clean_now"
android:textAlignment="center" android:textAlignment="center"
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimary">
<androidx.constraintlayout.widget.Guideline
android:id="@+id/gl_line"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.1" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_animation"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@id/include_flAd"
app:layout_constraintTop_toBottomOf="@id/gl_line">
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/lottie_animation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:lottie_autoPlay="true"
app:lottie_loop="true" />
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_30"
android:orientation="vertical"
app:layout_constraintBottom_toTopOf="@id/include_flAd">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_progress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingVertical="2dp"
android:text="0%"
android:textAlignment="center"
android:textColor="@color/white"
android:textSize="30sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/please_wait"
android:textAlignment="center"
android:textColor="@color/white"
android:textSize="14sp" />
</LinearLayout>
<com.base.appzxhy.business.ads.NativeParentView
android:id="@+id/include_flAd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/color_f0f0f0"
app:layout_constraintBottom_toBottomOf="parent">
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/zhanwei1" />
</com.base.appzxhy.business.ads.NativeParentView>
</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