diff options
| author | 2019-01-04 15:13:21 -0500 | |
|---|---|---|
| committer | 2019-01-04 15:13:21 -0500 | |
| commit | fe15aa1f9fb43cdd63a1e9fb17dec4ef98b4ccbf (patch) | |
| tree | 99e3fd6b73c4caf066eb3b87589d6b5e6fcb5139 | |
| parent | 22b99b471c115add9d09ac82b85b9939aacb5e24 (diff) | |
Fixes notification swipe snapping when menu is empty.
This change modifies the swipe handling logic in NotificationSwipeHelper
such that it doesn't attempt to snap to the "menu open" state when the
menu is zero width (i.e. it's snapping on a left-to-right gesture and
the menu is only enabled for right-to-left swipes). This prevents us
from getting in to a state where the menu was considered "open" when it
wasn't, which caused the next gesture to be handled incorrectly.
Change-Id: I3b78e95de7266e5a469637007ca78f7af2caab49
Fixes: 121077588
Test: manually
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSwipeHelper.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSwipeHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSwipeHelper.java index f1d9549b9284..975aee51228b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSwipeHelper.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSwipeHelper.java @@ -189,10 +189,13 @@ class NotificationSwipeHelper extends SwipeHelper boolean isFastNonDismissGesture = gestureFastEnough && !gestureTowardsMenu && !isDismissGesture; boolean isMenuRevealingGestureAwayFromMenu = slowSwipedFarEnough || isFastNonDismissGesture; - if (isNonDismissGestureTowardsMenu - || (!isFalseGesture(ev) && isMenuRevealingGestureAwayFromMenu)) { + int menuSnapTarget = menuRow.getMenuSnapTarget(); + boolean isNonFalseMenuRevealingGesture = + !isFalseGesture(ev) && isMenuRevealingGestureAwayFromMenu; + if ((isNonDismissGestureTowardsMenu || isNonFalseMenuRevealingGesture) + && menuSnapTarget != 0) { // Menu has not been snapped to previously and this is menu revealing gesture - snapOpen(animView, menuRow.getMenuSnapTarget(), velocity); + snapOpen(animView, menuSnapTarget, velocity); menuRow.onSnapOpen(); } else if (isDismissGesture(ev) && !gestureTowardsMenu) { dismiss(animView, velocity); |