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
main
Tadashi G. Takaoka 2014-05-24 02:28:00 +09:00
parent 4905d83270
commit 9df51d10fa
3 changed files with 16 additions and 7 deletions

View File

@ -258,7 +258,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
if (latinIme == null) { if (latinIme == null) {
return; return;
} }
if (!latinIme.mSettings.getCurrent().isSuggestionStripVisible()) { if (!latinIme.mSettings.getCurrent()
.isCurrentOrientationAllowingSuggestionsPerUserSettings()) {
return; return;
} }
removeMessages(MSG_RESUME_SUGGESTIONS); removeMessages(MSG_RESUME_SUGGESTIONS);
@ -1346,7 +1347,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
currentSettings.mInputAttributes)) { currentSettings.mInputAttributes)) {
return true; return true;
} }
if (!currentSettings.isSuggestionStripVisible()) { if (!currentSettings.isCurrentOrientationAllowingSuggestionsPerUserSettings()) {
return false; return false;
} }
if (currentSettings.isApplicationSpecifiedCompletionsOn()) { if (currentSettings.isApplicationSpecifiedCompletionsOn()) {
@ -1391,8 +1392,14 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
final SettingsValues currentSettings = mSettings.getCurrent(); final SettingsValues currentSettings = mSettings.getCurrent();
final boolean showSuggestions; final boolean showSuggestions;
if (SuggestedWords.EMPTY == suggestedWords || suggestedWords.isPunctuationSuggestions() // May show the important notice when there are no suggestions to show,
|| !currentSettings.isSuggestionsRequested()) { 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( showSuggestions = !mSuggestionStripView.maybeShowImportantNoticeTitle(
currentSettings.mInputAttributes); currentSettings.mInputAttributes);
} else { } else {

View File

@ -1050,7 +1050,8 @@ public final class InputLogic {
} }
} }
} }
if (inputTransaction.mSettingsValues.isSuggestionStripVisible() if (inputTransaction.mSettingsValues
.isCurrentOrientationAllowingSuggestionsPerUserSettings()
&& inputTransaction.mSettingsValues.mSpacingAndPunctuations && inputTransaction.mSettingsValues.mSpacingAndPunctuations
.mCurrentLanguageHasSpaces .mCurrentLanguageHasSpaces
&& !mConnection.isCursorFollowedByWordCharacter( && !mConnection.isCursorFollowedByWordCharacter(

View File

@ -190,10 +190,11 @@ public final class SettingsValues {
public boolean isSuggestionsRequested() { public boolean isSuggestionsRequested() {
return mInputAttributes.mIsSettingsSuggestionStripOn return mInputAttributes.mIsSettingsSuggestionStripOn
&& (mCorrectionEnabled || isSuggestionStripVisible()); && (mCorrectionEnabled
|| isCurrentOrientationAllowingSuggestionsPerUserSettings());
} }
public boolean isSuggestionStripVisible() { public boolean isCurrentOrientationAllowingSuggestionsPerUserSettings() {
return (mSuggestionVisibility == SUGGESTION_VISIBILITY_SHOW_VALUE) return (mSuggestionVisibility == SUGGESTION_VISIBILITY_SHOW_VALUE)
|| (mSuggestionVisibility == SUGGESTION_VISIBILITY_SHOW_ONLY_PORTRAIT_VALUE || (mSuggestionVisibility == SUGGESTION_VISIBILITY_SHOW_ONLY_PORTRAIT_VALUE
&& mDisplayOrientation == Configuration.ORIENTATION_PORTRAIT); && mDisplayOrientation == Configuration.ORIENTATION_PORTRAIT);