Browse Source

Make bottom navigation actions invisible when unavailable

main
M66B 6 years ago
parent
commit
dabf802d84
2 changed files with 3 additions and 3 deletions
  1. +1
    -1
      app/src/main/java/eu/faircode/email/FragmentCompose.java
  2. +2
    -2
      app/src/main/java/eu/faircode/email/FragmentMessage.java

+ 1
- 1
app/src/main/java/eu/faircode/email/FragmentCompose.java View File

@ -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<List<EntityIdentity>>() {


+ 2
- 2
app/src/main/java/eu/faircode/email/FragmentMessage.java View File

@ -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)));


Loading…
Cancel
Save