am 5d8f6660: [IL113] More cleanup

* commit '5d8f6660bfd7b9e8a04d8deff8127f07b8d56e69':
  [IL113] More cleanup
main
Jean Chalard 2014-03-03 22:53:49 -08:00 committed by Android Git Automerger
commit f2bfd35c56
1 changed files with 5 additions and 9 deletions

View File

@ -1450,17 +1450,13 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// We update the suggestion strip only when we have some suggestions to show, i.e. when // We update the suggestion strip only when we have some suggestions to show, i.e. when
// the suggestion count is > 1; else, we leave the old suggestions, with the typed word // the suggestion count is > 1; else, we leave the old suggestions, with the typed word
// replaced with the new one. However, when the length of the typed word is 1 or 0 (after // replaced with the new one. However, when the length of the typed word is 1 or 0 (after
// a deletion typically), we do want to remove the old suggestions. Also, if we are showing // a deletion typically), we do want to remove the old suggestions.
// the "add to dictionary" hint, we need to revert to suggestions - although it is unclear if (suggestedWords.size() > 1 || typedWord.length() <= 1) {
// how we can come here if it's displayed.
if (suggestedWords.size() > 1 || typedWord.length() <= 1
|| !hasSuggestionStripView() || isShowingAddToDictionaryHint()) {
return suggestedWords; return suggestedWords;
} else { } else {
final SuggestedWords punctuationList = final SuggestedWords oldSuggestedWords =
mSettings.getCurrent().mSpacingAndPunctuations.mSuggestPuncList; previousSuggestedWords.isPunctuationSuggestions() ? SuggestedWords.EMPTY
final SuggestedWords oldSuggestedWords = previousSuggestedWords == punctuationList : previousSuggestedWords;
? SuggestedWords.EMPTY : previousSuggestedWords;
final ArrayList<SuggestedWords.SuggestedWordInfo> typedWordAndPreviousSuggestions = final ArrayList<SuggestedWords.SuggestedWordInfo> typedWordAndPreviousSuggestions =
SuggestedWords.getTypedWordAndPreviousSuggestions(typedWord, oldSuggestedWords); SuggestedWords.getTypedWordAndPreviousSuggestions(typedWord, oldSuggestedWords);
return new SuggestedWords(typedWordAndPreviousSuggestions, null /* rawSuggestions */, return new SuggestedWords(typedWordAndPreviousSuggestions, null /* rawSuggestions */,