Merge "Bug 5384675: Color in add to dictionary"
This commit is contained in:
committed by
Android (Google) Code Review
commit
eba3d92341
@@ -9908,6 +9908,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
|
|||||||
suggestionInfo.suggestionIndex = ADD_TO_DICTIONARY;
|
suggestionInfo.suggestionIndex = ADD_TO_DICTIONARY;
|
||||||
suggestionInfo.text.replace(0, suggestionInfo.text.length(),
|
suggestionInfo.text.replace(0, suggestionInfo.text.length(),
|
||||||
getContext().getString(com.android.internal.R.string.addToDictionary));
|
getContext().getString(com.android.internal.R.string.addToDictionary));
|
||||||
|
suggestionInfo.text.setSpan(suggestionInfo.highlightSpan, 0, 0,
|
||||||
|
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||||
|
|
||||||
mNumberOfSuggestions++;
|
mNumberOfSuggestions++;
|
||||||
}
|
}
|
||||||
@@ -9919,6 +9921,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
|
|||||||
suggestionInfo.suggestionIndex = DELETE_TEXT;
|
suggestionInfo.suggestionIndex = DELETE_TEXT;
|
||||||
suggestionInfo.text.replace(0, suggestionInfo.text.length(),
|
suggestionInfo.text.replace(0, suggestionInfo.text.length(),
|
||||||
getContext().getString(com.android.internal.R.string.deleteText));
|
getContext().getString(com.android.internal.R.string.deleteText));
|
||||||
|
suggestionInfo.text.setSpan(suggestionInfo.highlightSpan, 0, 0,
|
||||||
|
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||||
mNumberOfSuggestions++;
|
mNumberOfSuggestions++;
|
||||||
|
|
||||||
if (mSuggestionRangeSpan == null) mSuggestionRangeSpan = new SuggestionRangeSpan();
|
if (mSuggestionRangeSpan == null) mSuggestionRangeSpan = new SuggestionRangeSpan();
|
||||||
@@ -9947,8 +9951,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
|
|||||||
suggestionInfo.suggestionStart = spanStart - unionStart;
|
suggestionInfo.suggestionStart = spanStart - unionStart;
|
||||||
suggestionInfo.suggestionEnd = suggestionInfo.suggestionStart
|
suggestionInfo.suggestionEnd = suggestionInfo.suggestionStart
|
||||||
+ suggestionInfo.text.length();
|
+ suggestionInfo.text.length();
|
||||||
|
|
||||||
suggestionInfo.text.clearSpans();
|
|
||||||
suggestionInfo.text.setSpan(suggestionInfo.highlightSpan, 0,
|
suggestionInfo.text.setSpan(suggestionInfo.highlightSpan, 0,
|
||||||
suggestionInfo.text.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
suggestionInfo.text.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user