diff options
| author | Jean Chalard <jchalard@google.com> | 2014-07-01 09:23:59 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-06-26 23:14:58 +0000 |
| commit | b10ca308afa40bdc9d003494e30d21df03a0063c (patch) | |
| tree | f15b2b37ddde7b54f25d7701a9f2abc16bbd7122 /java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java | |
| parent | 3f7ddde4e61565751e777b7f3def884aadbb7c81 (diff) | |
| parent | 08c01ea8a8765234a470bb4d4b887fe4786ee26f (diff) | |
Merge "[HW4] Move a reference to WordComposer out of LatinIME"
Diffstat (limited to 'java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java')
| -rw-r--r-- | java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java index 7a4b726e8..213fe0b81 100644 --- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java +++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java @@ -621,6 +621,17 @@ public final class InputLogic { // TODO: on the long term, this method should become private, but it will be difficult. // Especially, how do we deal with InputMethodService.onDisplayCompletions? public void setSuggestedWords(final SuggestedWords suggestedWords) { + if (SuggestedWords.EMPTY != suggestedWords) { + final String autoCorrection; + if (suggestedWords.mWillAutoCorrect) { + autoCorrection = suggestedWords.getWord(SuggestedWords.INDEX_OF_AUTO_CORRECTION); + } else { + // We can't use suggestedWords.getWord(SuggestedWords.INDEX_OF_TYPED_WORD) + // because it may differ from mWordComposer.mTypedWord. + autoCorrection = suggestedWords.mTypedWord; + } + mWordComposer.setAutoCorrection(autoCorrection); + } mSuggestedWords = suggestedWords; final boolean newAutoCorrectionIndicator = suggestedWords.mWillAutoCorrect; // Put a blue underline to a word in TextView which will be auto-corrected. |
