diff --git a/app/src/main/java/eu/faircode/email/EditTextCompose.java b/app/src/main/java/eu/faircode/email/EditTextCompose.java
index eae4528a65..3fc1eb5b05 100644
--- a/app/src/main/java/eu/faircode/email/EditTextCompose.java
+++ b/app/src/main/java/eu/faircode/email/EditTextCompose.java
@@ -290,8 +290,11 @@ public class EditTextCompose extends FixedEditText {
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
try {
+ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
+ boolean paste_plain = prefs.getBoolean("paste_plain", false);
+
int order = 1000;
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O)
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O || paste_plain)
menu.add(Menu.CATEGORY_SECONDARY, android.R.id.pasteAsPlainText, order++, getTitle(R.string.title_paste_plain));
if (undo_manager && can(android.R.id.undo))
menu.add(Menu.CATEGORY_SECONDARY, R.string.title_undo, order++, getTitle(R.string.title_undo));
diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java
index 62ce2bf8f0..b83b37f616 100644
--- a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java
+++ b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java
@@ -216,6 +216,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private SwitchCompat swWebp;
private SwitchCompat swAnimate;
private SwitchCompat swEasyCorrect;
+ private SwitchCompat swPastePlain;
private SwitchCompat swInfra;
private SwitchCompat swTldFlags;
private SwitchCompat swJsonLd;
@@ -288,7 +289,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
"exact_alarms",
"native_dkim", "native_arc", "native_arc_whitelist",
"webp", "animate_images",
- "easy_correct", "infra", "tld_flags", "json_ld", "dup_msgids", "thread_byref", "save_user_flags", "mdn",
+ "easy_correct", "paste_plain", "infra", "tld_flags", "json_ld", "dup_msgids", "thread_byref", "save_user_flags", "mdn",
"app_chooser", "app_chooser_share", "adjacent_links", "adjacent_documents", "adjacent_portrait", "adjacent_landscape",
"delete_confirmation", "global_keywords", "test_iab"
));
@@ -456,6 +457,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swWebp = view.findViewById(R.id.swWebp);
swAnimate = view.findViewById(R.id.swAnimate);
swEasyCorrect = view.findViewById(R.id.swEasyCorrect);
+ swPastePlain = view.findViewById(R.id.swPastePlain);
swInfra = view.findViewById(R.id.swInfra);
swTldFlags = view.findViewById(R.id.swTldFlags);
swJsonLd = view.findViewById(R.id.swJsonLd);
@@ -1537,6 +1539,13 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
}
});
+ swPastePlain.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+ @Override
+ public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
+ prefs.edit().putBoolean("paste_plain", checked).apply();
+ }
+ });
+
swInfra.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@@ -2369,6 +2378,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swWebp.setChecked(prefs.getBoolean("webp", true));
swAnimate.setChecked(prefs.getBoolean("animate_images", true));
swEasyCorrect.setChecked(prefs.getBoolean("easy_correct", false));
+ swPastePlain.setChecked(prefs.getBoolean("paste_plain", false));
swInfra.setChecked(prefs.getBoolean("infra", false));
swTldFlags.setChecked(prefs.getBoolean("tld_flags", false));
swJsonLd.setChecked(prefs.getBoolean("json_ld", false));
diff --git a/app/src/main/res/layout/fragment_options_misc.xml b/app/src/main/res/layout/fragment_options_misc.xml
index 35d2184726..6db022142a 100644
--- a/app/src/main/res/layout/fragment_options_misc.xml
+++ b/app/src/main/res/layout/fragment_options_misc.xml
@@ -1601,6 +1601,17 @@
app:layout_constraintTop_toBottomOf="@id/swAnimate"
app:switchPadding="12dp" />
+
+
WebP
Animate images (GIF, etc.)
Easy correct
+ Add paste as plain text
Show infrastructure
Show TLD flags
Show Linked Data (JSON-LD)