diff options
author | Selim Cinek <cinek@google.com> | 2015-02-20 17:36:10 +0100 |
---|---|---|
committer | Selim Cinek <cinek@google.com> | 2015-03-12 16:02:54 -0700 |
commit | abf60bb20f5e84574b91747effcd675f596cbb1e (patch) | |
tree | aea0fd8c1c9a01c14f57342bdf00453483fed284 /packages/SystemUI | |
parent | 379ff8f6b18b236b679a59a2dc14c0baeede3bae (diff) | |
download | frameworks_base-abf60bb20f5e84574b91747effcd675f596cbb1e.zip frameworks_base-abf60bb20f5e84574b91747effcd675f596cbb1e.tar.gz frameworks_base-abf60bb20f5e84574b91747effcd675f596cbb1e.tar.bz2 |
Fixed a bug when clicking below notifications.
When clicking on the bottom stack in the locked shade,
a click might have triggered a returning to the keyguard
instead of being catched by the notification if the
dismissview was present.
Change-Id: I7c6c74c8c98bd8e67ac882f92c90e25ac50c008c
Diffstat (limited to 'packages/SystemUI')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java index d4fef9a..8c1f9bb 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java @@ -2410,21 +2410,32 @@ public class NotificationStackScrollLayout extends ViewGroup } private boolean isBelowLastNotification(float touchX, float touchY) { - ExpandableView lastChildNotGone = (ExpandableView) getLastChildNotGone(); - if (lastChildNotGone == null) { - return touchY > mIntrinsicPadding; - } - if (lastChildNotGone != mDismissView && lastChildNotGone != mEmptyShadeView) { - return touchY > lastChildNotGone.getY() + lastChildNotGone.getActualHeight(); - } else if (lastChildNotGone == mEmptyShadeView) { - return touchY > mEmptyShadeView.getY(); - } else { - float dismissY = mDismissView.getY(); - boolean belowDismissView = touchY > dismissY + mDismissView.getActualHeight(); - return belowDismissView || (touchY > dismissY - && mDismissView.isOnEmptySpace(touchX - mDismissView.getX(), - touchY - dismissY)); + int childCount = getChildCount(); + for (int i = childCount - 1; i >= 0; i--) { + ExpandableView child = (ExpandableView) getChildAt(i); + if (child.getVisibility() != View.GONE) { + float childTop = child.getY(); + if (childTop > touchY) { + // we are above a notification entirely let's abort + return false; + } + boolean belowChild = touchY > childTop + child.getActualHeight(); + if (child == mDismissView) { + if(!belowChild && !mDismissView.isOnEmptySpace(touchX - mDismissView.getX(), + touchY - childTop)) { + // We clicked on the dismiss button + return false; + } + } else if (child == mEmptyShadeView) { + // We arrived at the empty shade view, for which we accept all clicks + return true; + } else if (!belowChild){ + // We are on a child + return false; + } + } } + return touchY > mIntrinsicPadding; } public void setRemoveAnimationEnabled(boolean enabled) { |