diff options
author | Adam Powell <adamp@google.com> | 2011-03-01 15:39:53 -0800 |
---|---|---|
committer | Adam Powell <adamp@google.com> | 2011-03-01 15:39:53 -0800 |
commit | 498e43dd8e0314e1147321bef57d4fdd82cb5284 (patch) | |
tree | 23dd92786abb6ce705aed2118653a5da98ab22c1 | |
parent | 91b52b189550b20cdb4e3e1920fe81a479aec843 (diff) | |
download | frameworks_base-498e43dd8e0314e1147321bef57d4fdd82cb5284.zip frameworks_base-498e43dd8e0314e1147321bef57d4fdd82cb5284.tar.gz frameworks_base-498e43dd8e0314e1147321bef57d4fdd82cb5284.tar.bz2 |
Fix bug 3501411 - ListView should ignore "up" events outside of its view
Do not dispatch item clicks if the up event occurs completely outside
of list bounds.
Change-Id: I2bc38040bcc98944e1449affcdbd75e0194637cf
-rw-r--r-- | core/java/android/widget/AbsListView.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java index 5a4bd04..2925632 100644 --- a/core/java/android/widget/AbsListView.java +++ b/core/java/android/widget/AbsListView.java @@ -3018,7 +3018,11 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te case TOUCH_MODE_DONE_WAITING: final int motionPosition = mMotionPosition; final View child = getChildAt(motionPosition - mFirstPosition); - if (child != null && !child.hasFocusable()) { + + final float x = ev.getX(); + final boolean inList = x > mListPadding.left && x < getWidth() - mListPadding.right; + + if (child != null && !child.hasFocusable() && inList) { if (mTouchMode != TOUCH_MODE_DOWN) { child.setPressed(false); } |