diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index 723dfa09af..ea2656ad0f 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -141,6 +141,7 @@ public class AdapterMessage extends RecyclerView.Adapter 1); popupMenu.getMenu().findItem(R.id.menu_reply_list).setVisible(data.message.list_post != null); popupMenu.getMenu().findItem(R.id.menu_reply_receipt).setVisible(data.message.receipt_to != null); + popupMenu.getMenu().findItem(R.id.menu_reply_answer).setVisible(answers != 0 || !Helper.isPro(context)); popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { @Override @@ -3433,6 +3435,11 @@ public class AdapterMessage extends RecyclerView.Adapter> liveAnswers(); + @Query("SELECT COUNT(*) FROM answer" + + " WHERE NOT hide") + LiveData liveAnswerCount(); + @Insert long insertAnswer(EntityAnswer answer); diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 8bb507bb7f..f56e98a113 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -1955,6 +1955,13 @@ public class FragmentMessages extends FragmentBase { } }); + db.answer().liveAnswerCount().observe(getViewLifecycleOwner(), new Observer() { + @Override + public void onChanged(Integer count) { + adapter.setAnswerCount(count == null ? -1 : count); + } + }); + // Folder switch (viewType) { case UNIFIED: