diff options
author | 2014-01-22 22:52:27 -0800 | |
---|---|---|
committer | 2014-01-22 22:52:27 -0800 | |
commit | 6fc8dc480fecc67d8b4fe0acb01c045cfed26b91 (patch) | |
tree | 6486009c8fb4fdc316201713c3bf5a2f44f0d217 /java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java | |
parent | 3ccba8fb4763c51f66de4206f7ace4de571c804d (diff) | |
parent | d1f463eacfaac31a999f7eb1ecaa1668ed3038d4 (diff) | |
download | latinime-6fc8dc480fecc67d8b4fe0acb01c045cfed26b91.tar.gz latinime-6fc8dc480fecc67d8b4fe0acb01c045cfed26b91.tar.xz latinime-6fc8dc480fecc67d8b4fe0acb01c045cfed26b91.zip |
am d1f463ea: [IL69] Oust Keyboard from WordComposer#setComposingWord
* commit 'd1f463eacfaac31a999f7eb1ecaa1668ed3038d4':
[IL69] Oust Keyboard from WordComposer#setComposingWord
Diffstat (limited to 'java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java index c417ae793..c715cb350 100644 --- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java +++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java @@ -28,7 +28,6 @@ import android.view.inputmethod.EditorInfo; import com.android.inputmethod.compat.SuggestionSpanUtils; import com.android.inputmethod.event.EventInterpreter; -import com.android.inputmethod.keyboard.Keyboard; import com.android.inputmethod.keyboard.KeyboardSwitcher; import com.android.inputmethod.latin.Constants; import com.android.inputmethod.latin.Dictionary; @@ -1087,7 +1086,9 @@ public final class InputLogic { } } } - mWordComposer.setComposingWord(typedWord, + final int[] codePoints = StringUtils.toCodePointArray(typedWord); + mWordComposer.setComposingWord(codePoints, + mLatinIME.getCoordinatesForCurrentKeyboard(codePoints), getNthPreviousWordForSuggestion(settingsValues.mSpacingAndPunctuations, // We want the previous word for suggestion. If we have chars in the word // before the cursor, then we want the word before that, hence 2; otherwise, @@ -1177,8 +1178,8 @@ public final class InputLogic { previousWord, committedWord.toString()); } } - final SpannableString textToCommit = - new SpannableString(originallyTypedWord + mLastComposedWord.mSeparatorString); + final String stringToCommit = originallyTypedWord + mLastComposedWord.mSeparatorString; + final SpannableString textToCommit = new SpannableString(stringToCommit); if (committedWord instanceof SpannableString) { final int lastCharIndex = textToCommit.length() - 1; // Add the auto-correction to the list of suggestions. @@ -1210,8 +1211,10 @@ public final class InputLogic { } else { // For languages without spaces, we revert the typed string but the cursor is flush // with the typed word, so we need to resume suggestions right away. - mWordComposer.setComposingWord(textToCommit, previousWord, - keyboardSwitcher.getKeyboard()); + final int[] codePoints = StringUtils.toCodePointArray(stringToCommit); + mWordComposer.setComposingWord(codePoints, + mLatinIME.getCoordinatesForCurrentKeyboard(codePoints), + previousWord, keyboardSwitcher.getKeyboard()); mConnection.setComposingText(textToCommit, 1); } if (settingsValues.mIsInternal) { |