aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorsatok <satok@google.com>2011-08-26 19:04:54 +0900
committersatok <satok@google.com>2011-08-26 19:12:18 +0900
commitadd3e053797d7d2355c61160ab746f7dfeb92aef (patch)
treefa7e4feeab6f6a316a4fbc7a1288e560e54943ce /java
parent7fe084a85620bdb6a849c65dade1e8db36b49e0e (diff)
downloadlatinime-add3e053797d7d2355c61160ab746f7dfeb92aef.tar.gz
latinime-add3e053797d7d2355c61160ab746f7dfeb92aef.tar.xz
latinime-add3e053797d7d2355c61160ab746f7dfeb92aef.zip
Do not put the suggestion span for obsolete suggestions.
Bug: 5219037 Change-Id: I0300fbc7e1cc97f0f8ba4d21e0e699d9fe66ed76
Diffstat (limited to 'java')
-rw-r--r--java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java3
-rw-r--r--java/src/com/android/inputmethod/latin/CandidateView.java2
-rw-r--r--java/src/com/android/inputmethod/latin/SuggestedWords.java2
3 files changed, 4 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java b/java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java
index 4929dd948..5c54fa548 100644
--- a/java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java
+++ b/java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java
@@ -53,7 +53,8 @@ public class SuggestionSpanUtils {
public static CharSequence getTextWithSuggestionSpan(Context context,
CharSequence pickedWord, SuggestedWords suggestedWords) {
if (TextUtils.isEmpty(pickedWord) || CONSTRUCTOR_SuggestionSpan == null
- || suggestedWords == null || suggestedWords.size() == 0) {
+ || suggestedWords == null || suggestedWords.size() == 0
+ || suggestedWords.getInfo(0).isObsoleteSuggestedWord()) {
return pickedWord;
}
diff --git a/java/src/com/android/inputmethod/latin/CandidateView.java b/java/src/com/android/inputmethod/latin/CandidateView.java
index 85870f38e..bc626072a 100644
--- a/java/src/com/android/inputmethod/latin/CandidateView.java
+++ b/java/src/com/android/inputmethod/latin/CandidateView.java
@@ -366,7 +366,7 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
final SuggestedWordInfo info = (pos < suggestions.size())
? suggestions.getInfo(pos) : null;
- if (info != null && info.isPreviousSuggestedWord()) {
+ if (info != null && info.isObsoleteSuggestedWord()) {
return applyAlpha(color, 0.5f);
} else {
return color;
diff --git a/java/src/com/android/inputmethod/latin/SuggestedWords.java b/java/src/com/android/inputmethod/latin/SuggestedWords.java
index c1c46fa47..b177d144a 100644
--- a/java/src/com/android/inputmethod/latin/SuggestedWords.java
+++ b/java/src/com/android/inputmethod/latin/SuggestedWords.java
@@ -199,7 +199,7 @@ public class SuggestedWords {
}
}
- public boolean isPreviousSuggestedWord () {
+ public boolean isObsoleteSuggestedWord () {
return mPreviousSuggestedWord;
}
}