diff options
author | 2014-07-01 09:24:41 +0000 | |
---|---|---|
committer | 2014-07-01 09:24:41 +0000 | |
commit | 96eef7bb8377c6bafb464584b30ab7fe05d261af (patch) | |
tree | c2b81f4f67a0b4634b68a198e592b7dd4a5cb8e0 /java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java | |
parent | ee9d524c1e301d04e0fe999b9ffcbf0a29fa2839 (diff) | |
parent | b10ca308afa40bdc9d003494e30d21df03a0063c (diff) | |
download | latinime-96eef7bb8377c6bafb464584b30ab7fe05d261af.tar.gz latinime-96eef7bb8377c6bafb464584b30ab7fe05d261af.tar.xz latinime-96eef7bb8377c6bafb464584b30ab7fe05d261af.zip |
am b10ca308: Merge "[HW4] Move a reference to WordComposer out of LatinIME"
* commit 'b10ca308afa40bdc9d003494e30d21df03a0063c':
[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. |