Loading core/java/android/gesture/GestureOverlayView.java +10 −2 Original line number Diff line number Diff line Loading @@ -93,6 +93,7 @@ public class GestureOverlayView extends FrameLayout { private float mTotalLength; private boolean mIsGesturing = false; private boolean mPreviousWasGesturing = false; private boolean mInterceptEvents = true; private boolean mIsListeningForGestures; Loading Loading @@ -425,6 +426,7 @@ public class GestureOverlayView extends FrameLayout { clear(false); mIsGesturing = false; mPreviousWasGesturing = false; mStrokeBuffer.clear(); final ArrayList<OnGesturingListener> otherListeners = mOnGesturingListeners; Loading @@ -442,8 +444,10 @@ public class GestureOverlayView extends FrameLayout { @Override public boolean dispatchTouchEvent(MotionEvent event) { if (isEnabled()) { boolean cancelDispatch = (mIsGesturing || (mCurrentGesture != null && mCurrentGesture.getStrokesCount() > 0)) && mInterceptEvents; final boolean cancelDispatch = (mIsGesturing || (mCurrentGesture != null && mCurrentGesture.getStrokesCount() > 0 && mPreviousWasGesturing)) && mInterceptEvents; processEvent(event); if (cancelDispatch) { Loading @@ -451,6 +455,7 @@ public class GestureOverlayView extends FrameLayout { } super.dispatchTouchEvent(event); return true; } Loading Loading @@ -647,6 +652,7 @@ public class GestureOverlayView extends FrameLayout { } mStrokeBuffer.clear(); mPreviousWasGesturing = mIsGesturing; mIsGesturing = false; final ArrayList<OnGesturingListener> listeners = mOnGesturingListeners; Loading Loading @@ -688,6 +694,7 @@ public class GestureOverlayView extends FrameLayout { fireOnGesturePerformed(); } mPreviousWasGesturing = false; mIsFadingOut = false; mFadingHasStarted = false; mPath.rewind(); Loading @@ -707,6 +714,7 @@ public class GestureOverlayView extends FrameLayout { mFadingHasStarted = false; mPath.rewind(); mCurrentGesture = null; mPreviousWasGesturing = false; setPaintAlpha(255); } Loading core/java/android/widget/AbsListView.java +4 −22 Original line number Diff line number Diff line Loading @@ -472,7 +472,6 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te private ViewTreeObserver.OnGlobalLayoutListener mGesturesLayoutListener; private boolean mGlobalLayoutListenerAddedGestures; private boolean mInstallGesturesOverlay; private boolean mPreviousGesturing; private boolean mGlobalLayoutListenerAddedFilter; Loading Loading @@ -737,8 +736,6 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te mGesturesOverlay.removeAllOnGestureListeners(); mGesturesOverlay.setGestureStrokeType(GestureOverlayView.GESTURE_STROKE_TYPE_MULTIPLE); mGesturesOverlay.addOnGesturePerformedListener(new GesturesProcessor()); mPreviousGesturing = false; } } Loading @@ -753,25 +750,10 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te @Override public boolean dispatchTouchEvent(MotionEvent ev) { if (mGestures != GESTURES_NONE) { if (ev.getAction() != MotionEvent.ACTION_DOWN || mFastScroller == null || !mFastScroller.isPointInside(ev.getX(), ev.getY())) { if (mGesturesPopup.isShowing()) { if ((ev.getAction() != MotionEvent.ACTION_DOWN || mFastScroller == null || !mFastScroller.isPointInside(ev.getX(), ev.getY())) && 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; } } } } Loading Loading
core/java/android/gesture/GestureOverlayView.java +10 −2 Original line number Diff line number Diff line Loading @@ -93,6 +93,7 @@ public class GestureOverlayView extends FrameLayout { private float mTotalLength; private boolean mIsGesturing = false; private boolean mPreviousWasGesturing = false; private boolean mInterceptEvents = true; private boolean mIsListeningForGestures; Loading Loading @@ -425,6 +426,7 @@ public class GestureOverlayView extends FrameLayout { clear(false); mIsGesturing = false; mPreviousWasGesturing = false; mStrokeBuffer.clear(); final ArrayList<OnGesturingListener> otherListeners = mOnGesturingListeners; Loading @@ -442,8 +444,10 @@ public class GestureOverlayView extends FrameLayout { @Override public boolean dispatchTouchEvent(MotionEvent event) { if (isEnabled()) { boolean cancelDispatch = (mIsGesturing || (mCurrentGesture != null && mCurrentGesture.getStrokesCount() > 0)) && mInterceptEvents; final boolean cancelDispatch = (mIsGesturing || (mCurrentGesture != null && mCurrentGesture.getStrokesCount() > 0 && mPreviousWasGesturing)) && mInterceptEvents; processEvent(event); if (cancelDispatch) { Loading @@ -451,6 +455,7 @@ public class GestureOverlayView extends FrameLayout { } super.dispatchTouchEvent(event); return true; } Loading Loading @@ -647,6 +652,7 @@ public class GestureOverlayView extends FrameLayout { } mStrokeBuffer.clear(); mPreviousWasGesturing = mIsGesturing; mIsGesturing = false; final ArrayList<OnGesturingListener> listeners = mOnGesturingListeners; Loading Loading @@ -688,6 +694,7 @@ public class GestureOverlayView extends FrameLayout { fireOnGesturePerformed(); } mPreviousWasGesturing = false; mIsFadingOut = false; mFadingHasStarted = false; mPath.rewind(); Loading @@ -707,6 +714,7 @@ public class GestureOverlayView extends FrameLayout { mFadingHasStarted = false; mPath.rewind(); mCurrentGesture = null; mPreviousWasGesturing = false; setPaintAlpha(255); } Loading
core/java/android/widget/AbsListView.java +4 −22 Original line number Diff line number Diff line Loading @@ -472,7 +472,6 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te private ViewTreeObserver.OnGlobalLayoutListener mGesturesLayoutListener; private boolean mGlobalLayoutListenerAddedGestures; private boolean mInstallGesturesOverlay; private boolean mPreviousGesturing; private boolean mGlobalLayoutListenerAddedFilter; Loading Loading @@ -737,8 +736,6 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te mGesturesOverlay.removeAllOnGestureListeners(); mGesturesOverlay.setGestureStrokeType(GestureOverlayView.GESTURE_STROKE_TYPE_MULTIPLE); mGesturesOverlay.addOnGesturePerformedListener(new GesturesProcessor()); mPreviousGesturing = false; } } Loading @@ -753,25 +750,10 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te @Override public boolean dispatchTouchEvent(MotionEvent ev) { if (mGestures != GESTURES_NONE) { if (ev.getAction() != MotionEvent.ACTION_DOWN || mFastScroller == null || !mFastScroller.isPointInside(ev.getX(), ev.getY())) { if (mGesturesPopup.isShowing()) { if ((ev.getAction() != MotionEvent.ACTION_DOWN || mFastScroller == null || !mFastScroller.isPointInside(ev.getX(), ev.getY())) && 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; } } } } Loading