diff options
| author | Tadashi G. Takaoka <takaoka@google.com> | 2012-09-26 15:49:23 +0900 |
|---|---|---|
| committer | Tadashi G. Takaoka <takaoka@google.com> | 2012-09-26 20:43:13 +0900 |
| commit | 157fe98fd439a7d9cc063a7f5573f688e33c2f29 (patch) | |
| tree | 3237148271d62190d3aa2edbd45189c7e1ac29a9 /java/src/com/android/inputmethod/keyboard/PointerTracker.java | |
| parent | 002a502c845dfc085dc4c70384c8e0ea90a15f79 (diff) | |
Draw gesture trail that is above the keyboard
Bug: 7233992
Change-Id: Ia848543a9d008c68d6ecbc7f715aa6ccdba9d1c6
Diffstat (limited to 'java/src/com/android/inputmethod/keyboard/PointerTracker.java')
| -rw-r--r-- | java/src/com/android/inputmethod/keyboard/PointerTracker.java | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/PointerTracker.java b/java/src/com/android/inputmethod/keyboard/PointerTracker.java index cfd1e09f9..ec8f65994 100644 --- a/java/src/com/android/inputmethod/keyboard/PointerTracker.java +++ b/java/src/com/android/inputmethod/keyboard/PointerTracker.java @@ -576,18 +576,20 @@ public class PointerTracker implements PointerTrackerQueue.Element { mDrawingProxy.showGesturePreviewTrail(this, isOldestTracker); } - private void updateBatchInput(final long eventTime) { - synchronized (sAggregratedPointers) { - mGestureStrokeWithPreviewPoints.appendIncrementalBatchPoints(sAggregratedPointers); - final int size = sAggregratedPointers.getPointerSize(); - if (size > sLastRecognitionPointSize - && GestureStroke.hasRecognitionTimePast(eventTime, sLastRecognitionTime)) { - sLastRecognitionPointSize = size; - sLastRecognitionTime = eventTime; - if (DEBUG_LISTENER) { - Log.d(TAG, "onUpdateBatchInput: batchPoints=" + size); + private void mayUpdateBatchInput(final long eventTime, final Key key) { + if (key != null) { + synchronized (sAggregratedPointers) { + mGestureStrokeWithPreviewPoints.appendIncrementalBatchPoints(sAggregratedPointers); + final int size = sAggregratedPointers.getPointerSize(); + if (size > sLastRecognitionPointSize + && GestureStroke.hasRecognitionTimePast(eventTime, sLastRecognitionTime)) { + sLastRecognitionPointSize = size; + sLastRecognitionTime = eventTime; + if (DEBUG_LISTENER) { + Log.d(TAG, "onUpdateBatchInput: batchPoints=" + size); + } + mListener.onUpdateBatchInput(sAggregratedPointers); } - mListener.onUpdateBatchInput(sAggregratedPointers); } } final boolean isOldestTracker = sPointerTrackerQueue.getOldestElement() == this; @@ -746,8 +748,8 @@ public class PointerTracker implements PointerTrackerQueue.Element { if (mIsDetectingGesture) { mGestureStrokeWithPreviewPoints.addPoint(x, y, gestureTime, isMajorEvent); mayStartBatchInput(key); - if (sInGesture && key != null) { - updateBatchInput(eventTime); + if (sInGesture) { + mayUpdateBatchInput(eventTime, key); } } } |
