From d5b765b3bbceb80b2e145ac7f4d66acbadd1ee4f Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Fri, 15 Jun 2012 03:52:48 +0900 Subject: [PATCH] Do not display punctuation suggestions when bigrams are on. Bug: 6310401 Change-Id: I9d31c48e287aceedaf2f4c5129031ddb31402451 --- java/src/com/android/inputmethod/latin/LatinIME.java | 8 ++++++-- .../inputmethod/latin/suggestions/SuggestionsView.java | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index bfdc1e3c5..15d3a16ef 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -2053,12 +2053,16 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen // showSuggestions will retrieve the word near the cursor, we don't want that here) showSuggestions(suggestedWords, ""); } else { - if (!isShowingPunctuationList()) setPunctuationSuggestions(); + clearSuggestions(); } } public void setPunctuationSuggestions() { - setSuggestions(mSettingsValues.mSuggestPuncList, false); + if (mSettingsValues.mBigramPredictionEnabled) { + clearSuggestions(); + } else { + setSuggestions(mSettingsValues.mSuggestPuncList, false); + } setAutoCorrectionIndicator(false); setSuggestionStripShown(isSuggestionsStripVisible()); } diff --git a/java/src/com/android/inputmethod/latin/suggestions/SuggestionsView.java b/java/src/com/android/inputmethod/latin/suggestions/SuggestionsView.java index 3d593aaa7..14978ce4b 100644 --- a/java/src/com/android/inputmethod/latin/suggestions/SuggestionsView.java +++ b/java/src/com/android/inputmethod/latin/suggestions/SuggestionsView.java @@ -670,7 +670,7 @@ public class SuggestionsView extends RelativeLayout implements OnClickListener, } public void setSuggestions(SuggestedWords suggestedWords) { - if (suggestedWords == null || suggestedWords.size() == 0) + if (suggestedWords == null) return; clear();