[IL36] Inline setAutoCorrection
There are far too many one-use methods. Bug: 8636060 Change-Id: I84e0669b8d2cc5a2817c42b089e874dc60e84769
This commit is contained in:
parent
52a2682b99
commit
c08119e5c1
1 changed files with 9 additions and 14 deletions
|
@ -1611,8 +1611,14 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
false /* isPrediction */);
|
false /* isPrediction */);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setAutoCorrection(final SuggestedWords suggestedWords, final String typedWord) {
|
private void showSuggestionStripWithTypedWord(final SuggestedWords suggestedWords,
|
||||||
if (suggestedWords.isEmpty()) return;
|
final String typedWord) {
|
||||||
|
if (suggestedWords.isEmpty()) {
|
||||||
|
// No auto-correction is available, clear the cached values.
|
||||||
|
AccessibilityUtils.getInstance().setAutoCorrection(null, null);
|
||||||
|
clearSuggestionStrip();
|
||||||
|
return;
|
||||||
|
}
|
||||||
final String autoCorrection;
|
final String autoCorrection;
|
||||||
if (suggestedWords.mWillAutoCorrect) {
|
if (suggestedWords.mWillAutoCorrect) {
|
||||||
autoCorrection = suggestedWords.getWord(SuggestedWords.INDEX_OF_AUTO_CORRECTION);
|
autoCorrection = suggestedWords.getWord(SuggestedWords.INDEX_OF_AUTO_CORRECTION);
|
||||||
|
@ -1622,17 +1628,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
autoCorrection = typedWord;
|
autoCorrection = typedWord;
|
||||||
}
|
}
|
||||||
mInputLogic.mWordComposer.setAutoCorrection(autoCorrection);
|
mInputLogic.mWordComposer.setAutoCorrection(autoCorrection);
|
||||||
}
|
|
||||||
|
|
||||||
private void showSuggestionStripWithTypedWord(final SuggestedWords suggestedWords,
|
|
||||||
final String typedWord) {
|
|
||||||
if (suggestedWords.isEmpty()) {
|
|
||||||
// No auto-correction is available, clear the cached values.
|
|
||||||
AccessibilityUtils.getInstance().setAutoCorrection(null, null);
|
|
||||||
clearSuggestionStrip();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
setAutoCorrection(suggestedWords, typedWord);
|
|
||||||
final boolean isAutoCorrection = suggestedWords.willAutoCorrect();
|
final boolean isAutoCorrection = suggestedWords.willAutoCorrect();
|
||||||
setSuggestedWords(suggestedWords, isAutoCorrection);
|
setSuggestedWords(suggestedWords, isAutoCorrection);
|
||||||
setAutoCorrectionIndicator(isAutoCorrection);
|
setAutoCorrectionIndicator(isAutoCorrection);
|
||||||
|
|
Loading…
Reference in a new issue