Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9694)

Unified Diff: content/public/android/java/src/org/chromium/content/browser/third_party/GestureDetector.java

Issue 120513005: [Android] Perform eager gesture recognition on MotionEvents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More testing Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/public/android/java/src/org/chromium/content/browser/third_party/GestureDetector.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/third_party/GestureDetector.java b/content/public/android/java/src/org/chromium/content/browser/third_party/GestureDetector.java
index 3a52db4015a8f56f8b68f8c3cc3a5b6458158e83..70c65199db63c9dbeb73ea1b83af69ca796d687f 100644
--- a/content/public/android/java/src/org/chromium/content/browser/third_party/GestureDetector.java
+++ b/content/public/android/java/src/org/chromium/content/browser/third_party/GestureDetector.java
@@ -106,8 +106,9 @@ public class GestureDetector {
* that trigged it.
*
* @param e The initial on down motion event that started the longpress.
+ * @return true if the event is consumed, else false
*/
- void onLongPress(MotionEvent e);
+ boolean onLongPress(MotionEvent e);
/**
* Notified of a fling event when it occurs with the initial on down {@link MotionEvent}
@@ -172,7 +173,8 @@ public class GestureDetector {
return false;
}
- public void onLongPress(MotionEvent e) {
+ public boolean onLongPress(MotionEvent e) {
+ return false;
}
public boolean onScroll(MotionEvent e1, MotionEvent e2,
@@ -708,7 +710,10 @@ public class GestureDetector {
private void dispatchLongPress() {
mHandler.removeMessages(TAP);
mDeferConfirmSingleTap = false;
+/* Changed in Chromium to allow scrolling after a longpress.
mInLongPress = true;
mListener.onLongPress(mCurrentDownEvent);
+*/
+ mInLongPress = mListener.onLongPress(mCurrentDownEvent);
}
}

Powered by Google App Engine
This is Rietveld 408576698