diff options
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/SwipeHelper.java | 13 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/NotificationMenuRow.java | 4 |
2 files changed, 15 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java index 5a04108df807..8c4159abf061 100644 --- a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java +++ b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java @@ -462,11 +462,20 @@ public class SwipeHelper implements Gefingerpoken { int duration = SNAP_ANIM_LEN; anim.setDuration(duration); anim.addListener(new AnimatorListenerAdapter() { + boolean wasCancelled = false; + + @Override + public void onAnimationCancel(Animator animator) { + wasCancelled = true; + } + @Override public void onAnimationEnd(Animator animator) { mSnappingChild = false; - updateSwipeProgressFromOffset(animView, canBeDismissed); - mCallback.onChildSnappedBack(animView, targetLeft); + if (!wasCancelled) { + updateSwipeProgressFromOffset(animView, canBeDismissed); + mCallback.onChildSnappedBack(animView, targetLeft); + } } }); prepareSnapBackAnimation(animView, anim); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMenuRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMenuRow.java index 802925a315eb..7563fd1bf9bf 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMenuRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMenuRow.java @@ -317,6 +317,10 @@ public class NotificationMenuRow implements NotificationMenuRowPlugin, View.OnCl } private void dismiss(View animView, float velocity) { + if (mFadeAnimator != null) { + mFadeAnimator.cancel(); + } + mHandler.removeCallbacks(mCheckForDrag); mMenuSnappedTo = false; mDismissing = true; mSwipeHelper.dismiss(animView, velocity); |