From df949e401bc3a4a7bc4b9e1156a81c41816e1653 Mon Sep 17 00:00:00 2001 From: Matt Pietal Date: Fri, 19 Feb 2021 12:45:28 -0500 Subject: [PATCH] Password bouncer - Fix IME with no view It is not required for an IME to have a visible view. In this case, provide a default animation to reveal the textview. If an incoming call starts to animate for the IME, cancel the default animation and proceed from where it left off. Fixes: 180298552 Test: manual Change-Id: I65bfc14554652e4f05971c2b280efa6490a72504 --- .../com/android/keyguard/KeyguardPasswordView.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java index 92b65b242b0e9..533bec14f60ad 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java @@ -136,14 +136,23 @@ public class KeyguardPasswordView extends KeyguardAbsKeyInputView { @Override public void startAppearAnimation() { - // Reset state, and let IME animation reveal the view as it slides in + // Reset state, and let IME animation reveal the view as it slides in, if one exists. + // It is possible for an IME to have no view, so provide a default animation since no + // calls to animateForIme would occur setAlpha(0f); + animate() + .alpha(1f) + .setDuration(500) + .setStartDelay(300) + .start(); + setTranslationY(0f); } @Override public void animateForIme(float interpolatedFraction) { - setAlpha(interpolatedFraction); + animate().cancel(); + setAlpha(Math.max(interpolatedFraction, getAlpha())); } @Override