aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinIME.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2014-09-18 23:03:56 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-09-18 23:03:56 +0000
commitd7268f88da087f7a0be8029bf188bf7b4b4f12b7 (patch)
treeac3af83406a9493f3bf8773057a38ddcb068e1b5 /java/src/com/android/inputmethod/latin/LatinIME.java
parent233a2f21c38a27049fa3b03af699593f629d1681 (diff)
parent885dedd0f600b5a2278b7c4f11644d2cc2d4b699 (diff)
downloadlatinime-d7268f88da087f7a0be8029bf188bf7b4b4f12b7.tar.gz
latinime-d7268f88da087f7a0be8029bf188bf7b4b4f12b7.tar.xz
latinime-d7268f88da087f7a0be8029bf188bf7b4b4f12b7.zip
am 885dedd0: am 00e01837: Merge "(DO NOT MERGE) Fix showing important notice even at beginning of sentence" into lmp-dev
* commit '885dedd0f600b5a2278b7c4f11644d2cc2d4b699': (DO NOT MERGE) 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.java14
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 81953221e..ba7f967f1 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1488,19 +1488,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()));
}