diff options
author | 2011-08-08 04:37:09 -0700 | |
---|---|---|
committer | 2011-08-08 04:37:09 -0700 | |
commit | 44beeab4a431a67b5e92bb54904b850c5a192193 (patch) | |
tree | 93faa5aed350ad94ff4ccfb4ecf2e430082e9ed1 /java/src | |
parent | ad7ddca397ec30c5c70150db76bd6f706abab7b3 (diff) | |
parent | bbf25cf25169f640a361370cde5521ffc7789a1b (diff) | |
download | latinime-44beeab4a431a67b5e92bb54904b850c5a192193.tar.gz latinime-44beeab4a431a67b5e92bb54904b850c5a192193.tar.xz latinime-44beeab4a431a67b5e92bb54904b850c5a192193.zip |
Merge "Fix issues with long-press access to more suggestions"
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/CandidateView.java | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/latin/CandidateView.java b/java/src/com/android/inputmethod/latin/CandidateView.java index 1cf093c67..d779c8565 100644 --- a/java/src/com/android/inputmethod/latin/CandidateView.java +++ b/java/src/com/android/inputmethod/latin/CandidateView.java @@ -387,7 +387,7 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo final int countInStrip = mCandidateCountInStrip; setupTexts(suggestions, countInStrip); - + mMoreSuggestionsAvailable = (suggestions.size() > countInStrip); int x = 0; for (int index = 0; index < countInStrip; index++) { final int pos = getWordPosition(index, suggestions); @@ -400,14 +400,12 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo final CharSequence styled = mTexts.get(pos); final TextView word = mWords.get(pos); - if (index == mCenterCandidateIndex && suggestions.size() > countInStrip) { + if (index == mCenterCandidateIndex && mMoreSuggestionsAvailable) { // TODO: This "more suggestions hint" should have nicely designed icon. word.setCompoundDrawablesWithIntrinsicBounds( null, null, null, mMoreCandidateHint); - mMoreSuggestionsAvailable = true; } else { word.setCompoundDrawables(null, null, null, null); - mMoreSuggestionsAvailable = false; } // Disable this candidate if the suggestion is null or empty. @@ -693,6 +691,14 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo mKeyboardView.setVisibility(VISIBLE); } + private void toggleCandidatesPane() { + if (mCandidatesPaneContainer.getVisibility() == VISIBLE) { + closeCandidatesPane(); + } else { + expandCandidatesPane(); + } + } + public void onAutoCorrectionInverted(CharSequence autoCorrectedWord) { final CharSequence inverted = mStripParams.getInvertedText(autoCorrectedWord); if (inverted == null) @@ -770,7 +776,7 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo @Override public boolean onLongClick(View view) { if (mStripParams.mMoreSuggestionsAvailable) { - expandCandidatesPane(); + toggleCandidatesPane(); return true; } return false; |