diff options
Diffstat (limited to 'java/src/com/android/inputmethod/latin/CandidateView.java')
-rwxr-xr-x | java/src/com/android/inputmethod/latin/CandidateView.java | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/latin/CandidateView.java b/java/src/com/android/inputmethod/latin/CandidateView.java index ae45001b8..e0de96543 100755 --- a/java/src/com/android/inputmethod/latin/CandidateView.java +++ b/java/src/com/android/inputmethod/latin/CandidateView.java @@ -83,7 +83,6 @@ public class CandidateView extends View { private int mDescent; private boolean mScrolled; private boolean mShowingAddToDictionary; - private CharSequence mWordToAddToDictionary; private CharSequence mAddToDictionaryHint; private int mTargetScrollX; @@ -167,7 +166,7 @@ public class CandidateView extends View { if (scrollX < 0) { scrollX = 0; } - if (distanceX > 0 && scrollX + width > mTotalWidth) { + if (distanceX > 0 && scrollX + width > mTotalWidth) { scrollX -= (int) distanceX; } mTargetScrollX = scrollX; @@ -220,7 +219,6 @@ public class CandidateView extends View { } int x = 0; final int count = Math.min(mSuggestions.size(), MAX_SUGGESTIONS); - final int width = getWidth(); final Rect bgPadding = mBgPadding; final Paint paint = mPaint; final int touchX = mTouchX; @@ -325,7 +323,6 @@ public class CandidateView extends View { } public void showAddToDictionaryHint(CharSequence word) { - mWordToAddToDictionary = word; ArrayList<CharSequence> suggestions = new ArrayList<CharSequence>(); suggestions.add(word); suggestions.add(mAddToDictionaryHint); @@ -376,8 +373,14 @@ public class CandidateView extends View { mScrolled = true; } } - + + /* package */ List<CharSequence> getSuggestions() { + return mSuggestions; + } + public void clear() { + // Don't call mSuggestions.clear() because it's being used for logging + // in LatinIME.pickSuggestionManually(). mSuggestions = EMPTY_LIST; mTouchX = OUT_OF_BOUNDS; mSelectedString = null; @@ -412,7 +415,11 @@ public class CandidateView extends View { if (y <= 0) { // Fling up!? if (mSelectedString != null) { + // If there are completions from the application, we don't change the state to + // STATE_PICKED_SUGGESTION if (!mShowingCompletions) { + // This "acceptedSuggestion" will not be counted as a word because + // it will be counted in pickSuggestion instead. TextEntryState.acceptedSuggestion(mSuggestions.get(0), mSelectedString); } |