From a8745ba7e1b37f246751b803154a084ee5bd4b86 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 22 Nov 2021 12:10:57 +0100 Subject: [PATCH] Experiment: swipe right to reply --- FAQ.md | 9 +---- .../eu/faircode/email/AdapterMessage.java | 3 +- .../java/eu/faircode/email/EntityMessage.java | 1 + .../eu/faircode/email/FragmentMessages.java | 40 ++++++++++++++++++- 4 files changed, 43 insertions(+), 10 deletions(-) diff --git a/FAQ.md b/FAQ.md index 84086328d1..718b08ea34 100644 --- a/FAQ.md +++ b/FAQ.md @@ -3354,14 +3354,9 @@ For some background, see for [this Wikipedia article](https://en.wikipedia.org/w
-*Report new messages when composing a message* +*Swip right to reply* -A bottom notification will be shown if a new message arrives in the same conversation thread as a new message is being composed for. - -There will be a *show* button to show the conversation and from there you can tap on the draft message to continue editting. -The notification can be swiped away. - -This requires grouping of messages into conversations to be enabled. +Swiping an expanded message in a conversation thread to the right will reply to the sender of the message.
diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index a43f962312..865066a96c 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -1990,6 +1990,7 @@ public class AdapterMessage extends RecyclerView.Adapter 0 ? swipes.right_type : swipes.left_type); @@ -2315,6 +2341,14 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. return; } + boolean expanded = iProperties.getValue("expanded", message.id); + + if (expanded && experiments) { + adapter.notifyItemChanged(pos); + onMenuReply(message, "reply", null); + return; + } + if (EntityFolder.OUTBOX.equals(message.folderType)) { ActivityCompose.undoSend(message.id, getContext(), getViewLifecycleOwner(), getParentFragmentManager()); return; @@ -2396,7 +2430,9 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. if (message == null) return null; - if (iProperties.getValue("expanded", message.id)) + boolean expanded = iProperties.getValue("expanded", message.id); + + if (expanded && !experiments) return null; return message;