diff options
author | 2014-01-28 01:36:59 -0800 | |
---|---|---|
committer | 2014-01-28 01:36:59 -0800 | |
commit | ec725d1421123d5068693f96e22aa80d73d4edc2 (patch) | |
tree | c1aff9afac9e329202bd529ba5b9786566c0f633 /java/src/com/android/inputmethod/latin/inputlogic | |
parent | 633b79260d6c5826c5fcbff781ff99397953bb28 (diff) | |
parent | 281966621705caf9240af4156e62d26d43d40ccb (diff) | |
download | latinime-ec725d1421123d5068693f96e22aa80d73d4edc2.tar.gz latinime-ec725d1421123d5068693f96e22aa80d73d4edc2.tar.xz latinime-ec725d1421123d5068693f96e22aa80d73d4edc2.zip |
am 28196662: Merge "[IL99] Migrate some code to InputLogic."
* commit '281966621705caf9240af4156e62d26d43d40ccb':
[IL99] Migrate some code to InputLogic.
Diffstat (limited to 'java/src/com/android/inputmethod/latin/inputlogic')
-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. * |