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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/SnapScrollController.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/SnapScrollController.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/SnapScrollController.java b/content/public/android/java/src/org/chromium/content/browser/SnapScrollController.java
index 68a6c02febdefd5fcbeefbb9f82bed30d377c07a..99a8b5c0b1563892a095ce3699c0fa06b62394b9 100644
--- a/content/public/android/java/src/org/chromium/content/browser/SnapScrollController.java
+++ b/content/public/android/java/src/org/chromium/content/browser/SnapScrollController.java
@@ -24,11 +24,9 @@ class SnapScrollController {
private int mFirstTouchY = -1;
private float mDistanceX = 0;
private float mDistanceY = 0;
- private ZoomManager mZoomManager;
- SnapScrollController(Context context, ZoomManager zoomManager) {
+ SnapScrollController(Context context) {
calculateChannelDistance(context);
- mZoomManager = zoomManager;
}
/**
@@ -63,7 +61,7 @@ class SnapScrollController {
* Sets the snap scroll mode based on the event type.
* @param event The received MotionEvent.
*/
- void setSnapScrollingMode(MotionEvent event) {
+ void setSnapScrollingMode(MotionEvent event, boolean isScaleGestureDetectionInProgress) {
switch(event.getAction()) {
case MotionEvent.ACTION_DOWN:
mSnapScrollMode = SNAP_NONE;
@@ -76,7 +74,7 @@ class SnapScrollController {
// and movement towards x-axis is trivial.
// Scrolling mode will remain in SNAP_NONE for other conditions.
case MotionEvent.ACTION_MOVE:
- if (!mZoomManager.isScaleGestureDetectionInProgress() &&
+ if (!isScaleGestureDetectionInProgress &&
mSnapScrollMode == SNAP_NONE) {
int xDiff = (int) Math.abs(event.getX() - mFirstTouchX);
int yDiff = (int) Math.abs(event.getY() - mFirstTouchY);

Powered by Google App Engine
This is Rietveld 408576698