Simplification (A78)

Change-Id: I622503af858ef419e94a17f182253cb03da00462
main
Jean Chalard 2012-07-06 16:20:04 +09:00
parent 759778a751
commit 09fdd30e52
1 changed files with 7 additions and 7 deletions

View File

@ -1702,13 +1702,13 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
private SuggestedWords maybeRetrieveOlderSuggestions(final CharSequence typedWord, private SuggestedWords maybeRetrieveOlderSuggestions(final CharSequence typedWord,
final SuggestedWords suggestedWords) { final SuggestedWords suggestedWords) {
// TODO: consolidate this into getSuggestedWords // TODO: consolidate this into getSuggestedWords
// Basically, we update the suggestion strip only when suggestion count > 1. However, // We update the suggestion strip only when we have some suggestions to show, i.e. when
// there is an exception: We update the suggestion strip whenever typed word's length // the suggestion count is > 1; else, we leave the old suggestions, with the typed word
// is 1 or typed word is found in dictionary, regardless of suggestion count. Actually, // replaced with the new one. However, when the word is a dictionary word, or when the
// in most cases, suggestion count is 1 when typed word's length is 1, but we do always // length of the typed word is 1 or 0 (after a deletion typically), we do want to remove the
// need to clear the previous state when the user starts typing a word (i.e. typed word's // old suggestions. Also, if we are showing the "add to dictionary" hint, we need to
// length == 1). // revert to suggestions - although it is unclear how we can come here if it's displayed.
if (suggestedWords.size() > 1 || typedWord.length() == 1 || !mWordComposer.isComposingWord() if (suggestedWords.size() > 1 || typedWord.length() <= 1
|| !suggestedWords.mTypedWordValid || !suggestedWords.mTypedWordValid
|| mSuggestionsView.isShowingAddToDictionaryHint()) { || mSuggestionsView.isShowingAddToDictionaryHint()) {
return suggestedWords; return suggestedWords;