Final position of animation is independent of starting postiion.

Fixes: 134675849
Test: manual - bounce animation ends with 0 tranlationY
Change-Id: I1260122167f11c9cd93944f5fa19c738b7059ab4
This commit is contained in:
Robert Snoeberger
2019-06-21 16:41:46 -04:00
parent f80234a9b0
commit ddfb065cab

View File

@@ -81,6 +81,7 @@ public class KeyguardIndicationController implements StateListener,
private static final int MSG_CLEAR_BIOMETRIC_MSG = 2;
private static final int MSG_SWIPE_UP_TO_UNLOCK = 3;
private static final long TRANSIENT_BIOMETRIC_ERROR_TIMEOUT = 1300;
private static final float BOUNCE_ANIMATION_FINAL_Y = 0f;
private final Context mContext;
private final ShadeController mShadeController;
@@ -422,7 +423,6 @@ public class KeyguardIndicationController implements StateListener,
int animateDownDuration = mContext.getResources().getInteger(
R.integer.wired_charging_keyguard_text_animation_duration_down);
textView.animate().cancel();
float translation = textView.getTranslationY();
ViewClippingUtil.setClippingDeactivated(textView, true, mClippingParams);
textView.animate()
.translationYBy(yTranslation)
@@ -438,7 +438,7 @@ public class KeyguardIndicationController implements StateListener,
@Override
public void onAnimationCancel(Animator animation) {
textView.setTranslationY(translation);
textView.setTranslationY(BOUNCE_ANIMATION_FINAL_Y);
mCancelled = true;
}
@@ -452,15 +452,11 @@ public class KeyguardIndicationController implements StateListener,
textView.animate()
.setDuration(animateDownDuration)
.setInterpolator(Interpolators.BOUNCE)
.translationY(translation)
.translationY(BOUNCE_ANIMATION_FINAL_Y)
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationCancel(Animator animation) {
textView.setTranslationY(translation);
}
@Override
public void onAnimationEnd(Animator animation) {
textView.setTranslationY(BOUNCE_ANIMATION_FINAL_Y);
ViewClippingUtil.setClippingDeactivated(textView, false,
mClippingParams);
}