diff options
author | 2014-06-11 10:33:31 +0900 | |
---|---|---|
committer | 2014-06-11 11:51:58 +0900 | |
commit | 6a96c508fddde10827b8f0822a7096bf4b708cf0 (patch) | |
tree | 04de911706f823578235b27266645baba816b8c1 /java/src/com/android/inputmethod/latin/LatinIME.java | |
parent | 6b655de1a6bdde3336d5dbc2a6c9dcbb9a816b34 (diff) | |
download | latinime-6a96c508fddde10827b8f0822a7096bf4b708cf0.tar.gz latinime-6a96c508fddde10827b8f0822a7096bf4b708cf0.tar.xz latinime-6a96c508fddde10827b8f0822a7096bf4b708cf0.zip |
Fix logic to show suggestions
Bug: 15531465
Change-Id: Ic7fe5743ad3767cdaed699e5e2d1ebcaa75e22c2
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 35966bb71..8b671a94b 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1336,9 +1336,12 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen final SettingsValues currentSettingsValues = mSettings.getCurrent(); final boolean shouldShowImportantNotice = ImportantNoticeUtils.shouldShowImportantNotice(this); + final boolean shouldShowSuggestionCandidates = + currentSettingsValues.mInputAttributes.mShouldShowSuggestions + && currentSettingsValues.isCurrentOrientationAllowingSuggestionsPerUserSettings(); final boolean shouldShowSuggestionsStripUnlessPassword = shouldShowImportantNotice || currentSettingsValues.mShowsVoiceInputKey - || currentSettingsValues.isSuggestionsRequested() + || shouldShowSuggestionCandidates || currentSettingsValues.isApplicationSpecifiedCompletionsOn(); final boolean shouldShowSuggestionsStrip = shouldShowSuggestionsStripUnlessPassword && !currentSettingsValues.mInputAttributes.mIsPasswordField; @@ -1353,14 +1356,16 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen final boolean noSuggestionsToShow = (SuggestedWords.EMPTY == suggestedWords) || suggestedWords.isPunctuationSuggestions() || isEmptyApplicationSpecifiedCompletions; - final boolean isShowingImportantNotice; if (shouldShowImportantNotice && noSuggestionsToShow) { - isShowingImportantNotice = mSuggestionStripView.maybeShowImportantNoticeTitle(); - } else { - isShowingImportantNotice = false; + if (mSuggestionStripView.maybeShowImportantNoticeTitle()) { + return; + } } - if (currentSettingsValues.isSuggestionsRequested() && !isShowingImportantNotice) { + if (currentSettingsValues.isCurrentOrientationAllowingSuggestionsPerUserSettings() + // We should clear suggestions if there is no suggestion to show. + || noSuggestionsToShow + || currentSettingsValues.isApplicationSpecifiedCompletionsOn()) { mSuggestionStripView.setSuggestions(suggestedWords, SubtypeLocaleUtils.isRtlLanguage(mSubtypeSwitcher.getCurrentSubtype())); } |