diff options
| author | 2011-09-30 10:58:10 -0700 | |
|---|---|---|
| committer | 2011-09-30 10:58:10 -0700 | |
| commit | 9fb46925d33643f830dfc2cf5a15601eb416143b (patch) | |
| tree | 248f54890d3b429d442ffa03ca11c9bac745e81b | |
| parent | 5b92a451c0004b53e8c10537c5254c9e6d047d19 (diff) | |
| parent | 1dd7e534e7870a4d2799e06dafdeffa932989f24 (diff) | |
Merge "Bug 5384535: Underline for typo even if there are no suggestions"
| -rw-r--r-- | core/java/android/widget/SpellChecker.java | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/core/java/android/widget/SpellChecker.java b/core/java/android/widget/SpellChecker.java index e9eec100cab3..ac9535a425d8 100644 --- a/core/java/android/widget/SpellChecker.java +++ b/core/java/android/widget/SpellChecker.java @@ -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); } |