Merge change 2465 into donut

* changes:
  Fix crash in GestureOverlayView
This commit is contained in:
Android (Google) Code Review
2009-05-26 14:40:45 -07:00

View File

@@ -755,19 +755,21 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
if (ev.getAction() != MotionEvent.ACTION_DOWN || mFastScroller == null || if (ev.getAction() != MotionEvent.ACTION_DOWN || mFastScroller == null ||
!mFastScroller.isPointInside(ev.getX(), ev.getY())) { !mFastScroller.isPointInside(ev.getX(), ev.getY())) {
mGesturesOverlay.dispatchTouchEvent(ev); if (mGesturesPopup.isShowing()) {
mGesturesOverlay.dispatchTouchEvent(ev);
final boolean isGesturing = mGesturesOverlay.isGesturing(); final boolean isGesturing = mGesturesOverlay.isGesturing();
if (!isGesturing) { if (!isGesturing) {
mPreviousGesturing = isGesturing; mPreviousGesturing = isGesturing;
return super.dispatchTouchEvent(ev); return super.dispatchTouchEvent(ev);
} else if (!mPreviousGesturing){ } else if (!mPreviousGesturing){
mPreviousGesturing = isGesturing; mPreviousGesturing = isGesturing;
final MotionEvent event = MotionEvent.obtain(ev); final MotionEvent event = MotionEvent.obtain(ev);
event.setAction(MotionEvent.ACTION_CANCEL); event.setAction(MotionEvent.ACTION_CANCEL);
super.dispatchTouchEvent(event); super.dispatchTouchEvent(event);
return true; return true;
}
} }
} }
} }
@@ -1927,6 +1929,8 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
final int longPressPosition, final long longPressId) { final int longPressPosition, final long longPressId) {
boolean handled = false; boolean handled = false;
dismissGesturesPopup();
if (mOnItemLongClickListener != null) { if (mOnItemLongClickListener != null) {
handled = mOnItemLongClickListener.onItemLongClick(AbsListView.this, child, handled = mOnItemLongClickListener.onItemLongClick(AbsListView.this, child,
longPressPosition, longPressId); longPressPosition, longPressId);