aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2013-12-27 20:58:32 +0900
committerJean Chalard <jchalard@google.com>2014-01-23 15:32:59 +0900
commitd1f463eacfaac31a999f7eb1ecaa1668ed3038d4 (patch)
tree6486009c8fb4fdc316201713c3bf5a2f44f0d217 /java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
parent9da4b49ef626f04a58f79b0894712b6b8e658ae6 (diff)
downloadlatinime-d1f463eacfaac31a999f7eb1ecaa1668ed3038d4.tar.gz
latinime-d1f463eacfaac31a999f7eb1ecaa1668ed3038d4.tar.xz
latinime-d1f463eacfaac31a999f7eb1ecaa1668ed3038d4.zip
[IL69] Oust Keyboard from WordComposer#setComposingWord
Bug: 8636060 Change-Id: I624a45500603dfad355ee3b8b794b2d895219c0b
Diffstat (limited to 'java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java')
-rw-r--r--java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java15
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) {