diff options
author | 2013-06-25 19:26:30 +0900 | |
---|---|---|
committer | 2013-07-01 14:40:12 +0900 | |
commit | f0af452ce261590b5978a1bb679ce27b71f9dc70 (patch) | |
tree | ebbabe6dfd1e99de5266f2d34f84ba4d4d84e25b /java/src/com/android/inputmethod/latin/LatinIME.java | |
parent | 8142a7b637326e8fe8736de94246b1fffb4f2886 (diff) | |
download | latinime-f0af452ce261590b5978a1bb679ce27b71f9dc70.tar.gz latinime-f0af452ce261590b5978a1bb679ce27b71f9dc70.tar.xz latinime-f0af452ce261590b5978a1bb679ce27b71f9dc70.zip |
Do not re-resume suggestion if it's not needed.
This is much better interface-wise. It eliminates all blinking
of the line in the practice.
Bug: 8874148
Bug: 8864306
Change-Id: I87754e44784327c2e9c8b162d598d145e20668e8
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 0560cf528..f3fc3177b 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -961,7 +961,11 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen // TODO: is it still necessary to test for composingSpan related stuff? final boolean selectionChangedOrSafeToReset = selectionChanged || (!mWordComposer.isComposingWord()) || noComposingSpan; - if (selectionChangedOrSafeToReset) { + final boolean hasOrHadSelection = (oldSelStart != oldSelEnd + || newSelStart != newSelEnd); + final int moveAmount = newSelStart - oldSelStart; + if (selectionChangedOrSafeToReset && (hasOrHadSelection + || !mWordComposer.moveCursorByAndReturnIfInsideComposingWord(moveAmount))) { // If we are composing a word and moving the cursor, we would want to set a // suggestion span for recorrection to work correctly. Unfortunately, that // would involve the keyboard committing some new text, which would move the @@ -2535,6 +2539,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen } } mWordComposer.setComposingWord(typedWord, mKeyboardSwitcher.getKeyboard()); + // TODO: this is in chars but the callee expects code points! mWordComposer.setCursorPositionWithinWord(numberOfCharsInWordBeforeCursor); mConnection.setComposingRegion( mLastSelectionStart - numberOfCharsInWordBeforeCursor, |