Small improvement

pull/209/head
M66B 2 years ago
parent c998dede8e
commit 99fb4d8f17

@ -4,7 +4,7 @@ apply plugin: 'kotlin-android'
apply plugin: 'de.undercouch.download'
def getVersionCode = { -> return 1973 }
def getRevision = { -> return "a" }
def getRevision = { -> return "b" }
def getReleaseName = { -> return "Mei long" }
// https://en.wikipedia.org/wiki/List_of_dinosaur_genera

@ -24,6 +24,7 @@ import android.content.SharedPreferences;
import android.text.Editable;
import android.text.Spanned;
import android.text.TextPaint;
import android.text.TextUtils;
import android.text.style.SuggestionSpan;
import android.widget.EditText;
@ -62,6 +63,9 @@ public class LanguageTool {
}
static List<Suggestion> getSuggestions(Context context, CharSequence text) throws IOException, JSONException {
if (TextUtils.isEmpty(text))
return new ArrayList<>();
// https://languagetool.org/http-api/swagger-ui/#!/default/post_check
String request =
"text=" + URLEncoder.encode(text.toString(), StandardCharsets.UTF_8.name()) +

Loading…
Cancel
Save