diff options
author | 2010-12-19 17:32:26 +0900 | |
---|---|---|
committer | 2010-12-22 01:48:20 +0900 | |
commit | 9fb8c6dd48dfa4e45827628a866d9b13c4c6c799 (patch) | |
tree | 55b8a99409634bf53e0af55873ee4abf45b0ea0e /java/src/com/android/inputmethod/latin/CandidateView.java | |
parent | baf83886be975d804eda3e1519b7255026e5163e (diff) | |
download | latinime-9fb8c6dd48dfa4e45827628a866d9b13c4c6c799.tar.gz latinime-9fb8c6dd48dfa4e45827628a866d9b13c4c6c799.tar.xz latinime-9fb8c6dd48dfa4e45827628a866d9b13c4c6c799.zip |
Suppress punctuation suggestions if not needed
Bug: 3294256
Bug: 3284745
Change-Id: I77d54cbfcc2e809315bab59ecb808ae944982501
Diffstat (limited to 'java/src/com/android/inputmethod/latin/CandidateView.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/CandidateView.java | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/java/src/com/android/inputmethod/latin/CandidateView.java b/java/src/com/android/inputmethod/latin/CandidateView.java index 3f47ea370..30f4a59f9 100644 --- a/java/src/com/android/inputmethod/latin/CandidateView.java +++ b/java/src/com/android/inputmethod/latin/CandidateView.java @@ -82,7 +82,7 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo hidePreview(); break; case MSG_UPDATE_SUGGESTION: - updateSuggestions((SuggestedWords)msg.obj); + updateSuggestions(); break; } } @@ -96,9 +96,9 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo removeMessages(MSG_HIDE_PREVIEW); } - public void postUpdateSuggestions(SuggestedWords suggestions) { + public void postUpdateSuggestions() { cancelUpdateSuggestions(); - sendMessageDelayed(obtainMessage(MSG_UPDATE_SUGGESTION, suggestions), + sendMessageDelayed(obtainMessage(MSG_UPDATE_SUGGESTION), DELAY_UPDATE_SUGGESTION); } @@ -162,20 +162,19 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo } public void setSuggestions(SuggestedWords suggestions) { - // Don't update suggestions when there is only one suggestion found. - // Empty (size zero) suggestions will be passed in order to clear candidate view. - if (suggestions == null || suggestions.size() == 1) + if (suggestions == null) return; + mSuggestions = suggestions; if (mShowingAutoCorrectionInverted) { - mHandler.postUpdateSuggestions(suggestions); + mHandler.postUpdateSuggestions(); } else { - updateSuggestions(suggestions); + updateSuggestions(); } } - private void updateSuggestions(SuggestedWords suggestions) { + private void updateSuggestions() { + final SuggestedWords suggestions = mSuggestions; clear(); - mSuggestions = suggestions; final int count = suggestions.size(); final Object[] debugInfo = suggestions.mDebugInfo; for (int i = 0; i < count; i++) { |