Merge "Password bouncer - Fix IME with no view" into sc-dev am: ce4baef6ea

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13630527

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie98b1e87a807f4e432c208e3433d1a78725face9
This commit is contained in:
TreeHugger Robot
2021-02-22 15:05:25 +00:00
committed by Automerger Merge Worker

View File

@@ -136,14 +136,23 @@ public class KeyguardPasswordView extends KeyguardAbsKeyInputView {
@Override @Override
public void startAppearAnimation() { 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); setAlpha(0f);
animate()
.alpha(1f)
.setDuration(500)
.setStartDelay(300)
.start();
setTranslationY(0f); setTranslationY(0f);
} }
@Override @Override
public void animateForIme(float interpolatedFraction) { public void animateForIme(float interpolatedFraction) {
setAlpha(interpolatedFraction); animate().cancel();
setAlpha(Math.max(interpolatedFraction, getAlpha()));
} }
@Override @Override