Use fling animation utils for snapChild

Test: manual - swipe open and close the menu beneath the notification shade
      ensure the motion follows finger
Bug: 124097982

Change-Id: I446932d52ccd0d0055d0e37641d9c40c1bd61bd2
This commit is contained in:
Mady Mellor
2019-02-20 18:34:24 -08:00
parent a54cb88d01
commit 8bdeca006e

View File

@@ -474,8 +474,6 @@ public class SwipeHelper implements Gefingerpoken {
if (anim == null) {
return;
}
int duration = SNAP_ANIM_LEN;
anim.setDuration(duration);
anim.addListener(new AnimatorListenerAdapter() {
boolean wasCancelled = false;
@@ -495,6 +493,9 @@ public class SwipeHelper implements Gefingerpoken {
});
prepareSnapBackAnimation(animView, anim);
mSnappingChild = true;
float maxDistance = Math.abs(targetLeft - getTranslation(animView));
mFlingAnimationUtils.apply(anim, getTranslation(animView), targetLeft, velocity,
maxDistance);
anim.start();
}