Merge "Cancelling long press on widgets if they don't handle touch/tap." into jb-ub-gel-agar
diff --git a/src/com/android/launcher3/LauncherAppWidgetHostView.java b/src/com/android/launcher3/LauncherAppWidgetHostView.java
index 6157a87..faec8b6 100644
--- a/src/com/android/launcher3/LauncherAppWidgetHostView.java
+++ b/src/com/android/launcher3/LauncherAppWidgetHostView.java
@@ -87,6 +87,18 @@
return false;
}
+ public boolean onTouchEvent(MotionEvent ev) {
+ // If the widget does not handle touch, then cancel
+ // long press when we release the touch
+ switch (ev.getAction()) {
+ case MotionEvent.ACTION_UP:
+ case MotionEvent.ACTION_CANCEL:
+ mLongPressHelper.cancelLongPress();
+ break;
+ }
+ return false;
+ }
+
@Override
public void cancelLongPress() {
super.cancelLongPress();