Merge "Bug 5384535: Underline for typo even if there are no suggestions"
This commit is contained in:
committed by
Android (Google) Code Review
commit
9fb46925d3
@@ -185,18 +185,16 @@ public class SpellChecker implements SpellCheckerSessionListener {
|
||||
|
||||
if (!isInDictionary && looksLikeTypo) {
|
||||
String[] suggestions = getSuggestions(suggestionsInfo);
|
||||
if (suggestions.length > 0) {
|
||||
SuggestionSpan suggestionSpan = new SuggestionSpan(
|
||||
mTextView.getContext(), suggestions,
|
||||
SuggestionSpan.FLAG_EASY_CORRECT |
|
||||
SuggestionSpan.FLAG_MISSPELLED);
|
||||
final int start = editable.getSpanStart(spellCheckSpan);
|
||||
final int end = editable.getSpanEnd(spellCheckSpan);
|
||||
editable.setSpan(suggestionSpan, start, end,
|
||||
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
// TODO limit to the word rectangle region
|
||||
mTextView.invalidate();
|
||||
}
|
||||
SuggestionSpan suggestionSpan = new SuggestionSpan(
|
||||
mTextView.getContext(), suggestions,
|
||||
SuggestionSpan.FLAG_EASY_CORRECT |
|
||||
SuggestionSpan.FLAG_MISSPELLED);
|
||||
final int start = editable.getSpanStart(spellCheckSpan);
|
||||
final int end = editable.getSpanEnd(spellCheckSpan);
|
||||
editable.setSpan(suggestionSpan, start, end,
|
||||
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
// TODO limit to the word rectangle region
|
||||
mTextView.invalidate();
|
||||
}
|
||||
editable.removeSpan(spellCheckSpan);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user