Merge "Bug 5384675: Color in add to dictionary"

This commit is contained in:
Gilles Debunne
2011-09-30 10:58:30 -07:00
committed by Android (Google) Code Review

View File

@@ -9908,6 +9908,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
suggestionInfo.suggestionIndex = ADD_TO_DICTIONARY;
suggestionInfo.text.replace(0, suggestionInfo.text.length(),
getContext().getString(com.android.internal.R.string.addToDictionary));
suggestionInfo.text.setSpan(suggestionInfo.highlightSpan, 0, 0,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
mNumberOfSuggestions++;
}
@@ -9919,6 +9921,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
suggestionInfo.suggestionIndex = DELETE_TEXT;
suggestionInfo.text.replace(0, suggestionInfo.text.length(),
getContext().getString(com.android.internal.R.string.deleteText));
suggestionInfo.text.setSpan(suggestionInfo.highlightSpan, 0, 0,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
mNumberOfSuggestions++;
if (mSuggestionRangeSpan == null) mSuggestionRangeSpan = new SuggestionRangeSpan();
@@ -9947,8 +9951,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
suggestionInfo.suggestionStart = spanStart - unionStart;
suggestionInfo.suggestionEnd = suggestionInfo.suggestionStart
+ suggestionInfo.text.length();
suggestionInfo.text.clearSpans();
suggestionInfo.text.setSpan(suggestionInfo.highlightSpan, 0,
suggestionInfo.text.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);