diff options
author | Mady Mellor <madym@google.com> | 2015-05-11 17:28:45 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-05-11 17:28:46 +0000 |
commit | 15445a652bfca60d67fc95df8c80f529f8e42979 (patch) | |
tree | 827cd7c3d99736bdfcb76f57f0ee3c7214133b1c /packages/SystemUI | |
parent | b7c9b2259f1976e2fd25771aa9ca3dd8f3afa335 (diff) | |
parent | aaf32f69d69a966700acea5fdaa7dce95637cef5 (diff) | |
download | frameworks_base-15445a652bfca60d67fc95df8c80f529f8e42979.zip frameworks_base-15445a652bfca60d67fc95df8c80f529f8e42979.tar.gz frameworks_base-15445a652bfca60d67fc95df8c80f529f8e42979.tar.bz2 |
Merge "Provide a way for a stylus to access the quick settings menu" into mnc-dev
Diffstat (limited to 'packages/SystemUI')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java index f77ac4b..9ef9211 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -729,7 +729,8 @@ public class NotificationPanelView extends PanelView implements } private boolean handleQsTouch(MotionEvent event) { - if (event.getActionMasked() == MotionEvent.ACTION_DOWN && getExpandedFraction() == 1f + final int action = event.getActionMasked(); + if (action == MotionEvent.ACTION_DOWN && getExpandedFraction() == 1f && mStatusBar.getBarState() != StatusBarState.KEYGUARD && !mQsExpanded && mQsExpansionEnabled) { @@ -750,16 +751,21 @@ public class NotificationPanelView extends PanelView implements return true; } } - if (event.getActionMasked() == MotionEvent.ACTION_CANCEL - || event.getActionMasked() == MotionEvent.ACTION_UP) { + if (action == MotionEvent.ACTION_CANCEL || action == MotionEvent.ACTION_UP) { mConflictingQsExpansionGesture = false; } - if (event.getActionMasked() == MotionEvent.ACTION_DOWN && isFullyCollapsed() + if (action == MotionEvent.ACTION_DOWN && isFullyCollapsed() && mQsExpansionEnabled) { mTwoFingerQsExpandPossible = true; } - if (mTwoFingerQsExpandPossible && event.getActionMasked() == MotionEvent.ACTION_POINTER_DOWN - && event.getPointerCount() == 2 + final int pointerCount = event.getPointerCount(); + final boolean twoFingerDrag = action == MotionEvent.ACTION_POINTER_DOWN + && pointerCount == 2; + final boolean stylusClickDrag = action == MotionEvent.ACTION_DOWN + && pointerCount == 1 && event.getToolType(0) == MotionEvent.TOOL_TYPE_STYLUS + && (event.isButtonPressed(MotionEvent.BUTTON_SECONDARY) + || event.isButtonPressed(MotionEvent.BUTTON_TERTIARY)); + if (mTwoFingerQsExpandPossible && (twoFingerDrag || stylusClickDrag) && event.getY(event.getActionIndex()) < mStatusBarMinHeight) { MetricsLogger.count(mContext, COUNTER_PANEL_OPEN_QS, 1); mQsExpandImmediate = true; |