diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java
index c3f384c122..6d288fcfbd 100644
--- a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java
+++ b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java
@@ -122,6 +122,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private TextView tvFtsPro;
private Spinner spLanguage;
private SwitchCompat swLanguageTool;
+ private SwitchCompat swLanguageToolPicky;
private TextView tvLanguageToolPrivacy;
private ImageButton ibLanguageTool;
private SwitchCompat swDeepL;
@@ -241,7 +242,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private final static String[] RESET_OPTIONS = new String[]{
"sort_answers", "shortcuts", "fts",
"classification", "class_min_probability", "class_min_difference",
- "language", "lt_enabled", "deepl_enabled", "vt_enabled", "vt_apikey", "send_enabled", "send_host",
+ "language", "lt_enabled", "lt_picky", "deepl_enabled", "vt_enabled", "vt_apikey", "send_enabled", "send_host",
"updates", "weekly", "show_changelog",
"crash_reports", "cleanup_attachments",
"watchdog", "experiments", "main_log", "main_log_memory", "protocol", "log_level", "debug", "leak_canary",
@@ -326,6 +327,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
tvFtsPro = view.findViewById(R.id.tvFtsPro);
spLanguage = view.findViewById(R.id.spLanguage);
swLanguageTool = view.findViewById(R.id.swLanguageTool);
+ swLanguageToolPicky = view.findViewById(R.id.swLanguageToolPicky);
tvLanguageToolPrivacy = view.findViewById(R.id.tvLanguageToolPrivacy);
ibLanguageTool = view.findViewById(R.id.ibLanguageTool);
swDeepL = view.findViewById(R.id.swDeepL);
@@ -633,6 +635,14 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("lt_enabled", checked).apply();
+ swLanguageToolPicky.setEnabled(checked);
+ }
+ });
+
+ swLanguageToolPicky.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+ @Override
+ public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
+ prefs.edit().putBoolean("lt_picky", checked).apply();
}
});
@@ -1996,6 +2006,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
spLanguage.setSelection(selected);
swLanguageTool.setChecked(prefs.getBoolean("lt_enabled", false));
+ swLanguageToolPicky.setChecked(prefs.getBoolean("lt_picky", false));
+ swLanguageToolPicky.setEnabled(swLanguageTool.isChecked());
swDeepL.setChecked(prefs.getBoolean("deepl_enabled", false));
swVirusTotal.setChecked(prefs.getBoolean("vt_enabled", false));
etVirusTotal.setText(prefs.getString("vt_apikey", null));
diff --git a/app/src/main/java/eu/faircode/email/LanguageTool.java b/app/src/main/java/eu/faircode/email/LanguageTool.java
index 5181d376ae..a19be99547 100644
--- a/app/src/main/java/eu/faircode/email/LanguageTool.java
+++ b/app/src/main/java/eu/faircode/email/LanguageTool.java
@@ -76,6 +76,12 @@ public class LanguageTool {
if (code != null)
request += "&preferredVariants=" + code;
+ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
+ boolean lt_picky = prefs.getBoolean("lt_picky", false);
+
+ if (lt_picky)
+ request += "&level=picky";
+
Log.i("LT locale=" + locale + " request=" + request);
URL url = new URL(LT_URI + "check");
diff --git a/app/src/main/res/layout/fragment_options_misc.xml b/app/src/main/res/layout/fragment_options_misc.xml
index 9cf057a0be..be705e2de2 100644
--- a/app/src/main/res/layout/fragment_options_misc.xml
+++ b/app/src/main/res/layout/fragment_options_misc.xml
@@ -343,6 +343,18 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvLanguageToolHint" />
+
+