am 9df51d10: Keep showing important notice when "show correction suggestions" is off

* commit '9df51d10fa6b5b21de564cd93926a88690a98600':
  Keep showing important notice when "show correction suggestions" is off
main
Tadashi G. Takaoka 2014-05-26 05:52:10 +00:00 committed by Android Git Automerger
commit 6f1d3e8a7d
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);