diff options
author | Mady Mellor <madym@google.com> | 2015-06-03 16:46:42 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-06-03 16:46:43 +0000 |
commit | 5dd1487da69062a0f40743d7a8df042440b85e9a (patch) | |
tree | 80d177028874cd99f2e2b9e22cf0b4279d966f64 /src/com | |
parent | 19b1bad23904a899bd9dc56bf9e2e827619164b1 (diff) | |
parent | 770f7c590753219d38f957278488b5b3f05e70ec (diff) | |
download | android_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/com')
-rw-r--r-- | src/com/android/launcher3/LauncherAppWidgetHostView.java | 14 |
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; } |