diff options
author | 2014-09-18 10:11:11 +0000 | |
---|---|---|
committer | 2014-09-18 10:11:11 +0000 | |
commit | 3d54f42511fedb5bb9e68815a2ae8c8c0275def0 (patch) | |
tree | ed1544546eb8f01842a613cc86ce7b28339ed728 /java/src/com/android/inputmethod/latin/LatinIME.java | |
parent | 40ba31a9cc865b665bd16a67cbdbd76fffba887b (diff) | |
parent | 0055d26164745b24b83d1cbda6d1b1a1acb36342 (diff) | |
download | latinime-3d54f42511fedb5bb9e68815a2ae8c8c0275def0.tar.gz latinime-3d54f42511fedb5bb9e68815a2ae8c8c0275def0.tar.xz latinime-3d54f42511fedb5bb9e68815a2ae8c8c0275def0.zip |
am 0055d261: Merge "Fix showing important notice even at beginning of sentence"
* commit '0055d26164745b24b83d1cbda6d1b1a1acb36342':
Fix showing important notice even at beginning of sentence
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index e2abb84c7..69fe6de9a 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1491,19 +1491,23 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen final boolean isEmptyApplicationSpecifiedCompletions = currentSettingsValues.isApplicationSpecifiedCompletionsOn() && suggestedWords.isEmpty(); - final boolean noSuggestionsToShow = (SuggestedWords.EMPTY == suggestedWords) + final boolean noSuggestionsFromDictionaries = (SuggestedWords.EMPTY == suggestedWords) || suggestedWords.isPunctuationSuggestions() || isEmptyApplicationSpecifiedCompletions; - if (shouldShowImportantNotice && noSuggestionsToShow) { + final boolean isBeginningOfSentencePrediction = (suggestedWords.mInputStyle + == SuggestedWords.INPUT_STYLE_BEGINNING_OF_SENTENCE_PREDICTION); + final boolean noSuggestionsToOverrideImportantNotice = noSuggestionsFromDictionaries + || isBeginningOfSentencePrediction; + if (shouldShowImportantNotice && noSuggestionsToOverrideImportantNotice) { if (mSuggestionStripView.maybeShowImportantNoticeTitle()) { return; } } if (currentSettingsValues.isSuggestionsEnabledPerUserSettings() - // We should clear suggestions if there is no suggestion to show. - || noSuggestionsToShow - || currentSettingsValues.isApplicationSpecifiedCompletionsOn()) { + || currentSettingsValues.isApplicationSpecifiedCompletionsOn() + // We should clear the contextual strip if there is no suggestion from dictionaries. + || noSuggestionsFromDictionaries) { mSuggestionStripView.setSuggestions(suggestedWords, SubtypeLocaleUtils.isRtlLanguage(mSubtypeSwitcher.getCurrentSubtype())); } |