diff options
author | 2010-12-21 18:57:09 -0800 | |
---|---|---|
committer | 2010-12-21 18:57:09 -0800 | |
commit | 23a3b74722e66fe6998b7eb33292ac6a4e10150d (patch) | |
tree | 2e5fcb1a5a8b1407cc4dee168df3a2a47b4a920c /java/src/com/android/inputmethod/latin/CandidateView.java | |
parent | 9aa20e6ad11a6d8bc2ba8fefba6f4e17382b8111 (diff) | |
parent | 9fb8c6dd48dfa4e45827628a866d9b13c4c6c799 (diff) | |
download | latinime-23a3b74722e66fe6998b7eb33292ac6a4e10150d.tar.gz latinime-23a3b74722e66fe6998b7eb33292ac6a4e10150d.tar.xz latinime-23a3b74722e66fe6998b7eb33292ac6a4e10150d.zip |
Merge "Suppress punctuation suggestions if not needed"
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++) { |