Skip to content

Commit e670101

Browse files
author
Gilles Debunne
committed
Bug 5384675: Color in add to dictionary
Change-Id: Ibb89265a90d6b598927dec2bcf45a8c02388b5f0
1 parent 1c6ac4e commit e670101

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

core/java/android/widget/TextView.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9900,6 +9900,8 @@ private void updateSuggestions() {
99009900
suggestionInfo.suggestionIndex = ADD_TO_DICTIONARY;
99019901
suggestionInfo.text.replace(0, suggestionInfo.text.length(),
99029902
getContext().getString(com.android.internal.R.string.addToDictionary));
9903+
suggestionInfo.text.setSpan(suggestionInfo.highlightSpan, 0, 0,
9904+
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
99039905

99049906
mNumberOfSuggestions++;
99059907
}
@@ -9911,6 +9913,8 @@ private void updateSuggestions() {
99119913
suggestionInfo.suggestionIndex = DELETE_TEXT;
99129914
suggestionInfo.text.replace(0, suggestionInfo.text.length(),
99139915
getContext().getString(com.android.internal.R.string.deleteText));
9916+
suggestionInfo.text.setSpan(suggestionInfo.highlightSpan, 0, 0,
9917+
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
99149918
mNumberOfSuggestions++;
99159919

99169920
if (mSuggestionRangeSpan == null) mSuggestionRangeSpan = new SuggestionRangeSpan();
@@ -9939,8 +9943,7 @@ private void highlightTextDifferences(SuggestionInfo suggestionInfo, int unionSt
99399943
suggestionInfo.suggestionStart = spanStart - unionStart;
99409944
suggestionInfo.suggestionEnd = suggestionInfo.suggestionStart
99419945
+ suggestionInfo.text.length();
9942-
9943-
suggestionInfo.text.clearSpans();
9946+
99449947
suggestionInfo.text.setSpan(suggestionInfo.highlightSpan, 0,
99459948
suggestionInfo.text.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
99469949

0 commit comments

Comments
 (0)