am 129ca9e7: [IL117] Simplification

* commit '129ca9e7ebc9316a43ae716cc6ec44e1e17a35fa':
  [IL117] Simplification
main
Jean Chalard 2014-03-04 01:38:47 -08:00 committed by Android Git Automerger
commit fa653682a8
1 changed files with 12 additions and 12 deletions

View File

@ -1368,13 +1368,23 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
public void setSuggestedWords(final SuggestedWords suggestedWords, public void setSuggestedWords(final SuggestedWords suggestedWords,
final boolean isSuggestionStripVisible) { final boolean isSuggestionStripVisible) {
mInputLogic.setSuggestedWords(suggestedWords); mInputLogic.setSuggestedWords(suggestedWords);
// TODO: Modify this when we support suggestions with hard keyboard
if (!hasSuggestionStripView()) { if (!hasSuggestionStripView()) {
return; return;
} }
mKeyboardSwitcher.onAutoCorrectionStateChanged(suggestedWords.mWillAutoCorrect);
if (!onEvaluateInputViewShown()) {
return;
}
if (!isSuggestionStripVisible) {
mSuggestionStripView.setVisibility(isFullscreenMode() ? View.GONE : View.INVISIBLE);
return;
}
mSuggestionStripView.setVisibility(View.VISIBLE);
final SettingsValues currentSettings = mSettings.getCurrent(); final SettingsValues currentSettings = mSettings.getCurrent();
final boolean showSuggestions; final boolean showSuggestions;
if (SuggestedWords.EMPTY == suggestedWords if (SuggestedWords.EMPTY == suggestedWords || suggestedWords.isPunctuationSuggestions()
|| suggestedWords.isPunctuationSuggestions()
|| !currentSettings.isSuggestionsRequested()) { || !currentSettings.isSuggestionsRequested()) {
showSuggestions = !mSuggestionStripView.maybeShowImportantNoticeTitle( showSuggestions = !mSuggestionStripView.maybeShowImportantNoticeTitle(
currentSettings.mInputAttributes); currentSettings.mInputAttributes);
@ -1385,16 +1395,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mSuggestionStripView.setSuggestions(suggestedWords, mSuggestionStripView.setSuggestions(suggestedWords,
SubtypeLocaleUtils.isRtlLanguage(mSubtypeSwitcher.getCurrentSubtype())); SubtypeLocaleUtils.isRtlLanguage(mSubtypeSwitcher.getCurrentSubtype()));
} }
mKeyboardSwitcher.onAutoCorrectionStateChanged(suggestedWords.mWillAutoCorrect);
// TODO: Modify this when we support suggestions with hard keyboard
if (!onEvaluateInputViewShown() || !hasSuggestionStripView()) {
return;
}
if (isSuggestionStripVisible) {
mSuggestionStripView.setVisibility(View.VISIBLE);
} else {
mSuggestionStripView.setVisibility(isFullscreenMode() ? View.GONE : View.INVISIBLE);
}
} }
// TODO[IL]: Move this out of LatinIME. // TODO[IL]: Move this out of LatinIME.