summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
author Maryam Dehaini <mdehaini@google.com> 2025-02-18 15:06:50 -0800
committer Android (Google) Code Review <android-gerrit@google.com> 2025-02-18 15:06:50 -0800
commitc43b86f0f09cf2b99987bafbb55866e85023bf27 (patch)
tree480aadda91c009e6ee21ccce56b269f465cd6164 /libs
parentdb87c35868cc2f4cafbf4855387b7422ec0b4cc0 (diff)
parent65efd02809bc2caa9343d5366f6079d3b10f4087 (diff)
Merge "Cancel icon animation when resize veil is released" into main
Diffstat (limited to 'libs')
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/ResizeVeil.kt10
1 files changed, 7 insertions, 3 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/ResizeVeil.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/ResizeVeil.kt
index 88cc94ca8728..7af6b8e26cbf 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/ResizeVeil.kt
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/ResizeVeil.kt
@@ -90,6 +90,7 @@ public class ResizeVeil @JvmOverloads constructor(
private var viewHost: SurfaceControlViewHost? = null
private var display: Display? = null
private var veilAnimator: ValueAnimator? = null
+ private var iconAnimator: ValueAnimator? = null
private var loadAppInfoJob: Job? = null
/**
@@ -241,7 +242,7 @@ public class ResizeVeil @JvmOverloads constructor(
}
})
}
- val iconAnimator = ValueAnimator.ofFloat(0f, 1f).apply {
+ iconAnimator = ValueAnimator.ofFloat(0f, 1f).apply {
duration = RESIZE_ALPHA_DURATION
addUpdateListener {
iconAnimT.setAlpha(icon, animatedValue as Float)
@@ -265,7 +266,7 @@ public class ResizeVeil @JvmOverloads constructor(
.hide(background)
.apply()
veilAnimator?.start()
- iconAnimator.start()
+ iconAnimator?.start()
} else {
// Show the veil immediately.
t.apply()
@@ -414,6 +415,10 @@ public class ResizeVeil @JvmOverloads constructor(
private fun cancelAnimation() {
veilAnimator?.removeAllUpdateListeners()
veilAnimator?.cancel()
+ veilAnimator = null
+ iconAnimator?.removeAllUpdateListeners()
+ iconAnimator?.cancel()
+ iconAnimator = null
}
/**
@@ -421,7 +426,6 @@ public class ResizeVeil @JvmOverloads constructor(
*/
fun dispose() {
cancelAnimation()
- veilAnimator = null
isVisible = false
loadAppInfoJob?.cancel()