diff options
author | 2014-05-24 02:28:00 +0900 | |
---|---|---|
committer | 2014-05-26 14:11:41 +0900 | |
commit | 9df51d10fa6b5b21de564cd93926a88690a98600 (patch) | |
tree | e23358ae3b457421868e9727bedc84f5502b0d05 /java/src | |
parent | 4905d83270720ce9b9121595277dae6ba8102f16 (diff) | |
download | latinime-9df51d10fa6b5b21de564cd93926a88690a98600.tar.gz latinime-9df51d10fa6b5b21de564cd93926a88690a98600.tar.xz latinime-9df51d10fa6b5b21de564cd93926a88690a98600.zip |
Keep showing important notice when "show correction suggestions" is off
When
1. The important notice message is shown on the suggestions strip.
2. And the "Show correction suggestions" settings is off.
we will keep showing the important notice message on the suggestion
strip.
Bug: 13741460
Change-Id: I411007ab1e5e6959b6cdba7a6601a84635259313
Diffstat (limited to 'java/src')
3 files changed, 16 insertions, 7 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 1e1d10931..aeae6aab4 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -258,7 +258,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen if (latinIme == null) { return; } - if (!latinIme.mSettings.getCurrent().isSuggestionStripVisible()) { + if (!latinIme.mSettings.getCurrent() + .isCurrentOrientationAllowingSuggestionsPerUserSettings()) { return; } removeMessages(MSG_RESUME_SUGGESTIONS); @@ -1346,7 +1347,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen currentSettings.mInputAttributes)) { return true; } - if (!currentSettings.isSuggestionStripVisible()) { + if (!currentSettings.isCurrentOrientationAllowingSuggestionsPerUserSettings()) { return false; } if (currentSettings.isApplicationSpecifiedCompletionsOn()) { @@ -1391,8 +1392,14 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen final SettingsValues currentSettings = mSettings.getCurrent(); final boolean showSuggestions; - if (SuggestedWords.EMPTY == suggestedWords || suggestedWords.isPunctuationSuggestions() - || !currentSettings.isSuggestionsRequested()) { + // May show the important notice when there are no suggestions to show, + if (SuggestedWords.EMPTY == suggestedWords + // or the suggestion strip is expected to show punctuation suggestions, + || suggestedWords.isPunctuationSuggestions() + // or it's not requested to show suggestions by the input field, + || !currentSettings.isSuggestionsRequested() + // or the "show correction suggestions" settings is off by users preference. + || !currentSettings.isCurrentOrientationAllowingSuggestionsPerUserSettings()) { showSuggestions = !mSuggestionStripView.maybeShowImportantNoticeTitle( currentSettings.mInputAttributes); } else { diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java index 23d65f181..457936931 100644 --- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java +++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java @@ -1050,7 +1050,8 @@ public final class InputLogic { } } } - if (inputTransaction.mSettingsValues.isSuggestionStripVisible() + if (inputTransaction.mSettingsValues + .isCurrentOrientationAllowingSuggestionsPerUserSettings() && inputTransaction.mSettingsValues.mSpacingAndPunctuations .mCurrentLanguageHasSpaces && !mConnection.isCursorFollowedByWordCharacter( diff --git a/java/src/com/android/inputmethod/latin/settings/SettingsValues.java b/java/src/com/android/inputmethod/latin/settings/SettingsValues.java index 58ef75b96..6c6e79e0f 100644 --- a/java/src/com/android/inputmethod/latin/settings/SettingsValues.java +++ b/java/src/com/android/inputmethod/latin/settings/SettingsValues.java @@ -190,10 +190,11 @@ public final class SettingsValues { public boolean isSuggestionsRequested() { return mInputAttributes.mIsSettingsSuggestionStripOn - && (mCorrectionEnabled || isSuggestionStripVisible()); + && (mCorrectionEnabled + || isCurrentOrientationAllowingSuggestionsPerUserSettings()); } - public boolean isSuggestionStripVisible() { + public boolean isCurrentOrientationAllowingSuggestionsPerUserSettings() { return (mSuggestionVisibility == SUGGESTION_VISIBILITY_SHOW_VALUE) || (mSuggestionVisibility == SUGGESTION_VISIBILITY_SHOW_ONLY_PORTRAIT_VALUE && mDisplayOrientation == Configuration.ORIENTATION_PORTRAIT); |