diff options
| author | 2009-05-26 14:20:35 -0700 | |
|---|---|---|
| committer | 2009-05-26 14:20:35 -0700 | |
| commit | fea57edf0dd27bc21c34e7f96cd6383d6f2dff42 (patch) | |
| tree | 76b762f23db5e129caed88dddd474badbafc937b | |
| parent | 8fc5a63d422fd32258dc18fe0e635b4f1486fd61 (diff) | |
Fix crash in GestureOverlayView
| -rw-r--r-- | core/java/android/widget/AbsListView.java | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java index ccb876f8f05f..e896d5839d6d 100644 --- a/core/java/android/widget/AbsListView.java +++ b/core/java/android/widget/AbsListView.java @@ -755,19 +755,21 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te if (ev.getAction() != MotionEvent.ACTION_DOWN || mFastScroller == null || !mFastScroller.isPointInside(ev.getX(), ev.getY())) { - mGesturesOverlay.dispatchTouchEvent(ev); - - final boolean isGesturing = mGesturesOverlay.isGesturing(); - - if (!isGesturing) { - mPreviousGesturing = isGesturing; - return super.dispatchTouchEvent(ev); - } else if (!mPreviousGesturing){ - mPreviousGesturing = isGesturing; - final MotionEvent event = MotionEvent.obtain(ev); - event.setAction(MotionEvent.ACTION_CANCEL); - super.dispatchTouchEvent(event); - return true; + if (mGesturesPopup.isShowing()) { + mGesturesOverlay.dispatchTouchEvent(ev); + + final boolean isGesturing = mGesturesOverlay.isGesturing(); + + if (!isGesturing) { + mPreviousGesturing = isGesturing; + return super.dispatchTouchEvent(ev); + } else if (!mPreviousGesturing){ + mPreviousGesturing = isGesturing; + final MotionEvent event = MotionEvent.obtain(ev); + event.setAction(MotionEvent.ACTION_CANCEL); + super.dispatchTouchEvent(event); + return true; + } } } } @@ -1927,6 +1929,8 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te final int longPressPosition, final long longPressId) { boolean handled = false; + dismissGesturesPopup(); + if (mOnItemLongClickListener != null) { handled = mOnItemLongClickListener.onItemLongClick(AbsListView.this, child, longPressPosition, longPressId); |