aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2010-09-30 23:24:11 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-09-30 23:24:11 -0700
commit3750d56d73dd1c788ae8df54140c31e06bd9b99f (patch)
tree2e41f2cbd792d17ffe57233abd3c71bfba1507a1 /java/src
parent3d9d2b1b3cc32f1007b1bd42c3ffd3054781a8b4 (diff)
parent8e6a92703d1bdf530d32c8cdf90deefc6bc3a878 (diff)
downloadlatinime-3750d56d73dd1c788ae8df54140c31e06bd9b99f.tar.gz
latinime-3750d56d73dd1c788ae8df54140c31e06bd9b99f.tar.xz
latinime-3750d56d73dd1c788ae8df54140c31e06bd9b99f.zip
am 8e6a9270: am 18d536f6: Merge "Dismiss orange highlight after suggestion has been selected" into gingerbread
Merge commit '8e6a92703d1bdf530d32c8cdf90deefc6bc3a878' * commit '8e6a92703d1bdf530d32c8cdf90deefc6bc3a878': Dismiss orange highlight after suggestion has been selected
Diffstat (limited to 'java/src')
-rwxr-xr-xjava/src/com/android/inputmethod/latin/CandidateView.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/java/src/com/android/inputmethod/latin/CandidateView.java b/java/src/com/android/inputmethod/latin/CandidateView.java
index 89afd168e..68f288925 100755
--- a/java/src/com/android/inputmethod/latin/CandidateView.java
+++ b/java/src/com/android/inputmethod/latin/CandidateView.java
@@ -40,14 +40,15 @@ import java.util.List;
public class CandidateView extends View {
- private static final int OUT_OF_BOUNDS = -1;
+ private static final int OUT_OF_BOUNDS_WORD_INDEX = -1;
+ private static final int OUT_OF_BOUNDS_X_COORD = -1;
private LatinIME mService;
private final ArrayList<CharSequence> mSuggestions = new ArrayList<CharSequence>();
private boolean mShowingCompletions;
private CharSequence mSelectedString;
private int mSelectedIndex;
- private int mTouchX = OUT_OF_BOUNDS;
+ private int mTouchX = OUT_OF_BOUNDS_X_COORD;
private final Drawable mSelectionHighlight;
private boolean mTypedWordValid;
@@ -256,8 +257,8 @@ public class CandidateView extends View {
mWordX[i] = x;
- if (touchX + scrollX >= x && touchX + scrollX < x + wordWidth && !scrolled &&
- touchX != OUT_OF_BOUNDS) {
+ if (touchX != OUT_OF_BOUNDS_X_COORD && !scrolled
+ && touchX + scrollX >= x && touchX + scrollX < x + wordWidth) {
if (canvas != null && !mShowingAddToDictionary) {
canvas.translate(x, 0);
mSelectionHighlight.setBounds(0, bgPadding.top, wordWidth, height);
@@ -360,7 +361,7 @@ public class CandidateView extends View {
// Don't call mSuggestions.clear() because it's being used for logging
// in LatinIME.pickSuggestionManually().
mSuggestions.clear();
- mTouchX = OUT_OF_BOUNDS;
+ mTouchX = OUT_OF_BOUNDS_X_COORD;
mSelectedString = null;
mSelectedIndex = -1;
mShowingAddToDictionary = false;
@@ -429,7 +430,8 @@ public class CandidateView extends View {
}
private void hidePreview() {
- mCurrentWordIndex = OUT_OF_BOUNDS;
+ mTouchX = OUT_OF_BOUNDS_X_COORD;
+ mCurrentWordIndex = OUT_OF_BOUNDS_WORD_INDEX;
mPreviewPopup.dismiss();
}
@@ -438,7 +440,7 @@ public class CandidateView extends View {
mCurrentWordIndex = wordIndex;
// If index changed or changing text
if (oldWordIndex != mCurrentWordIndex || altText != null) {
- if (wordIndex == OUT_OF_BOUNDS) {
+ if (wordIndex == OUT_OF_BOUNDS_WORD_INDEX) {
hidePreview();
} else {
CharSequence word = altText != null? altText : mSuggestions.get(wordIndex);