summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI
diff options
context:
space:
mode:
authorMady Mellor <madym@google.com>2015-05-01 17:06:50 -0700
committerMady Mellor <madym@google.com>2015-05-01 17:06:50 -0700
commitaaf32f69d69a966700acea5fdaa7dce95637cef5 (patch)
treece5bad8b054e38d4b5ac46a1bd12fc48d4614f72 /packages/SystemUI
parent9a4cdf5caaccdc02d3439addfa19a32de18d2405 (diff)
downloadframeworks_base-aaf32f69d69a966700acea5fdaa7dce95637cef5.zip
frameworks_base-aaf32f69d69a966700acea5fdaa7dce95637cef5.tar.gz
frameworks_base-aaf32f69d69a966700acea5fdaa7dce95637cef5.tar.bz2
Provide a way for a stylus to access the quick settings menu
You can access quick settings with a 2 finger drag, this change allows a stylus to access quick settings using press either stylus button + drag. Bug: 19916487 Change-Id: I3887f12980fc1be3d5a966ad8cc67abe93545a2a
Diffstat (limited to 'packages/SystemUI')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java18
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 a8ecc42..42d805f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
@@ -706,7 +706,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) {
@@ -727,16 +728,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) {
mQsExpandImmediate = true;
requestPanelHeightUpdate();