From 8bdeca006eb9a97eda81a5dc39559308f94f09c8 Mon Sep 17 00:00:00 2001 From: Mady Mellor Date: Wed, 20 Feb 2019 18:34:24 -0800 Subject: [PATCH] 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 --- packages/SystemUI/src/com/android/systemui/SwipeHelper.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java index 9efa656b3ed3..60e6083790dc 100644 --- a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java +++ b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java @@ -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(); } -- 2.11.0