mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-23 06:31:17 +00:00
Added debug option paste as plain text
This commit is contained in:
parent
4f1fcadeb5
commit
b29ff4c0d6
4 changed files with 28 additions and 3 deletions
|
@ -290,8 +290,11 @@ public class EditTextCompose extends FixedEditText {
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
|
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
|
||||||
try {
|
try {
|
||||||
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||||
|
boolean paste_plain = prefs.getBoolean("paste_plain", false);
|
||||||
|
|
||||||
int order = 1000;
|
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));
|
menu.add(Menu.CATEGORY_SECONDARY, android.R.id.pasteAsPlainText, order++, getTitle(R.string.title_paste_plain));
|
||||||
if (undo_manager && can(android.R.id.undo))
|
if (undo_manager && can(android.R.id.undo))
|
||||||
menu.add(Menu.CATEGORY_SECONDARY, R.string.title_undo, order++, getTitle(R.string.title_undo));
|
menu.add(Menu.CATEGORY_SECONDARY, R.string.title_undo, order++, getTitle(R.string.title_undo));
|
||||||
|
|
|
@ -216,6 +216,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||||
private SwitchCompat swWebp;
|
private SwitchCompat swWebp;
|
||||||
private SwitchCompat swAnimate;
|
private SwitchCompat swAnimate;
|
||||||
private SwitchCompat swEasyCorrect;
|
private SwitchCompat swEasyCorrect;
|
||||||
|
private SwitchCompat swPastePlain;
|
||||||
private SwitchCompat swInfra;
|
private SwitchCompat swInfra;
|
||||||
private SwitchCompat swTldFlags;
|
private SwitchCompat swTldFlags;
|
||||||
private SwitchCompat swJsonLd;
|
private SwitchCompat swJsonLd;
|
||||||
|
@ -288,7 +289,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||||
"exact_alarms",
|
"exact_alarms",
|
||||||
"native_dkim", "native_arc", "native_arc_whitelist",
|
"native_dkim", "native_arc", "native_arc_whitelist",
|
||||||
"webp", "animate_images",
|
"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",
|
"app_chooser", "app_chooser_share", "adjacent_links", "adjacent_documents", "adjacent_portrait", "adjacent_landscape",
|
||||||
"delete_confirmation", "global_keywords", "test_iab"
|
"delete_confirmation", "global_keywords", "test_iab"
|
||||||
));
|
));
|
||||||
|
@ -456,6 +457,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||||
swWebp = view.findViewById(R.id.swWebp);
|
swWebp = view.findViewById(R.id.swWebp);
|
||||||
swAnimate = view.findViewById(R.id.swAnimate);
|
swAnimate = view.findViewById(R.id.swAnimate);
|
||||||
swEasyCorrect = view.findViewById(R.id.swEasyCorrect);
|
swEasyCorrect = view.findViewById(R.id.swEasyCorrect);
|
||||||
|
swPastePlain = view.findViewById(R.id.swPastePlain);
|
||||||
swInfra = view.findViewById(R.id.swInfra);
|
swInfra = view.findViewById(R.id.swInfra);
|
||||||
swTldFlags = view.findViewById(R.id.swTldFlags);
|
swTldFlags = view.findViewById(R.id.swTldFlags);
|
||||||
swJsonLd = view.findViewById(R.id.swJsonLd);
|
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() {
|
swInfra.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||||
|
@ -2369,6 +2378,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||||
swWebp.setChecked(prefs.getBoolean("webp", true));
|
swWebp.setChecked(prefs.getBoolean("webp", true));
|
||||||
swAnimate.setChecked(prefs.getBoolean("animate_images", true));
|
swAnimate.setChecked(prefs.getBoolean("animate_images", true));
|
||||||
swEasyCorrect.setChecked(prefs.getBoolean("easy_correct", false));
|
swEasyCorrect.setChecked(prefs.getBoolean("easy_correct", false));
|
||||||
|
swPastePlain.setChecked(prefs.getBoolean("paste_plain", false));
|
||||||
swInfra.setChecked(prefs.getBoolean("infra", false));
|
swInfra.setChecked(prefs.getBoolean("infra", false));
|
||||||
swTldFlags.setChecked(prefs.getBoolean("tld_flags", false));
|
swTldFlags.setChecked(prefs.getBoolean("tld_flags", false));
|
||||||
swJsonLd.setChecked(prefs.getBoolean("json_ld", false));
|
swJsonLd.setChecked(prefs.getBoolean("json_ld", false));
|
||||||
|
|
|
@ -1601,6 +1601,17 @@
|
||||||
app:layout_constraintTop_toBottomOf="@id/swAnimate"
|
app:layout_constraintTop_toBottomOf="@id/swAnimate"
|
||||||
app:switchPadding="12dp" />
|
app:switchPadding="12dp" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.SwitchCompat
|
||||||
|
android:id="@+id/swPastePlain"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:text="@string/title_advanced_paste_plain"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/swEasyCorrect"
|
||||||
|
app:switchPadding="12dp" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.SwitchCompat
|
<androidx.appcompat.widget.SwitchCompat
|
||||||
android:id="@+id/swInfra"
|
android:id="@+id/swInfra"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
|
@ -1609,7 +1620,7 @@
|
||||||
android:text="@string/title_advanced_infra"
|
android:text="@string/title_advanced_infra"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/swEasyCorrect"
|
app:layout_constraintTop_toBottomOf="@id/swPastePlain"
|
||||||
app:switchPadding="12dp" />
|
app:switchPadding="12dp" />
|
||||||
|
|
||||||
<androidx.constraintlayout.helper.widget.Flow
|
<androidx.constraintlayout.helper.widget.Flow
|
||||||
|
|
|
@ -945,6 +945,7 @@
|
||||||
<string name="title_advanced_webp" translatable="false">WebP</string>
|
<string name="title_advanced_webp" translatable="false">WebP</string>
|
||||||
<string name="title_advanced_animate" translatable="false">Animate images (GIF, etc.)</string>
|
<string name="title_advanced_animate" translatable="false">Animate images (GIF, etc.)</string>
|
||||||
<string name="title_advanced_easy_correct" translatable="false">Easy correct</string>
|
<string name="title_advanced_easy_correct" translatable="false">Easy correct</string>
|
||||||
|
<string name="title_advanced_paste_plain" translatable="false">Add paste as plain text</string>
|
||||||
<string name="title_advanced_infra" translatable="false">Show infrastructure</string>
|
<string name="title_advanced_infra" translatable="false">Show infrastructure</string>
|
||||||
<string name="title_advanced_tld_flags" translatable="false">Show TLD flags</string>
|
<string name="title_advanced_tld_flags" translatable="false">Show TLD flags</string>
|
||||||
<string name="title_advanced_json_ld" translatable="false">Show Linked Data (JSON-LD)</string>
|
<string name="title_advanced_json_ld" translatable="false">Show Linked Data (JSON-LD)</string>
|
||||||
|
|
Loading…
Reference in a new issue