diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java
index cf211c2528..7b3bc312a0 100644
--- a/app/src/main/java/eu/faircode/email/FragmentMessages.java
+++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java
@@ -3356,17 +3356,14 @@ public class FragmentMessages extends FragmentBase
if (message == null)
return;
- if (long_press && message.content) {
- SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
- String answer_action = prefs.getString("answer_action", "reply");
- if ("reply".equals(answer_action) ||
- "reply_all".equals(answer_action) ||
- "list".equals(answer_action))
- onMenuReply(message, answer_action, selected);
- else
- onMenuReply(message, answer_action);
- } else
+ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
+ String action = prefs.getString(
+ long_press ? "answer_action" : "answer_single",
+ long_press ? "reply" : "menu");
+ if ("menu".equals(action) || !message.content)
onReply(message, selected, fabReply);
+ else
+ onMenuReply(message, action);
}
}
@@ -3569,6 +3566,10 @@ public class FragmentMessages extends FragmentBase
final Context context = getContext();
if (context == null)
return;
+ if (!"reply".equals(action) &&
+ !"reply_all".equals(action) &&
+ !"list".equals(action))
+ selected = null;
Intent reply = new Intent(context, ActivityCompose.class)
.putExtra("action", action)
.putExtra("reference", message.id)
diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsSend.java b/app/src/main/java/eu/faircode/email/FragmentOptionsSend.java
index c707cec362..4515ff0cfc 100644
--- a/app/src/main/java/eu/faircode/email/FragmentOptionsSend.java
+++ b/app/src/main/java/eu/faircode/email/FragmentOptionsSend.java
@@ -78,7 +78,8 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
private SwitchCompat swAutoSaveDot;
private SwitchCompat swDiscardDelete;
private Spinner spSendDelayed;
- private Spinner spAnswerAction;
+ private Spinner spAnswerActionSingle;
+ private Spinner spAnswerActionLong;
private Button btnSound;
private ViewButtonColor btnComposeColor;
@@ -121,7 +122,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
"send_reminders", "send_chips", "send_pending",
"auto_save_paragraph", "auto_save_dot", "discard_delete",
"send_delayed",
- "answer_action",
+ "answer_single", "answer_action",
"sound_sent",
"compose_color", "compose_font",
"prefix_once", "prefix_count", "alt_re", "alt_fwd",
@@ -160,7 +161,8 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
swAutoSaveDot = view.findViewById(R.id.swAutoSaveDot);
swDiscardDelete = view.findViewById(R.id.swDiscardDelete);
spSendDelayed = view.findViewById(R.id.spSendDelayed);
- spAnswerAction = view.findViewById(R.id.spAnswerAction);
+ spAnswerActionSingle = view.findViewById(R.id.spAnswerActionSingle);
+ spAnswerActionLong = view.findViewById(R.id.spAnswerActionLong);
btnSound = view.findViewById(R.id.btnSound);
btnComposeColor = view.findViewById(R.id.btnComposeColor);
@@ -343,7 +345,20 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
}
});
- spAnswerAction.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+ spAnswerActionSingle.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+ @Override
+ public void onItemSelected(AdapterView> adapterView, View view, int position, long id) {
+ String[] values = getResources().getStringArray(R.array.answerValues);
+ prefs.edit().putString("answer_single", values[position]).apply();
+ }
+
+ @Override
+ public void onNothingSelected(AdapterView> parent) {
+ prefs.edit().remove("answer_single").apply();
+ }
+ });
+
+ spAnswerActionLong.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView> adapterView, View view, int position, long id) {
String[] values = getResources().getStringArray(R.array.answerValues);
@@ -352,7 +367,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
@Override
public void onNothingSelected(AdapterView> parent) {
- prefs.edit().remove("sender_ellipsize").apply();
+ prefs.edit().remove("answer_action").apply();
}
});
@@ -726,12 +741,20 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
break;
}
+ String[] answerValues = getResources().getStringArray(R.array.answerValues);
+
+ String answer_default = prefs.getString("answer_single", "menu");
+ for (int pos = 0; pos < answerValues.length; pos++)
+ if (answerValues[pos].equals(answer_default)) {
+ spAnswerActionSingle.setSelection(pos);
+ break;
+ }
+
boolean reply_all = prefs.getBoolean("reply_all", false);
String answer_action = prefs.getString("answer_action", reply_all ? "reply_all" : "reply");
- String[] answerValues = getResources().getStringArray(R.array.answerValues);
for (int pos = 0; pos < answerValues.length; pos++)
if (answerValues[pos].equals(answer_action)) {
- spAnswerAction.setSelection(pos);
+ spAnswerActionLong.setSelection(pos);
break;
}
diff --git a/app/src/main/res/layout/fragment_options_send.xml b/app/src/main/res/layout/fragment_options_send.xml
index 24fc3f53bc..9bc0099524 100644
--- a/app/src/main/res/layout/fragment_options_send.xml
+++ b/app/src/main/res/layout/fragment_options_send.xml
@@ -324,12 +324,12 @@
app:layout_constraintTop_toBottomOf="@id/tvSendDelayed" />
+
+
+
+
+ app:layout_constraintTop_toBottomOf="@id/tvAnswerActionLong" />
+ app:layout_constraintTop_toBottomOf="@id/spAnswerActionLong" />
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index c7fc4d7304..eed1b3ec3c 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -435,6 +435,7 @@
Show reminders
Delay sending messages
Add shared files to a new draft
+ Short pressing on the answer button will:
Long pressing on the answer button will:
Show non-obtrusive send delayed icon
@@ -1357,6 +1358,7 @@
Send read receipt
Send hard bounce
Reply with template
+ Show selection menu
Moving to %1$s (%2$d)
%1$s authentication failed
On spam block list
@@ -2518,6 +2520,7 @@
- forward
- resend
- editasnew
+ - menu
@@ -2527,6 +2530,7 @@
- @string/title_forward
- @string/title_resend
- @string/title_editasnew
+ - @string/title_reply_menu