Skip to content
Snippets Groups Projects
Commit 5d8f6660 authored by Jean Chalard's avatar Jean Chalard
Browse files

[IL113] More cleanup

We should not test punctuation with this equality test any more.
Also, whether the suggestion strip is displayed or not, or whether
the hint is displayed or not, has nothing to do with this method
and should be handled elsewhere rather than here -- and as a
matter of fact, it is, which makes this useless.

Bug: 8636060
Change-Id: I6a54ee87e4e9f81bc33158acf4a264c3abd5829d
parent c92dabb2
No related branches found
No related tags found
No related merge requests found
......@@ -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
// 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
// a deletion typically), we do want to remove the old suggestions. Also, if we are showing
// the "add to dictionary" hint, we need to revert to suggestions - although it is unclear
// how we can come here if it's displayed.
if (suggestedWords.size() > 1 || typedWord.length() <= 1
|| !hasSuggestionStripView() || isShowingAddToDictionaryHint()) {
// a deletion typically), we do want to remove the old suggestions.
if (suggestedWords.size() > 1 || typedWord.length() <= 1) {
return suggestedWords;
} else {
final SuggestedWords punctuationList =
mSettings.getCurrent().mSpacingAndPunctuations.mSuggestPuncList;
final SuggestedWords oldSuggestedWords = previousSuggestedWords == punctuationList
? SuggestedWords.EMPTY : previousSuggestedWords;
final SuggestedWords oldSuggestedWords =
previousSuggestedWords.isPunctuationSuggestions() ? SuggestedWords.EMPTY
: previousSuggestedWords;
final ArrayList<SuggestedWords.SuggestedWordInfo> typedWordAndPreviousSuggestions =
SuggestedWords.getTypedWordAndPreviousSuggestions(typedWord, oldSuggestedWords);
return new SuggestedWords(typedWordAndPreviousSuggestions, null /* rawSuggestions */,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment