Small cleanup
Exit-fast, update comment, make a method private Change-Id: Id103bf03aeef43a1a4d064ecabb819490dc5d39amain
parent
7c5f2bbd2a
commit
2be7a37acf
|
@ -1716,7 +1716,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
|
||||||
setAutoCorrectionIndicator(false);
|
setAutoCorrectionIndicator(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSuggestions(final SuggestedWords words, final boolean isAutoCorrection) {
|
private void setSuggestions(final SuggestedWords words, final boolean isAutoCorrection) {
|
||||||
if (mSuggestionsView != null) {
|
if (mSuggestionsView != null) {
|
||||||
mSuggestionsView.setSuggestions(words);
|
mSuggestionsView.setSuggestions(words);
|
||||||
mKeyboardSwitcher.onAutoCorrectionStateChanged(isAutoCorrection);
|
mKeyboardSwitcher.onAutoCorrectionStateChanged(isAutoCorrection);
|
||||||
|
@ -1726,17 +1726,15 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
|
||||||
private void setAutoCorrectionIndicator(final boolean newAutoCorrectionIndicator) {
|
private void setAutoCorrectionIndicator(final boolean newAutoCorrectionIndicator) {
|
||||||
// Put a blue underline to a word in TextView which will be auto-corrected.
|
// Put a blue underline to a word in TextView which will be auto-corrected.
|
||||||
final InputConnection ic = getCurrentInputConnection();
|
final InputConnection ic = getCurrentInputConnection();
|
||||||
if (ic != null) {
|
if (ic == null) return;
|
||||||
if (mIsAutoCorrectionIndicatorOn != newAutoCorrectionIndicator) {
|
if (mIsAutoCorrectionIndicatorOn != newAutoCorrectionIndicator
|
||||||
if (mWordComposer.isComposingWord()) {
|
&& mWordComposer.isComposingWord()) {
|
||||||
mIsAutoCorrectionIndicatorOn = newAutoCorrectionIndicator;
|
mIsAutoCorrectionIndicatorOn = newAutoCorrectionIndicator;
|
||||||
final CharSequence textWithUnderline =
|
final CharSequence textWithUnderline =
|
||||||
getTextWithUnderline(mWordComposer.getTypedWord());
|
getTextWithUnderline(mWordComposer.getTypedWord());
|
||||||
ic.setComposingText(textWithUnderline, 1);
|
ic.setComposingText(textWithUnderline, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateSuggestions() {
|
public void updateSuggestions() {
|
||||||
// Check if we have a suggestion engine attached.
|
// Check if we have a suggestion engine attached.
|
||||||
|
@ -1767,7 +1765,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
|
||||||
}
|
}
|
||||||
|
|
||||||
final CharSequence typedWord = mWordComposer.getTypedWord();
|
final CharSequence typedWord = mWordComposer.getTypedWord();
|
||||||
// getSuggestedWordBuilder handles gracefully a null value of prevWord
|
// getSuggestedWords handles gracefully a null value of prevWord
|
||||||
final SuggestedWords suggestedWords = mSuggest.getSuggestedWords(mWordComposer,
|
final SuggestedWords suggestedWords = mSuggest.getSuggestedWords(mWordComposer,
|
||||||
prevWord, mKeyboardSwitcher.getKeyboard().getProximityInfo(), mCorrectionMode);
|
prevWord, mKeyboardSwitcher.getKeyboard().getProximityInfo(), mCorrectionMode);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue