Fixing animation jittering during swipe-up

AnimatorPlaybackController was using setCurrentPlayTime to control animation,
which converts progress (float) to duration (long) causing the progress to
loose accuracy.
Instead calling setCurrentFraction(float) on the target animation.

Bug: 155164803
Change-Id: I3e4c93c5a75a9ba16e80adee97229c974ffc86b1
This commit is contained in:
Sunny Goyal
2020-06-01 17:43:54 -07:00
parent 2a4dce1402
commit 341fa84c5e
2 changed files with 29 additions and 26 deletions

View File

@@ -70,7 +70,7 @@ public class PendingAnimation implements PropertySetter {
public void add(Animator a, SpringProperty springProperty) {
mAnim.play(a);
addAnimationHoldersRecur(a, springProperty, mAnimHolders);
addAnimationHoldersRecur(a, mDuration, springProperty, mAnimHolders);
}
public void finish(boolean isSuccess, int logAction) {
@@ -150,7 +150,7 @@ public class PendingAnimation implements PropertySetter {
}
if (mAnimHolders.isEmpty()) {
// Add a dummy animation to that the duration is respected
add(ValueAnimator.ofFloat(0, 1));
add(ValueAnimator.ofFloat(0, 1).setDuration(mDuration));
}
return mAnim;
}