parent
0dab3171d4
commit
350f23f67e
|
@ -1336,6 +1336,17 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setSuggestedWords(final SuggestedWords suggestedWords) {
|
private 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;
|
||||||
|
}
|
||||||
|
mInputLogic.mWordComposer.setAutoCorrection(autoCorrection);
|
||||||
|
}
|
||||||
mInputLogic.setSuggestedWords(suggestedWords);
|
mInputLogic.setSuggestedWords(suggestedWords);
|
||||||
// TODO: Modify this when we support suggestions with hard keyboard
|
// TODO: Modify this when we support suggestions with hard keyboard
|
||||||
if (!hasSuggestionStripView()) {
|
if (!hasSuggestionStripView()) {
|
||||||
|
@ -1399,18 +1410,9 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
public void showSuggestionStrip(final SuggestedWords sourceSuggestedWords) {
|
public void showSuggestionStrip(final SuggestedWords sourceSuggestedWords) {
|
||||||
final SuggestedWords suggestedWords =
|
final SuggestedWords suggestedWords =
|
||||||
sourceSuggestedWords.isEmpty() ? SuggestedWords.EMPTY : sourceSuggestedWords;
|
sourceSuggestedWords.isEmpty() ? SuggestedWords.EMPTY : sourceSuggestedWords;
|
||||||
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 = sourceSuggestedWords.mTypedWord;
|
|
||||||
}
|
|
||||||
if (SuggestedWords.EMPTY == suggestedWords) {
|
if (SuggestedWords.EMPTY == suggestedWords) {
|
||||||
setNeutralSuggestionStrip();
|
setNeutralSuggestionStrip();
|
||||||
} else {
|
} else {
|
||||||
mInputLogic.mWordComposer.setAutoCorrection(autoCorrection);
|
|
||||||
setSuggestedWords(suggestedWords);
|
setSuggestedWords(suggestedWords);
|
||||||
}
|
}
|
||||||
// Cache the auto-correction in accessibility code so we can speak it if the user
|
// Cache the auto-correction in accessibility code so we can speak it if the user
|
||||||
|
|
Loading…
Reference in New Issue