summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorim Jaggi <jjaggi@google.com>2014-08-05 22:03:07 +0200
committerJorim Jaggi <jjaggi@google.com>2014-08-05 23:01:34 +0000
commit28f0e5932944d9abc4b6879b1d05523e9341c385 (patch)
tree51d727bf162e68b848c8a0b4a86712f4a75a0915
parentce0c13a169931e757b98d0f40239c508caa237bd (diff)
downloadframeworks_base-28f0e5932944d9abc4b6879b1d05523e9341c385.zip
frameworks_base-28f0e5932944d9abc4b6879b1d05523e9341c385.tar.gz
frameworks_base-28f0e5932944d9abc4b6879b1d05523e9341c385.tar.bz2
Edge swipes should also dismiss notifications
To prevent falsing with phone/camera affordance. Bug: 16571057 Change-Id: I5da5efc5529af8211357b556f1db4858e8775e05
-rw-r--r--packages/SystemUI/src/com/android/systemui/SwipeHelper.java17
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java7
3 files changed, 19 insertions, 7 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java
index 6c30c89..a18b0c0 100644
--- a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java
@@ -384,10 +384,19 @@ public class SwipeHelper implements Gefingerpoken {
}
if (!mDragging) {
- // We are not doing anything, make sure the long press callback
- // is not still ticking like a bomb waiting to go off.
- removeLongPressCallback();
- return false;
+ if (mCallback.getChildAtPosition(ev) != null) {
+
+ // We are dragging directly over a card, make sure that we also catch the gesture
+ // even if nobody else wants the touch event.
+ onInterceptTouchEvent(ev);
+ return true;
+ } else {
+
+ // We are not doing anything, make sure the long press callback
+ // is not still ticking like a bomb waiting to go off.
+ removeLongPressCallback();
+ return false;
+ }
}
mVelocityTracker.addMovement(ev);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java
index 9cc559f..20ffba2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java
@@ -98,7 +98,7 @@ public class KeyguardAffordanceHelper {
private void initDimens() {
final ViewConfiguration configuration = ViewConfiguration.get(mContext);
- mTouchSlop = configuration.getScaledTouchSlop();
+ mTouchSlop = configuration.getScaledPagingTouchSlop();
mMinFlingVelocity = configuration.getScaledMinimumFlingVelocity();
mMinTranslationAmount = mContext.getResources().getDimensionPixelSize(
R.dimen.keyguard_min_swipe_amount);
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 fcca5fa..8719b06 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
@@ -568,8 +568,11 @@ public class NotificationStackScrollLayout extends ViewGroup
float childTop = slidingChild.getTranslationY();
float top = childTop + slidingChild.getClipTopAmount();
float bottom = top + slidingChild.getActualHeight();
- int left = slidingChild.getLeft();
- int right = slidingChild.getRight();
+
+ // Allow the full width of this view to prevent gesture conflict on Keyguard (phone and
+ // camera affordance).
+ int left = 0;
+ int right = getWidth();
if (touchY >= top && touchY <= bottom && touchX >= left && touchX <= right) {
return slidingChild;