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
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java
index 03d9eb3..a9910a1 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java
@@ -189,17 +189,18 @@
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