From a06500acec14c6978a2d1c9c2aa0c8082d817af1 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 17 Aug 2019 09:14:02 +0200 Subject: [PATCH] Tap/long to reply/all --- .../eu/faircode/email/FragmentMessages.java | 27 ++++++++++++++----- app/src/main/res/layout/fragment_messages.xml | 2 +- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index aa37544dea..1577c8f01e 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -699,13 +699,14 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. fabReply.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - if (values.containsKey("expanded") && values.get("expanded").size() > 0) { - long id = values.get("expanded").get(0); - Intent reply = new Intent(getContext(), ActivityCompose.class) - .putExtra("action", "reply_all") - .putExtra("reference", id); - startActivity(reply); - } + onReply("reply"); + } + }); + + fabReply.setOnLongClickListener(new View.OnLongClickListener() { + @Override + public boolean onLongClick(View view) { + return onReply("reply_all"); } }); @@ -1574,6 +1575,18 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. } }; + private boolean onReply(String action) { + if (values.containsKey("expanded") && values.get("expanded").size() > 0) { + long id = values.get("expanded").get(0); + Intent reply = new Intent(getContext(), ActivityCompose.class) + .putExtra("action", action) + .putExtra("reference", id); + startActivity(reply); + return true; + } else + return false; + } + private void onMore() { Bundle args = new Bundle(); args.putLongArray("ids", getSelection()); diff --git a/app/src/main/res/layout/fragment_messages.xml b/app/src/main/res/layout/fragment_messages.xml index ffdcfbb637..f2dfaa8579 100644 --- a/app/src/main/res/layout/fragment_messages.xml +++ b/app/src/main/res/layout/fragment_messages.xml @@ -186,7 +186,7 @@ android:layout_height="wrap_content" android:layout_gravity="end|bottom" android:layout_margin="@dimen/fab_padding" - android:src="@drawable/baseline_reply_all_24" + android:src="@drawable/baseline_reply_24" android:tint="@color/colorActionForeground" app:layout_constraintBottom_toTopOf="@+id/seekBar" app:layout_constraintEnd_toEndOf="parent" />