diff options
| author | 2010-06-23 10:26:44 -0700 | |
|---|---|---|
| committer | 2010-06-23 10:26:44 -0700 | |
| commit | 73ccafb5b843cdcf9c8f761fc72a69b4b7942aaf (patch) | |
| tree | 815b66ee07fca7d2770e3915db596a5401c261b2 | |
| parent | 9fe2c4e2b89cbe4e22fdbcb3d5ecae1a853b133e (diff) | |
| parent | 110486f932510fb49bfeff978b0b0e0237ee0656 (diff) | |
Merge "Fix a bug where requestDisallowInterceptTouchEvent does not get called when scrolling is resumed after stopping a fling." into gingerbread
| -rw-r--r-- | core/java/android/view/ViewGroup.java | 3 | ||||
| -rw-r--r-- | core/java/android/widget/AbsListView.java | 8 |
2 files changed, 10 insertions, 1 deletions
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index eca583f46b22..e7b6c506f622 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -223,8 +223,9 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager /** * When set, this ViewGroup should not intercept touch events. + * {@hide} */ - private static final int FLAG_DISALLOW_INTERCEPT = 0x80000; + protected static final int FLAG_DISALLOW_INTERCEPT = 0x80000; /** * Indicates which types of drawing caches are to be kept in memory. diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java index fcfecb30ca70..6cfeb684f3ce 100644 --- a/core/java/android/widget/AbsListView.java +++ b/core/java/android/widget/AbsListView.java @@ -2056,6 +2056,14 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te } if (y != mLastY) { + // We may be here after stopping a fling and continuing to scroll. + // If so, we haven't disallowed intercepting touch events yet. + // Make sure that we do so in case we're in a parent that can intercept. + if ((mGroupFlags & FLAG_DISALLOW_INTERCEPT) == 0 && + Math.abs(deltaY) > mTouchSlop) { + requestDisallowInterceptTouchEvent(true); + } + deltaY -= mMotionCorrection; int incrementalDeltaY = mLastY != Integer.MIN_VALUE ? y - mLastY : deltaY; |