summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMady Mellor <madym@google.com>2015-06-03 16:46:42 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-06-03 16:46:43 +0000
commit5dd1487da69062a0f40743d7a8df042440b85e9a (patch)
tree80d177028874cd99f2e2b9e22cf0b4279d966f64 /src
parent19b1bad23904a899bd9dc56bf9e2e827619164b1 (diff)
parent770f7c590753219d38f957278488b5b3f05e70ec (diff)
downloadandroid_packages_apps_Trebuchet-5dd1487da69062a0f40743d7a8df042440b85e9a.tar.gz
android_packages_apps_Trebuchet-5dd1487da69062a0f40743d7a8df042440b85e9a.tar.bz2
android_packages_apps_Trebuchet-5dd1487da69062a0f40743d7a8df042440b85e9a.zip
Merge "Stylus support: handling drag n drop for widgets" into ub-launcher3-burnaby
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/LauncherAppWidgetHostView.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/com/android/launcher3/LauncherAppWidgetHostView.java b/src/com/android/launcher3/LauncherAppWidgetHostView.java
index 71fb2d295..cf461a5b8 100644
--- a/src/com/android/launcher3/LauncherAppWidgetHostView.java
+++ b/src/com/android/launcher3/LauncherAppWidgetHostView.java
@@ -36,6 +36,7 @@ public class LauncherAppWidgetHostView extends AppWidgetHostView implements Touc
LayoutInflater mInflater;
private CheckLongPressHelper mLongPressHelper;
+ private StylusEventHelper mStylusEventHelper;
private Context mContext;
private int mPreviousOrientation;
private DragLayer mDragLayer;
@@ -46,6 +47,7 @@ public class LauncherAppWidgetHostView extends AppWidgetHostView implements Touc
super(context);
mContext = context;
mLongPressHelper = new CheckLongPressHelper(this);
+ mStylusEventHelper = new StylusEventHelper(this);
mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mDragLayer = ((Launcher) context).getDragLayer();
setAccessibilityDelegate(LauncherAppState.getInstance().getAccessibilityDelegate());
@@ -89,11 +91,17 @@ public class LauncherAppWidgetHostView extends AppWidgetHostView implements Touc
return true;
}
- // Watch for longpress events at this level to make sure
- // users can always pick up this widget
+ // Watch for longpress or stylus button press events at this level to
+ // make sure users can always pick up this widget
+ if (mStylusEventHelper.checkAndPerformStylusEvent(ev)) {
+ mLongPressHelper.cancelLongPress();
+ return true;
+ }
switch (ev.getAction()) {
case MotionEvent.ACTION_DOWN: {
- mLongPressHelper.postCheckForLongPress();
+ if (!mStylusEventHelper.inStylusButtonPressed()) {
+ mLongPressHelper.postCheckForLongPress();
+ }
mDragLayer.setTouchCompleteListener(this);
break;
}