summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2017-04-19 18:42:31 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2017-04-19 18:42:35 +0000
commit043ae355e93010e21dcc341cb26b496e383bd80b (patch)
tree5675cb4eef4e67fb682b008fd0a2c90aafe3af1f
parentc1d9cdfe79edb9710e5ceb40a6ea53453b3a923e (diff)
parent7a5b2b6d382cd8f9a081989ceab7a63ce9eee4d0 (diff)
Merge "Fix issue where the notification could snap to the menu while its invisible" into oc-dev
-rw-r--r--packages/SystemUI/src/com/android/systemui/SwipeHelper.java13
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/NotificationMenuRow.java4
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);