mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-28 02:37:16 +00:00
Disable compose menu on action
This commit is contained in:
parent
140ee7a8e1
commit
2b7467df44
1 changed files with 6 additions and 0 deletions
|
@ -144,6 +144,7 @@ public class FragmentCompose extends FragmentEx {
|
||||||
private AdapterAttachment adapter;
|
private AdapterAttachment adapter;
|
||||||
|
|
||||||
private long working = -1;
|
private long working = -1;
|
||||||
|
private boolean busy = false;
|
||||||
private boolean autosave = false;
|
private boolean autosave = false;
|
||||||
private boolean pro = 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_addresses).setVisible(working >= 0);
|
||||||
menu.findItem(R.id.menu_clear).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_encrypt).setVisible(working >= 0);
|
||||||
|
|
||||||
|
menu.findItem(R.id.menu_clear).setEnabled(!busy);
|
||||||
|
menu.findItem(R.id.menu_encrypt).setEnabled(!busy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -906,6 +910,7 @@ public class FragmentCompose extends FragmentEx {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onAction(int action) {
|
private void onAction(int action) {
|
||||||
|
busy = true;
|
||||||
Helper.setViewsEnabled(view, false);
|
Helper.setViewsEnabled(view, false);
|
||||||
getActivity().invalidateOptionsMenu();
|
getActivity().invalidateOptionsMenu();
|
||||||
|
|
||||||
|
@ -1656,6 +1661,7 @@ public class FragmentCompose extends FragmentEx {
|
||||||
int action = args.getInt("action");
|
int action = args.getInt("action");
|
||||||
Log.i(Helper.TAG, "Loaded action id=" + (draft == null ? null : draft.id) + " action=" + action);
|
Log.i(Helper.TAG, "Loaded action id=" + (draft == null ? null : draft.id) + " action=" + action);
|
||||||
|
|
||||||
|
busy = false;
|
||||||
Helper.setViewsEnabled(view, true);
|
Helper.setViewsEnabled(view, true);
|
||||||
getActivity().invalidateOptionsMenu();
|
getActivity().invalidateOptionsMenu();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue