diff options
| author | 2025-02-18 15:06:50 -0800 | |
|---|---|---|
| committer | 2025-02-18 15:06:50 -0800 | |
| commit | c43b86f0f09cf2b99987bafbb55866e85023bf27 (patch) | |
| tree | 480aadda91c009e6ee21ccce56b269f465cd6164 /libs | |
| parent | db87c35868cc2f4cafbf4855387b7422ec0b4cc0 (diff) | |
| parent | 65efd02809bc2caa9343d5366f6079d3b10f4087 (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.kt | 10 |
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() |