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.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/CandidateView.java b/java/src/com/android/inputmethod/latin/CandidateView.java
index 7fcc3d532..bd73c6fb8 100755
--- a/java/src/com/android/inputmethod/latin/CandidateView.java
+++ b/java/src/com/android/inputmethod/latin/CandidateView.java
@@ -107,7 +107,6 @@ public class CandidateView extends View {
}
break;
}
-
}
};
@@ -238,6 +237,8 @@ public class CandidateView extends View {
final boolean typedWordValid = mTypedWordValid;
final int y = (int) (height + mPaint.getTextSize() - mDescent) / 2;
+ boolean existsAutoCompletion = false;
+
for (int i = 0; i < count; i++) {
CharSequence suggestion = mSuggestions.get(i);
if (suggestion == null) continue;
@@ -246,6 +247,7 @@ public class CandidateView extends View {
&& ((i == 1 && !typedWordValid) || (i == 0 && typedWordValid))) {
paint.setTypeface(Typeface.DEFAULT_BOLD);
paint.setColor(mColorRecommended);
+ existsAutoCompletion = true;
} else if (i != 0) {
paint.setColor(mColorOther);
}
@@ -286,6 +288,7 @@ public class CandidateView extends View {
paint.setTypeface(Typeface.DEFAULT);
x += wordWidth;
}
+ mService.onAutoCompletionStateChanged(existsAutoCompletion);
mTotalWidth = x;
if (mTargetScrollX != scrollX) {
scrollToTarget();
@@ -333,6 +336,10 @@ public class CandidateView extends View {
requestLayout();
}
+ public boolean isShowingAddToDictionaryHint() {
+ return mShowingAddToDictionary;
+ }
+
public void showAddToDictionaryHint(CharSequence word) {
ArrayList<CharSequence> suggestions = new ArrayList<CharSequence>();
suggestions.add(word);