From 4f6cf258fe208329247ade7a6701ac9709820717 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Thu, 15 Mar 2012 14:08:04 +0900 Subject: [PATCH] Use the unique flag in SuggestionsView Also, the first word in a sugestions list can never be obsolete. Change-Id: Ib21439aac8db4e6ce5b15b7a2aabe4222bc354db --- .../src/com/android/inputmethod/compat/SuggestionSpanUtils.java | 1 - .../android/inputmethod/latin/suggestions/SuggestionsView.java | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java b/java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java index f476d83b4..e82d91411 100644 --- a/java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java +++ b/java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java @@ -93,7 +93,6 @@ public class SuggestionSpanUtils { CharSequence pickedWord, SuggestedWords suggestedWords) { if (TextUtils.isEmpty(pickedWord) || CONSTRUCTOR_SuggestionSpan == null || suggestedWords == null || suggestedWords.size() == 0 - || suggestedWords.getInfo(0).isObsoleteSuggestedWord() || OBJ_SUGGESTIONS_MAX_SIZE == null) { return pickedWord; } diff --git a/java/src/com/android/inputmethod/latin/suggestions/SuggestionsView.java b/java/src/com/android/inputmethod/latin/suggestions/SuggestionsView.java index 812376de0..b8f92e40f 100644 --- a/java/src/com/android/inputmethod/latin/suggestions/SuggestionsView.java +++ b/java/src/com/android/inputmethod/latin/suggestions/SuggestionsView.java @@ -341,7 +341,7 @@ public class SuggestionsView extends RelativeLayout implements OnClickListener, final SuggestedWordInfo info = (pos < suggestedWords.size()) ? suggestedWords.getInfo(pos) : null; - if (info != null && info.isObsoleteSuggestedWord()) { + if (suggestedWords.mIsObsoleteSuggestions && isSuggested) { return applyAlpha(color, mAlphaObsoleted); } else { return color;