Hide undo/redo when not applicable

pull/156/head
M66B 6 years ago
parent 0d71716720
commit 06b85c916e

@ -2237,8 +2237,8 @@ public class FragmentCompose extends FragmentBase {
grpHeader.setVisibility(View.VISIBLE); grpHeader.setVisibility(View.VISIBLE);
grpAddresses.setVisibility("reply_all".equals(action) ? View.VISIBLE : View.GONE); grpAddresses.setVisibility("reply_all".equals(action) ? View.VISIBLE : View.GONE);
bottom_navigation.getMenu().findItem(R.id.action_undo).setEnabled(draft.revision != null && draft.revision > 1); bottom_navigation.getMenu().findItem(R.id.action_undo).setVisible(draft.revision != null && draft.revision > 1);
bottom_navigation.getMenu().findItem(R.id.action_redo).setEnabled(draft.revision != null && !draft.revision.equals(draft.revisions)); bottom_navigation.getMenu().findItem(R.id.action_redo).setVisible(draft.revision != null && !draft.revision.equals(draft.revisions));
getActivity().invalidateOptionsMenu(); getActivity().invalidateOptionsMenu();
@ -2683,8 +2683,8 @@ public class FragmentCompose extends FragmentBase {
etCc.setText(MessageHelper.formatAddressesCompose(draft.cc)); etCc.setText(MessageHelper.formatAddressesCompose(draft.cc));
etBcc.setText(MessageHelper.formatAddressesCompose(draft.bcc)); etBcc.setText(MessageHelper.formatAddressesCompose(draft.bcc));
bottom_navigation.getMenu().findItem(R.id.action_undo).setEnabled(draft.revision != null && draft.revision > 1); bottom_navigation.getMenu().findItem(R.id.action_undo).setVisible(draft.revision != null && draft.revision > 1);
bottom_navigation.getMenu().findItem(R.id.action_redo).setEnabled(draft.revision != null && !draft.revision.equals(draft.revisions)); bottom_navigation.getMenu().findItem(R.id.action_redo).setVisible(draft.revision != null && !draft.revision.equals(draft.revisions));
if (action == R.id.action_delete) { if (action == R.id.action_delete) {
autosave = false; autosave = false;
@ -2788,10 +2788,11 @@ public class FragmentCompose extends FragmentBase {
pbWait.setVisibility(View.GONE); pbWait.setVisibility(View.GONE);
edit_bar.setVisibility(style ? View.VISIBLE : View.GONE); edit_bar.setVisibility(style ? View.VISIBLE : View.GONE);
bottom_navigation.getMenu().findItem(R.id.action_undo).setVisible(draft.revision != null && draft.revision > 1);
bottom_navigation.getMenu().findItem(R.id.action_redo).setVisible(draft.revision != null && !draft.revision.equals(draft.revisions));
bottom_navigation.setVisibility(View.VISIBLE); bottom_navigation.setVisibility(View.VISIBLE);
Helper.setViewsEnabled(view, true); Helper.setViewsEnabled(view, true);
bottom_navigation.getMenu().findItem(R.id.action_undo).setEnabled(draft.revision != null && draft.revision > 1);
bottom_navigation.getMenu().findItem(R.id.action_redo).setEnabled(draft.revision != null && !draft.revision.equals(draft.revisions));
getActivity().invalidateOptionsMenu(); getActivity().invalidateOptionsMenu();
} }

Loading…
Cancel
Save