diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index f176458512..2fd04f70c1 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -383,6 +383,8 @@ public class AdapterMessage extends RecyclerView.Adapter= Build.VERSION_CODES.O) ibJunk.setTooltipText(title); + ibAnswer.setVisibility(View.VISIBLE); + ibMove.setVisibility(move ? View.VISIBLE : View.GONE); ibArchive.setVisibility(archive ? View.VISIBLE : View.GONE); ibTrash.setVisibility(trash ? View.VISIBLE : View.GONE); ibJunk.setVisibility(junk || unjunk ? View.VISIBLE : View.GONE); @@ -3237,9 +3248,6 @@ public class AdapterMessage extends RecyclerView.Adapter>() { - @Override - protected List onExecute(Context context, Bundle args) { - long id = args.getLong("id"); + new SimpleTask>() { + @Override + protected List onExecute(Context context, Bundle args) { + long id = args.getLong("id"); - DB db = DB.getInstance(context); - EntityMessage message = db.message().getMessage(id); - if (message == null) - return null; + DB db = DB.getInstance(context); + EntityMessage message = db.message().getMessage(id); + if (message == null) + return null; - args.putInt("answers", db.answer().getAnswerCount()); + args.putInt("answers", db.answer().getAnswerCount()); - return db.identity().getComposableIdentities(message.account); - } + return db.identity().getComposableIdentities(message.account); + } - @Override - protected void onExecuted(Bundle args, List identities) { - if (identities == null) - identities = new ArrayList<>(); + @Override + protected void onExecuted(Bundle args, List identities) { + if (identities == null) + identities = new ArrayList<>(); - final Address[] to = - message.replySelf(identities, message.account) - ? message.to - : (message.reply == null || message.reply.length == 0 ? message.from : message.reply); + final Address[] to = + message.replySelf(identities, message.account) + ? message.to + : (message.reply == null || message.reply.length == 0 ? message.from : message.reply); - Address[] recipients = message.getAllRecipients(identities, message.account); + Address[] recipients = message.getAllRecipients(identities, message.account); - int answers = args.getInt("answers"); + int answers = args.getInt("answers"); - PopupMenuLifecycle popupMenu = new PopupMenuLifecycle(getContext(), getViewLifecycleOwner(), fabReply); - popupMenu.inflate(R.menu.popup_reply); - popupMenu.getMenu().findItem(R.id.menu_reply_to_all).setVisible(recipients.length > 0); - popupMenu.getMenu().findItem(R.id.menu_reply_list).setVisible(message.list_post != null); - popupMenu.getMenu().findItem(R.id.menu_reply_receipt).setVisible(message.receipt_to != null); - popupMenu.getMenu().findItem(R.id.menu_new_message).setVisible(to != null && to.length > 0); - popupMenu.getMenu().findItem(R.id.menu_reply_answer).setVisible(answers != 0 || !ActivityBilling.isPro(getContext())); - - popupMenu.getMenu().findItem(R.id.menu_reply_to_sender).setEnabled(message.content); - popupMenu.getMenu().findItem(R.id.menu_reply_to_all).setEnabled(message.content); - popupMenu.getMenu().findItem(R.id.menu_forward).setEnabled(message.content); - popupMenu.getMenu().findItem(R.id.menu_editasnew).setEnabled(message.content); - popupMenu.getMenu().findItem(R.id.menu_reply_answer).setEnabled(message.content); + PopupMenuLifecycle popupMenu = new PopupMenuLifecycle(getContext(), getViewLifecycleOwner(), anchor); + popupMenu.inflate(R.menu.popup_reply); + popupMenu.getMenu().findItem(R.id.menu_reply_to_all).setVisible(recipients.length > 0); + popupMenu.getMenu().findItem(R.id.menu_reply_list).setVisible(message.list_post != null); + popupMenu.getMenu().findItem(R.id.menu_reply_receipt).setVisible(message.receipt_to != null); + popupMenu.getMenu().findItem(R.id.menu_new_message).setVisible(to != null && to.length > 0); + popupMenu.getMenu().findItem(R.id.menu_reply_answer).setVisible(answers != 0 || !ActivityBilling.isPro(getContext())); - popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { - @Override - public boolean onMenuItemClick(MenuItem target) { - switch (target.getItemId()) { - case R.id.menu_reply_to_sender: - onMenuReply(message, "reply"); - return true; - case R.id.menu_reply_to_all: - onMenuReply(message, "reply_all"); - return true; - case R.id.menu_reply_list: - onMenuReply(message, "list"); - return true; - case R.id.menu_reply_receipt: - onMenuReply(message, "receipt"); - return true; - case R.id.menu_forward: - onMenuReply(message, "forward"); - return true; - case R.id.menu_editasnew: - onMenuReply(message, "editasnew"); - return true; - case R.id.menu_new_message: - onMenuNew(message, to); - return true; - case R.id.menu_reply_answer: - onMenuAnswer(message); - return true; - default: - return false; - } + popupMenu.getMenu().findItem(R.id.menu_reply_to_sender).setEnabled(message.content); + popupMenu.getMenu().findItem(R.id.menu_reply_to_all).setEnabled(message.content); + popupMenu.getMenu().findItem(R.id.menu_forward).setEnabled(message.content); + popupMenu.getMenu().findItem(R.id.menu_editasnew).setEnabled(message.content); + popupMenu.getMenu().findItem(R.id.menu_reply_answer).setEnabled(message.content); + + popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { + @Override + public boolean onMenuItemClick(MenuItem target) { + switch (target.getItemId()) { + case R.id.menu_reply_to_sender: + onMenuReply(message, "reply"); + return true; + case R.id.menu_reply_to_all: + onMenuReply(message, "reply_all"); + return true; + case R.id.menu_reply_list: + onMenuReply(message, "list"); + return true; + case R.id.menu_reply_receipt: + onMenuReply(message, "receipt"); + return true; + case R.id.menu_forward: + onMenuReply(message, "forward"); + return true; + case R.id.menu_editasnew: + onMenuReply(message, "editasnew"); + return true; + case R.id.menu_new_message: + onMenuNew(message, to); + return true; + case R.id.menu_reply_answer: + onMenuAnswer(message); + return true; + default: + return false; } - }); - popupMenu.show(); - } + } + }); + popupMenu.show(); + } - @Override - protected void onException(Bundle args, Throwable ex) { - Log.unexpectedError(getParentFragmentManager(), ex); - } - }.execute(FragmentMessages.this, args, "messages:reply"); - } + @Override + protected void onException(Bundle args, Throwable ex) { + Log.unexpectedError(getParentFragmentManager(), ex); + } + }.execute(FragmentMessages.this, args, "messages:reply"); } private void onMenuReply(TupleMessageEx message, String action) { diff --git a/app/src/main/res/layout/include_message_navigation.xml b/app/src/main/res/layout/include_message_navigation.xml index 561f9f651d..f55d799c7a 100644 --- a/app/src/main/res/layout/include_message_navigation.xml +++ b/app/src/main/res/layout/include_message_navigation.xml @@ -49,7 +49,6 @@ android:tooltipText="@string/title_delete" app:layout_constraintStart_toEndOf="@id/ibMore" app:layout_constraintTop_toBottomOf="@id/vSeparator" - app:layout_goneMarginStart="0dp" app:srcCompat="@drawable/baseline_close_24" /> + app:srcCompat="@drawable/baseline_folder_24" /> + app:srcCompat="@drawable/baseline_reply_24" /> + app:srcCompat="@drawable/baseline_undo_24" /> + + + + + app:layout_constraintTop_toBottomOf="@id/ibVerify" /> - - - - diff --git a/app/src/main/res/menu/popup_message_more.xml b/app/src/main/res/menu/popup_message_more.xml index dea228f116..d0385e7c96 100644 --- a/app/src/main/res/menu/popup_message_more.xml +++ b/app/src/main/res/menu/popup_message_more.xml @@ -36,10 +36,6 @@ android:id="@+id/menu_no_junk" android:title="@string/title_no_junk" /> - - diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 3bab6d838d..46c27f1af9 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -745,7 +745,6 @@ Send error reports? Error reporting will help improve FairEmail Tap the cross icon to archive, delete or report a message as spam and to remove this notice - Reply to all, forwarding, etc. have been moved to the reply button at the bottom Please review FairEmail