Loading java/src/com/android/inputmethod/keyboard/PointerTracker.java +4 −1 Original line number Diff line number Diff line Loading @@ -920,8 +920,12 @@ public final class PointerTracker implements PointerTrackerQueue.Element { final boolean isMajorEvent, final Key key) { final int gestureTime = (int)(eventTime - sGestureFirstDownTime); if (mIsDetectingGesture) { final int beforeLength = mGestureStrokeWithPreviewPoints.getLength(); final boolean onValidArea = mGestureStrokeWithPreviewPoints.addPointOnKeyboard( x, y, gestureTime, isMajorEvent); if (mGestureStrokeWithPreviewPoints.getLength() > beforeLength) { mTimerProxy.startUpdateBatchInputTimer(this); } // If the move event goes out from valid batch input area, cancel batch input. if (!onValidArea) { cancelBatchInput(); Loading @@ -943,7 +947,6 @@ public final class PointerTracker implements PointerTrackerQueue.Element { if (DEBUG_MOVE_EVENT) { printTouchEvent("onMoveEvent:", x, y, eventTime); } mTimerProxy.cancelUpdateBatchInputTimer(this); if (mIsTrackingCanceled) { return; } Loading java/src/com/android/inputmethod/keyboard/internal/GestureStroke.java +11 −7 Original line number Diff line number Diff line Loading @@ -163,6 +163,10 @@ public class GestureStroke { } } public int getLength() { return mEventTimes.getLength(); } public void onDownEvent(final int x, final int y, final long downTime, final long gestureFirstDownTime, final long lastTypingTime) { reset(); Loading Loading @@ -202,7 +206,7 @@ public class GestureStroke { if (!hasDetectedFastMove()) { return false; } final int size = mEventTimes.getLength(); final int size = getLength(); if (size <= 0) { return false; } Loading @@ -229,7 +233,7 @@ public class GestureStroke { } public void duplicateLastPointWith(final int time) { final int lastIndex = mEventTimes.getLength() - 1; final int lastIndex = getLength() - 1; if (lastIndex >= 0) { final int x = mXCoordinates.get(lastIndex); final int y = mYCoordinates.get(lastIndex); Loading @@ -255,7 +259,7 @@ public class GestureStroke { } private void appendPoint(final int x, final int y, final int time) { final int lastIndex = mEventTimes.getLength() - 1; final int lastIndex = getLength() - 1; // The point that is created by {@link duplicateLastPointWith(int)} may have later event // time than the next {@link MotionEvent}. To maintain the monotonicity of the event time, // drop the successive point here. Loading @@ -281,7 +285,7 @@ public class GestureStroke { } private int detectFastMove(final int x, final int y, final int time) { final int size = mEventTimes.getLength(); final int size = getLength(); final int lastIndex = size - 1; final int lastX = mXCoordinates.get(lastIndex); final int lastY = mYCoordinates.get(lastIndex); Loading Loading @@ -321,7 +325,7 @@ public class GestureStroke { */ public boolean addPointOnKeyboard(final int x, final int y, final int time, final boolean isMajorEvent) { final int size = mEventTimes.getLength(); final int size = getLength(); if (size <= 0) { // Down event appendPoint(x, y, time); Loading @@ -348,7 +352,7 @@ public class GestureStroke { final int pixelsPerSec = pixels * MSEC_PER_SEC; // Equivalent to (pixels / msecs < mGestureRecognitionThreshold / MSEC_PER_SEC) if (pixelsPerSec < mGestureRecognitionSpeedThreshold * msecs) { mIncrementalRecognitionSize = mEventTimes.getLength(); mIncrementalRecognitionSize = getLength(); } } Loading @@ -358,7 +362,7 @@ public class GestureStroke { } public final void appendAllBatchPoints(final InputPointers out) { appendBatchPoints(out, mEventTimes.getLength()); appendBatchPoints(out, getLength()); } public final void appendIncrementalBatchPoints(final InputPointers out) { Loading Loading
java/src/com/android/inputmethod/keyboard/PointerTracker.java +4 −1 Original line number Diff line number Diff line Loading @@ -920,8 +920,12 @@ public final class PointerTracker implements PointerTrackerQueue.Element { final boolean isMajorEvent, final Key key) { final int gestureTime = (int)(eventTime - sGestureFirstDownTime); if (mIsDetectingGesture) { final int beforeLength = mGestureStrokeWithPreviewPoints.getLength(); final boolean onValidArea = mGestureStrokeWithPreviewPoints.addPointOnKeyboard( x, y, gestureTime, isMajorEvent); if (mGestureStrokeWithPreviewPoints.getLength() > beforeLength) { mTimerProxy.startUpdateBatchInputTimer(this); } // If the move event goes out from valid batch input area, cancel batch input. if (!onValidArea) { cancelBatchInput(); Loading @@ -943,7 +947,6 @@ public final class PointerTracker implements PointerTrackerQueue.Element { if (DEBUG_MOVE_EVENT) { printTouchEvent("onMoveEvent:", x, y, eventTime); } mTimerProxy.cancelUpdateBatchInputTimer(this); if (mIsTrackingCanceled) { return; } Loading
java/src/com/android/inputmethod/keyboard/internal/GestureStroke.java +11 −7 Original line number Diff line number Diff line Loading @@ -163,6 +163,10 @@ public class GestureStroke { } } public int getLength() { return mEventTimes.getLength(); } public void onDownEvent(final int x, final int y, final long downTime, final long gestureFirstDownTime, final long lastTypingTime) { reset(); Loading Loading @@ -202,7 +206,7 @@ public class GestureStroke { if (!hasDetectedFastMove()) { return false; } final int size = mEventTimes.getLength(); final int size = getLength(); if (size <= 0) { return false; } Loading @@ -229,7 +233,7 @@ public class GestureStroke { } public void duplicateLastPointWith(final int time) { final int lastIndex = mEventTimes.getLength() - 1; final int lastIndex = getLength() - 1; if (lastIndex >= 0) { final int x = mXCoordinates.get(lastIndex); final int y = mYCoordinates.get(lastIndex); Loading @@ -255,7 +259,7 @@ public class GestureStroke { } private void appendPoint(final int x, final int y, final int time) { final int lastIndex = mEventTimes.getLength() - 1; final int lastIndex = getLength() - 1; // The point that is created by {@link duplicateLastPointWith(int)} may have later event // time than the next {@link MotionEvent}. To maintain the monotonicity of the event time, // drop the successive point here. Loading @@ -281,7 +285,7 @@ public class GestureStroke { } private int detectFastMove(final int x, final int y, final int time) { final int size = mEventTimes.getLength(); final int size = getLength(); final int lastIndex = size - 1; final int lastX = mXCoordinates.get(lastIndex); final int lastY = mYCoordinates.get(lastIndex); Loading Loading @@ -321,7 +325,7 @@ public class GestureStroke { */ public boolean addPointOnKeyboard(final int x, final int y, final int time, final boolean isMajorEvent) { final int size = mEventTimes.getLength(); final int size = getLength(); if (size <= 0) { // Down event appendPoint(x, y, time); Loading @@ -348,7 +352,7 @@ public class GestureStroke { final int pixelsPerSec = pixels * MSEC_PER_SEC; // Equivalent to (pixels / msecs < mGestureRecognitionThreshold / MSEC_PER_SEC) if (pixelsPerSec < mGestureRecognitionSpeedThreshold * msecs) { mIncrementalRecognitionSize = mEventTimes.getLength(); mIncrementalRecognitionSize = getLength(); } } Loading @@ -358,7 +362,7 @@ public class GestureStroke { } public final void appendAllBatchPoints(final InputPointers out) { appendBatchPoints(out, mEventTimes.getLength()); appendBatchPoints(out, getLength()); } public final void appendIncrementalBatchPoints(final InputPointers out) { Loading