diff options
author | 2014-01-28 09:08:44 +0000 | |
---|---|---|
committer | 2014-01-28 09:08:44 +0000 | |
commit | 281966621705caf9240af4156e62d26d43d40ccb (patch) | |
tree | cf3f463a2a329f1ee286f462bc8f1519681f2fec /java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java | |
parent | 437fa64af3dfe4785b217177c0c357a75584efbd (diff) | |
parent | 4761d2fb002bddd487a24de5965c09538598813c (diff) | |
download | latinime-281966621705caf9240af4156e62d26d43d40ccb.tar.gz latinime-281966621705caf9240af4156e62d26d43d40ccb.tar.xz latinime-281966621705caf9240af4156e62d26d43d40ccb.zip |
Merge "[IL99] Migrate some code to InputLogic."
Diffstat (limited to 'java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java | 19 |
1 files changed, 19 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 43d75330d..98cce0d24 100644 --- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java +++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java @@ -478,6 +478,25 @@ public final class InputLogic { SuggestedWords.EMPTY, true /* dismissGestureFloatingPreviewText */); } + // 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) { + mSuggestedWords = suggestedWords; + final boolean newAutoCorrectionIndicator = suggestedWords.mWillAutoCorrect; + // Put a blue underline to a word in TextView which will be auto-corrected. + if (mIsAutoCorrectionIndicatorOn != newAutoCorrectionIndicator + && mWordComposer.isComposingWord()) { + mIsAutoCorrectionIndicatorOn = newAutoCorrectionIndicator; + final CharSequence textWithUnderline = + getTextWithUnderline(mWordComposer.getTypedWord()); + // TODO: when called from an updateSuggestionStrip() call that results from a posted + // message, this is called outside any batch edit. Potentially, this may result in some + // janky flickering of the screen, although the display speed makes it unlikely in + // the practice. + mConnection.setComposingText(textWithUnderline, 1); + } + } + /** * Handle inputting a code point to the editor. * |