diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java
index 1da5f78bfb..4ae42bdcb0 100644
--- a/app/src/main/java/eu/faircode/email/FragmentCompose.java
+++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java
@@ -2908,7 +2908,9 @@ public class FragmentCompose extends FragmentBase {
@Override
protected void onPreExecute(Bundle args) {
if (silent) {
- if (!BuildConfig.PLAY_STORE_RELEASE) {
+ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
+ boolean lt_highlight = prefs.getBoolean("lt_highlight", !BuildConfig.PLAY_STORE_RELEASE);
+ if (lt_highlight) {
int textColorHighlight = Helper.resolveColor(getContext(), android.R.attr.textColorHighlight);
highlightSpan = new BackgroundColorSpan(textColorHighlight);
etBody.getText().setSpan(highlightSpan, start, end,
diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java
index 579d99b528..356fb5f747 100644
--- a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java
+++ b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java
@@ -147,6 +147,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private SwitchCompat swLanguageToolSentence;
private SwitchCompat swLanguageToolAuto;
private SwitchCompat swLanguageToolPicky;
+ private SwitchCompat swLanguageToolHighlight;
private EditText etLanguageTool;
private EditText etLanguageToolUser;
private TextInputLayout tilLanguageToolKey;
@@ -286,7 +287,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
"classification", "class_min_probability", "class_min_difference",
"show_filtered",
"language",
- "lt_enabled", "lt_sentence", "lt_auto", "lt_picky", "lt_uri", "lt_user", "lt_key",
+ "lt_enabled", "lt_sentence", "lt_auto", "lt_picky", "lt_highlight", "lt_uri", "lt_user", "lt_key",
"deepl_enabled",
"vt_enabled", "vt_apikey",
"send_enabled", "send_host", "send_dlimit", "send_tlimit",
@@ -403,6 +404,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swLanguageToolSentence = view.findViewById(R.id.swLanguageToolSentence);
swLanguageToolAuto = view.findViewById(R.id.swLanguageToolAuto);
swLanguageToolPicky = view.findViewById(R.id.swLanguageToolPicky);
+ swLanguageToolHighlight = view.findViewById(R.id.swLanguageToolHighlight);
etLanguageTool = view.findViewById(R.id.etLanguageTool);
etLanguageToolUser = view.findViewById(R.id.etLanguageToolUser);
tilLanguageToolKey = view.findViewById(R.id.tilLanguageToolKey);
@@ -863,6 +865,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swLanguageToolSentence.setEnabled(checked);
swLanguageToolAuto.setEnabled(checked);
swLanguageToolPicky.setEnabled(checked);
+ swLanguageToolHighlight.setEnabled(checked);
}
});
@@ -895,6 +898,13 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
}
});
+ swLanguageToolHighlight.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+ @Override
+ public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
+ prefs.edit().putBoolean("lt_highlight", checked).apply();
+ }
+ });
+
etLanguageTool.setHint(LanguageTool.LT_URI);
etLanguageTool.addTextChangedListener(new TextWatcher() {
@Override
@@ -2554,6 +2564,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swLanguageToolAuto.setEnabled(swLanguageTool.isChecked());
swLanguageToolPicky.setChecked(prefs.getBoolean("lt_picky", false));
swLanguageToolPicky.setEnabled(swLanguageTool.isChecked());
+ swLanguageToolHighlight.setChecked(prefs.getBoolean("lt_highlight", !BuildConfig.PLAY_STORE_RELEASE));
+ swLanguageToolHighlight.setEnabled(swLanguageTool.isChecked());
etLanguageTool.setText(prefs.getString("lt_uri", null));
etLanguageToolUser.setText(prefs.getString("lt_user", null));
tilLanguageToolKey.getEditText().setText(prefs.getString("lt_key", null));
diff --git a/app/src/main/res/layout/fragment_options_misc.xml b/app/src/main/res/layout/fragment_options_misc.xml
index 4225bab73a..80eeaa4645 100644
--- a/app/src/main/res/layout/fragment_options_misc.xml
+++ b/app/src/main/res/layout/fragment_options_misc.xml
@@ -684,6 +684,18 @@
app:layout_constraintTop_toBottomOf="@id/swLanguageToolAuto"
app:switchPadding="12dp" />
+
+
+ app:layout_constraintTop_toBottomOf="@id/swLanguageToolHighlight" />
LanguageTool integration
Check every sentence
Check paragraph after a new line
+ Highlight the text being checked
Username (optional)
API key (optional)
DeepL integration