Loading core/java/android/widget/Editor.java +15 −2 Original line number Original line Diff line number Diff line Loading @@ -6354,6 +6354,8 @@ public class Editor { // The offsets of that last touch down event. Remembered to start selection there. // The offsets of that last touch down event. Remembered to start selection there. private int mMinTouchOffset, mMaxTouchOffset; private int mMinTouchOffset, mMaxTouchOffset; private boolean mGestureStayedInTapRegion; // Where the user first starts the drag motion. // Where the user first starts the drag motion. private int mStartOffset = -1; private int mStartOffset = -1; Loading Loading @@ -6460,8 +6462,10 @@ public class Editor { eventX, eventY); eventX, eventY); // Double tap detection // Double tap detection if (mTouchState.isMultiTapInSameArea() && (isMouse if (mGestureStayedInTapRegion || mTouchState.isOnHandle() || isPositionOnText(eventX, eventY))) { && mTouchState.isMultiTapInSameArea() && (isMouse || isPositionOnText(eventX, eventY) || mTouchState.isOnHandle())) { if (TextView.DEBUG_CURSOR) { if (TextView.DEBUG_CURSOR) { logCursor("SelectionModifierCursorController: onTouchEvent", logCursor("SelectionModifierCursorController: onTouchEvent", "ACTION_DOWN: select and start drag"); "ACTION_DOWN: select and start drag"); Loading @@ -6473,6 +6477,7 @@ public class Editor { } } mDiscardNextActionUp = true; mDiscardNextActionUp = true; } } mGestureStayedInTapRegion = true; mHaventMovedEnoughToStartDrag = true; mHaventMovedEnoughToStartDrag = true; } } break; break; Loading @@ -6488,6 +6493,14 @@ public class Editor { break; break; case MotionEvent.ACTION_MOVE: case MotionEvent.ACTION_MOVE: if (mGestureStayedInTapRegion) { final ViewConfiguration viewConfig = ViewConfiguration.get( mTextView.getContext()); mGestureStayedInTapRegion = EditorTouchState.isDistanceWithin( mTouchState.getLastDownX(), mTouchState.getLastDownY(), eventX, eventY, viewConfig.getScaledDoubleTapTouchSlop()); } if (mHaventMovedEnoughToStartDrag) { if (mHaventMovedEnoughToStartDrag) { mHaventMovedEnoughToStartDrag = !mTouchState.isMovedEnoughForDrag(); mHaventMovedEnoughToStartDrag = !mTouchState.isMovedEnoughForDrag(); } } Loading Loading
core/java/android/widget/Editor.java +15 −2 Original line number Original line Diff line number Diff line Loading @@ -6354,6 +6354,8 @@ public class Editor { // The offsets of that last touch down event. Remembered to start selection there. // The offsets of that last touch down event. Remembered to start selection there. private int mMinTouchOffset, mMaxTouchOffset; private int mMinTouchOffset, mMaxTouchOffset; private boolean mGestureStayedInTapRegion; // Where the user first starts the drag motion. // Where the user first starts the drag motion. private int mStartOffset = -1; private int mStartOffset = -1; Loading Loading @@ -6460,8 +6462,10 @@ public class Editor { eventX, eventY); eventX, eventY); // Double tap detection // Double tap detection if (mTouchState.isMultiTapInSameArea() && (isMouse if (mGestureStayedInTapRegion || mTouchState.isOnHandle() || isPositionOnText(eventX, eventY))) { && mTouchState.isMultiTapInSameArea() && (isMouse || isPositionOnText(eventX, eventY) || mTouchState.isOnHandle())) { if (TextView.DEBUG_CURSOR) { if (TextView.DEBUG_CURSOR) { logCursor("SelectionModifierCursorController: onTouchEvent", logCursor("SelectionModifierCursorController: onTouchEvent", "ACTION_DOWN: select and start drag"); "ACTION_DOWN: select and start drag"); Loading @@ -6473,6 +6477,7 @@ public class Editor { } } mDiscardNextActionUp = true; mDiscardNextActionUp = true; } } mGestureStayedInTapRegion = true; mHaventMovedEnoughToStartDrag = true; mHaventMovedEnoughToStartDrag = true; } } break; break; Loading @@ -6488,6 +6493,14 @@ public class Editor { break; break; case MotionEvent.ACTION_MOVE: case MotionEvent.ACTION_MOVE: if (mGestureStayedInTapRegion) { final ViewConfiguration viewConfig = ViewConfiguration.get( mTextView.getContext()); mGestureStayedInTapRegion = EditorTouchState.isDistanceWithin( mTouchState.getLastDownX(), mTouchState.getLastDownY(), eventX, eventY, viewConfig.getScaledDoubleTapTouchSlop()); } if (mHaventMovedEnoughToStartDrag) { if (mHaventMovedEnoughToStartDrag) { mHaventMovedEnoughToStartDrag = !mTouchState.isMovedEnoughForDrag(); mHaventMovedEnoughToStartDrag = !mTouchState.isMovedEnoughForDrag(); } } Loading