diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java
index 3037d8669b..b25bceee2d 100644
--- a/app/src/main/java/eu/faircode/email/FragmentCompose.java
+++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java
@@ -177,6 +177,8 @@ public class FragmentCompose extends FragmentBase {
private boolean autosave = false;
private boolean busy = false;
+ private boolean sender_extra = false;
+ private boolean prefix_once = false;
private boolean monospaced = false;
private boolean style = true;
private boolean encrypt = false;
@@ -191,6 +193,8 @@ public class FragmentCompose extends FragmentBase {
pro = Helper.isPro(getContext());
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
+ sender_extra = prefs.getBoolean("sender", false);
+ prefix_once = prefs.getBoolean("prefix_once", false);
monospaced = prefs.getBoolean("monospaced", false);
style = prefs.getBoolean("style_toolbar", true);
}
@@ -1755,12 +1759,20 @@ public class FragmentCompose extends FragmentBase {
draft.from = ref.to;
}
- if ("reply".equals(action) || "reply_all".equals(action))
- draft.subject = context.getString(R.string.title_subject_reply,
- ref.subject == null ? "" : ref.subject);
- else if ("forward".equals(action))
- draft.subject = context.getString(R.string.title_subject_forward,
- ref.subject == null ? "" : ref.subject);
+ String subject = (ref.subject == null ? "" : ref.subject);
+ if ("reply".equals(action) || "reply_all".equals(action)) {
+ String re = context.getString(R.string.title_subject_reply, "");
+ if (!prefix_once || !subject.startsWith(re))
+ draft.subject = context.getString(R.string.title_subject_reply, subject);
+ else
+ draft.subject = ref.subject;
+ } else if ("forward".equals(action)) {
+ String fwd = context.getString(R.string.title_subject_forward, "");
+ if (!prefix_once || !subject.startsWith(fwd))
+ draft.subject = context.getString(R.string.title_subject_forward, subject);
+ else
+ draft.subject = ref.subject;
+ }
if (answer > 0)
body = EntityAnswer.getAnswerText(db, answer, draft.to) + body;
@@ -1896,10 +1908,8 @@ public class FragmentCompose extends FragmentBase {
etTo.setTag(reference < 0 ? "" : etTo.getText().toString());
etSubject.setTag(reference < 0 ? "" : etSubject.getText().toString());
- boolean sender = PreferenceManager.getDefaultSharedPreferences(getContext()).getBoolean("sender", false);
-
grpHeader.setVisibility(View.VISIBLE);
- grpExtra.setVisibility(sender ? View.VISIBLE : View.GONE);
+ grpExtra.setVisibility(sender_extra ? View.VISIBLE : View.GONE);
grpAddresses.setVisibility("reply_all".equals(action) ? View.VISIBLE : View.GONE);
getActivity().invalidateOptionsMenu();
diff --git a/app/src/main/java/eu/faircode/email/FragmentOptions.java b/app/src/main/java/eu/faircode/email/FragmentOptions.java
index 5ba8c479e8..6ab15222be 100644
--- a/app/src/main/java/eu/faircode/email/FragmentOptions.java
+++ b/app/src/main/java/eu/faircode/email/FragmentOptions.java
@@ -98,6 +98,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
private Spinner spAutoResize;
private TextView tvAutoResize;
private SwitchCompat swSender;
+ private SwitchCompat swPrefixOnce;
private SwitchCompat swAutoSend;
private SwitchCompat swBadge;
@@ -128,7 +129,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
"startup", "date", "threading", "avatars", "identicons", "name_email", "subject_italic", "flags", "preview",
"addresses", "monospaced", "autohtml", "autoimages", "actionbar",
"pull", "swipenav", "autoexpand", "autoclose", "autonext", "collapse", "autoread", "automove",
- "autoresize", "sender", "autosend",
+ "autoresize", "sender", "prefix_once", "autosend",
"notify_preview", "search_local", "light", "sound",
"authentication", "paranoid", "english", "updates", "debug",
"first", "why", "last_update_check", "app_support", "message_swipe", "message_select", "folder_actions", "folder_sync",
@@ -180,6 +181,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
spAutoResize = view.findViewById(R.id.spAutoResize);
tvAutoResize = view.findViewById(R.id.tvAutoResize);
swSender = view.findViewById(R.id.swSender);
+ swPrefixOnce = view.findViewById(R.id.swPrefixOnce);
swAutoSend = view.findViewById(R.id.swAutoSend);
swBadge = view.findViewById(R.id.swBadge);
@@ -502,6 +504,13 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
}
});
+ swPrefixOnce.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+ @Override
+ public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
+ prefs.edit().putBoolean("prefix_once", checked).apply();
+ }
+ });
+
swAutoSend.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@@ -681,6 +690,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
spAutoResize.setEnabled(swAutoResize.isChecked());
swSender.setChecked(prefs.getBoolean("sender", false));
+ swPrefixOnce.setChecked(prefs.getBoolean("prefix_once", false));
swAutoSend.setChecked(!prefs.getBoolean("autosend", false));
swBadge.setChecked(prefs.getBoolean("badge", true));
diff --git a/app/src/main/res/layout/fragment_options.xml b/app/src/main/res/layout/fragment_options.xml
index 1b12ad4fe7..150c11f424 100644
--- a/app/src/main/res/layout/fragment_options.xml
+++ b/app/src/main/res/layout/fragment_options.xml
@@ -701,6 +701,18 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swSender" />
+
+
Automatically resize images for displaying on screens
< %1$d pixels
Allow editing sender address
+ Prefix subject only once on replying or forwarding
Confirm sending messages
Show launcher icon with number of new messages