am b10ca308: Merge "[HW4] Move a reference to WordComposer out of LatinIME"
* commit 'b10ca308afa40bdc9d003494e30d21df03a0063c': [HW4] Move a reference to WordComposer out of LatinIMEmain
commit
96eef7bb83
|
@ -1368,17 +1368,6 @@ 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()) {
|
||||||
|
|
|
@ -621,6 +621,17 @@ public final class InputLogic {
|
||||||
// TODO: on the long term, this method should become private, but it will be difficult.
|
// TODO: on the long term, this method should become private, but it will be difficult.
|
||||||
// Especially, how do we deal with InputMethodService.onDisplayCompletions?
|
// Especially, how do we deal with InputMethodService.onDisplayCompletions?
|
||||||
public void setSuggestedWords(final SuggestedWords suggestedWords) {
|
public 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;
|
||||||
|
}
|
||||||
|
mWordComposer.setAutoCorrection(autoCorrection);
|
||||||
|
}
|
||||||
mSuggestedWords = suggestedWords;
|
mSuggestedWords = suggestedWords;
|
||||||
final boolean newAutoCorrectionIndicator = suggestedWords.mWillAutoCorrect;
|
final boolean newAutoCorrectionIndicator = suggestedWords.mWillAutoCorrect;
|
||||||
// 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.
|
||||||
|
|
Loading…
Reference in New Issue