1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-26 17:57:16 +00:00

Disable compose menu on action

This commit is contained in:
M66B 2018-12-07 15:48:42 +01:00
parent 140ee7a8e1
commit 2b7467df44

View file

@ -144,6 +144,7 @@ public class FragmentCompose extends FragmentEx {
private AdapterAttachment adapter;
private long working = -1;
private boolean busy = false;
private boolean autosave = false;
private boolean pro = false;
@ -475,6 +476,9 @@ public class FragmentCompose extends FragmentEx {
menu.findItem(R.id.menu_addresses).setVisible(working >= 0);
menu.findItem(R.id.menu_clear).setVisible(working >= 0);
menu.findItem(R.id.menu_encrypt).setVisible(working >= 0);
menu.findItem(R.id.menu_clear).setEnabled(!busy);
menu.findItem(R.id.menu_encrypt).setEnabled(!busy);
}
@Override
@ -906,6 +910,7 @@ public class FragmentCompose extends FragmentEx {
}
private void onAction(int action) {
busy = true;
Helper.setViewsEnabled(view, false);
getActivity().invalidateOptionsMenu();
@ -1656,6 +1661,7 @@ public class FragmentCompose extends FragmentEx {
int action = args.getInt("action");
Log.i(Helper.TAG, "Loaded action id=" + (draft == null ? null : draft.id) + " action=" + action);
busy = false;
Helper.setViewsEnabled(view, true);
getActivity().invalidateOptionsMenu();