LT improvements

This commit is contained in:
M66B 2023-09-12 22:21:01 +02:00
parent 8d9801c09a
commit e6df71d9ba
1 changed files with 3 additions and 4 deletions

View File

@ -289,12 +289,11 @@ public class LanguageTool {
suggestion.replacements.add(jreplacement.getString("value"));
}
if (suggestion.replacements.size() > 0)
result.add(suggestion);
JSONObject jrule = jmatch.optJSONObject("rule");
if (jrule != null)
suggestion.issueType = jrule.optString("issueType");
result.add(suggestion);
}
return result;
@ -484,7 +483,7 @@ public class LanguageTool {
public SuggestionSpanEx(Context context, String[] suggestions, boolean misspelled) {
super(context, suggestions,
misspelled || Build.VERSION.SDK_INT < Build.VERSION_CODES.S
? SuggestionSpan.FLAG_MISSPELLED
? SuggestionSpan.FLAG_MISSPELLED | SuggestionSpan.FLAG_EASY_CORRECT
: SuggestionSpan.FLAG_GRAMMAR_ERROR);
highlightColor = Helper.resolveColor(context, android.R.attr.textColorHighlight);
underlineColor = (misspelled ? Color.RED : highlightColor);