aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/CandidateView.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/com/android/inputmethod/latin/CandidateView.java')
-rwxr-xr-xjava/src/com/android/inputmethod/latin/CandidateView.java17
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 93966a86c..faf72c996 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;
@@ -178,7 +177,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;
@@ -231,7 +230,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;
@@ -336,7 +334,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);
@@ -387,8 +384,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;
@@ -423,7 +426,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);
}