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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorViewHolderBehavior.java

Issue 2526673004: [Android] Fix a bug where the suggestion list can't scroll (Closed)
Patch Set: mdjones@'s comments Created 4 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorViewHolderBehavior.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorViewHolderBehavior.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorViewHolderBehavior.java
index 4828d19ecdb44f302ea901eab9be8872006a077f..dd7fcc7bfa11c477c91187aa3782121573873f7a 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorViewHolderBehavior.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorViewHolderBehavior.java
@@ -40,7 +40,13 @@ public class CompositorViewHolderBehavior extends Behavior<View> {
@Override
public boolean onTouchEvent(CoordinatorLayout parent, View child, MotionEvent ev) {
- if (!mShouldIntercept) return false;
+ // If an ACTION_MOVE is dispatched to a ListView or a ScrollView and the ViewGroup
+ // intercepts it, the framework will generate an ACTION_CANCEL to the ViewGroup's children.
+ // This class, however, will steal this cancel event and send to the ViewGroup again,
+ // causing scroll to fail. Thus we should specifically not catch ACTION_CANCEL in behavior.
+ // In theory, stopping ACTION_CANCEL will cause problem when CompositorViewHolder scrolls.
+ // Yet currently CompositorViewHolder does not scroll.
+ if (!mShouldIntercept || ev.getActionMasked() == MotionEvent.ACTION_CANCEL) return false;
ev.offsetLocation(-child.getX(), -child.getY());
child.dispatchTouchEvent(ev);
return true;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698