Loading packages/SystemUI/src/com/android/systemui/SwipeHelper.java +7 −7 Original line number Diff line number Diff line Loading @@ -325,10 +325,11 @@ public class SwipeHelper implements Gefingerpoken { /** * @param view The view to be dismissed * @param velocity The desired pixels/second speed at which the view should move * @param useAccelerateInterpolator Should an accelerating Interpolator be used */ public void dismissChild(final View view, float velocity) { public void dismissChild(final View view, float velocity, boolean useAccelerateInterpolator) { dismissChild(view, velocity, null /* endAction */, 0 /* delay */, velocity == 0 /* useAccelerateInterpolator */, 0 /* fixedDuration */); useAccelerateInterpolator, 0 /* fixedDuration */); } /** Loading Loading @@ -569,7 +570,8 @@ public class SwipeHelper implements Gefingerpoken { if (!handleUpEvent(ev, mCurrView, velocity, getTranslation(mCurrView))) { if (isDismissGesture(ev)) { // flingadingy dismissChild(mCurrView, swipedFastEnough() ? velocity : 0f); dismissChild(mCurrView, velocity, !swipedFastEnough() /* useAccelerateInterpolator */); } else { // snappity mCallback.onDragCancelled(mCurrView); Loading Loading @@ -615,11 +617,9 @@ public class SwipeHelper implements Gefingerpoken { protected boolean swipedFastEnough() { float velocity = getVelocity(mVelocityTracker); float perpendicularVelocity = getPerpendicularVelocity(mVelocityTracker); float translation = getTranslation(mCurrView); boolean ret = (Math.abs(velocity) > getEscapeVelocity()) && (Math.abs(velocity) > Math.abs(perpendicularVelocity)) && (velocity > 0) == (translation > 0); boolean ret = (Math.abs(velocity) > getEscapeVelocity()) && (velocity > 0) == (translation > 0); return ret; } Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +7 −4 Original line number Diff line number Diff line Loading @@ -3548,8 +3548,9 @@ public class NotificationStackScrollLayout extends ViewGroup } @Override public void dismissChild(final View view, float velocity) { super.dismissChild(view, velocity); public void dismissChild(final View view, float velocity, boolean useAccelerateInterpolator) { super.dismissChild(view, velocity, useAccelerateInterpolator); cancelCheckForDrag(); setSnappedToGear(false); } Loading Loading @@ -3585,7 +3586,8 @@ public class NotificationStackScrollLayout extends ViewGroup snapChild(animView, 0 /* leftTarget */, velocity); } else if (isDismissGesture(ev)) { // Gesture is a dismiss that's not towards the gear dismissChild(animView, swipedFastEnough() ? velocity : 0f); dismissChild(animView, velocity, !swipedFastEnough() /* useAccelerateInterpolator */); } else { // Didn't move enough to dismiss or cover, snap to the gear snapToGear(animView, velocity); Loading @@ -3610,7 +3612,8 @@ public class NotificationStackScrollLayout extends ViewGroup private void dismissOrSnapBack(View animView, float velocity, MotionEvent ev) { if (isDismissGesture(ev)) { dismissChild(animView, swipedFastEnough() ? velocity : 0f); dismissChild(animView, velocity, !swipedFastEnough() /* useAccelerateInterpolator */); } else { snapChild(animView, 0 /* leftTarget */, velocity); } Loading Loading
packages/SystemUI/src/com/android/systemui/SwipeHelper.java +7 −7 Original line number Diff line number Diff line Loading @@ -325,10 +325,11 @@ public class SwipeHelper implements Gefingerpoken { /** * @param view The view to be dismissed * @param velocity The desired pixels/second speed at which the view should move * @param useAccelerateInterpolator Should an accelerating Interpolator be used */ public void dismissChild(final View view, float velocity) { public void dismissChild(final View view, float velocity, boolean useAccelerateInterpolator) { dismissChild(view, velocity, null /* endAction */, 0 /* delay */, velocity == 0 /* useAccelerateInterpolator */, 0 /* fixedDuration */); useAccelerateInterpolator, 0 /* fixedDuration */); } /** Loading Loading @@ -569,7 +570,8 @@ public class SwipeHelper implements Gefingerpoken { if (!handleUpEvent(ev, mCurrView, velocity, getTranslation(mCurrView))) { if (isDismissGesture(ev)) { // flingadingy dismissChild(mCurrView, swipedFastEnough() ? velocity : 0f); dismissChild(mCurrView, velocity, !swipedFastEnough() /* useAccelerateInterpolator */); } else { // snappity mCallback.onDragCancelled(mCurrView); Loading Loading @@ -615,11 +617,9 @@ public class SwipeHelper implements Gefingerpoken { protected boolean swipedFastEnough() { float velocity = getVelocity(mVelocityTracker); float perpendicularVelocity = getPerpendicularVelocity(mVelocityTracker); float translation = getTranslation(mCurrView); boolean ret = (Math.abs(velocity) > getEscapeVelocity()) && (Math.abs(velocity) > Math.abs(perpendicularVelocity)) && (velocity > 0) == (translation > 0); boolean ret = (Math.abs(velocity) > getEscapeVelocity()) && (velocity > 0) == (translation > 0); return ret; } Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +7 −4 Original line number Diff line number Diff line Loading @@ -3548,8 +3548,9 @@ public class NotificationStackScrollLayout extends ViewGroup } @Override public void dismissChild(final View view, float velocity) { super.dismissChild(view, velocity); public void dismissChild(final View view, float velocity, boolean useAccelerateInterpolator) { super.dismissChild(view, velocity, useAccelerateInterpolator); cancelCheckForDrag(); setSnappedToGear(false); } Loading Loading @@ -3585,7 +3586,8 @@ public class NotificationStackScrollLayout extends ViewGroup snapChild(animView, 0 /* leftTarget */, velocity); } else if (isDismissGesture(ev)) { // Gesture is a dismiss that's not towards the gear dismissChild(animView, swipedFastEnough() ? velocity : 0f); dismissChild(animView, velocity, !swipedFastEnough() /* useAccelerateInterpolator */); } else { // Didn't move enough to dismiss or cover, snap to the gear snapToGear(animView, velocity); Loading @@ -3610,7 +3612,8 @@ public class NotificationStackScrollLayout extends ViewGroup private void dismissOrSnapBack(View animView, float velocity, MotionEvent ev) { if (isDismissGesture(ev)) { dismissChild(animView, swipedFastEnough() ? velocity : 0f); dismissChild(animView, velocity, !swipedFastEnough() /* useAccelerateInterpolator */); } else { snapChild(animView, 0 /* leftTarget */, velocity); } Loading