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.java25
1 files changed, 5 insertions, 20 deletions
diff --git a/java/src/com/android/inputmethod/latin/CandidateView.java b/java/src/com/android/inputmethod/latin/CandidateView.java
index 3a199bbaf..8355d6738 100755
--- a/java/src/com/android/inputmethod/latin/CandidateView.java
+++ b/java/src/com/android/inputmethod/latin/CandidateView.java
@@ -167,7 +167,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;
@@ -412,7 +412,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);
}
@@ -447,25 +451,6 @@ public class CandidateView extends View {
}
return true;
}
-
- /**
- * For flick through from keyboard, call this method with the x coordinate of the flick
- * gesture.
- * @param x
- */
- public void takeSuggestionAt(float x) {
- mTouchX = (int) x;
- // To detect candidate
- onDraw(null);
- if (mSelectedString != null) {
- if (!mShowingCompletions) {
- TextEntryState.acceptedSuggestion(mSuggestions.get(0), mSelectedString);
- }
- mService.pickSuggestionManually(mSelectedIndex, mSelectedString);
- }
- invalidate();
- mHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_REMOVE_THROUGH_PREVIEW), 200);
- }
private void hidePreview() {
mCurrentWordIndex = OUT_OF_BOUNDS;