From 6883edae21f61aacbad6efb925d2d920015e9243 Mon Sep 17 00:00:00 2001 From: Aaron Liu Date: Thu, 3 Aug 2023 09:11:16 -0700 Subject: [PATCH] Refine password disappear animation. In the disappear animation, tie alpha of the view to animated value. Before this fix, the view alpha is 1 until the animation is complete and looks janky. Fixes: 284436144 Test: unlock password with swipe up. Test: unlock password with tap on notificaiton. Test: unlock password with tap on settings from QS. Change-Id: Ide0e632df5f4f32ecdb5ab27d4435f3e3785eecc --- .../src/com/android/keyguard/KeyguardPasswordView.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java index 03d9eb3455fdb..a9910a128e13d 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java @@ -189,17 +189,18 @@ public class KeyguardPasswordView extends KeyguardAbsKeyInputView { if (controller.isCancelled()) { return; } + float value = (float) animation.getAnimatedValue(); + float fraction = anim.getAnimatedFraction(); Insets shownInsets = controller.getShownStateInsets(); int dist = (int) (-shownInsets.bottom / 4 - * anim.getAnimatedFraction()); + * fraction); Insets insets = Insets.add(shownInsets, Insets.of(0, 0, 0, dist)); if (mDisappearAnimationListener != null) { mDisappearAnimationListener.setTranslationY(-dist); } - controller.setInsetsAndAlpha(insets, - (float) animation.getAnimatedValue(), - anim.getAnimatedFraction()); + controller.setInsetsAndAlpha(insets, value, fraction); + setAlpha(value); }); anim.addListener(new AnimatorListenerAdapter() { @Override