From dabf802d84d30fb9901a45ec7ce440d4351a00d0 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 3 Aug 2018 13:50:55 +0000 Subject: [PATCH] Make bottom navigation actions invisible when unavailable --- app/src/main/java/eu/faircode/email/FragmentCompose.java | 2 +- app/src/main/java/eu/faircode/email/FragmentMessage.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 7cc88dcf..2ae2f03d 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -181,7 +181,7 @@ public class FragmentCompose extends Fragment { // Initialize grpReady.setVisibility(View.GONE); pbWait.setVisibility(View.VISIBLE); - bottom_navigation.getMenu().findItem(R.id.action_delete).setEnabled(id > 0); + bottom_navigation.getMenu().findItem(R.id.action_delete).setVisible(id > 0); bottom_navigation.setEnabled(false); DB.getInstance(getContext()).identity().liveIdentities(true).observe(getActivity(), new Observer>() { diff --git a/app/src/main/java/eu/faircode/email/FragmentMessage.java b/app/src/main/java/eu/faircode/email/FragmentMessage.java index e7d2d5af..5657fd1b 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessage.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessage.java @@ -246,8 +246,8 @@ public class FragmentMessage extends Fragment { : R.drawable.baseline_visibility_24); actionSeen.setTitle(message.ui_seen ? R.string.title_unseen : R.string.title_seen); - bottom_navigation.getMenu().findItem(R.id.action_spam).setEnabled(message.account != null); - bottom_navigation.getMenu().findItem(R.id.action_archive).setEnabled(message.account != null); + bottom_navigation.getMenu().findItem(R.id.action_spam).setVisible(message.account != null); + bottom_navigation.getMenu().findItem(R.id.action_archive).setVisible(message.account != null); tvBody.setText(message.body == null ? null : Html.fromHtml(HtmlHelper.sanitize(getContext(), message.body, false)));