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