Set busy on encrypt

This commit is contained in:
M66B 2020-11-13 18:31:10 +01:00
parent 94ce9eabd4
commit 2092bd7b5c
1 changed files with 26 additions and 6 deletions

View File

@ -2317,6 +2317,16 @@ public class FragmentCompose extends FragmentBase {
args.putParcelable("data", data);
new SimpleTask<Object>() {
@Override
protected void onPreExecute(Bundle args) {
setBusy(true);
}
@Override
protected void onPostExecute(Bundle args) {
setBusy(false);
}
@Override
protected Object onExecute(Context context, Bundle args) throws Throwable {
// Get arguments
@ -2620,6 +2630,16 @@ public class FragmentCompose extends FragmentBase {
private void onSmime(Bundle args, final int action, final Bundle extras) {
new SimpleTask<Void>() {
@Override
protected void onPreExecute(Bundle args) {
setBusy(true);
}
@Override
protected void onPostExecute(Bundle args) {
setBusy(false);
}
@Override
protected Void onExecute(Context context, Bundle args) throws Throwable {
long id = args.getLong("id");
@ -4909,12 +4929,6 @@ public class FragmentCompose extends FragmentBase {
}
}
private void setBusy(boolean busy) {
state = (busy ? State.LOADING : State.LOADED);
Helper.setViewsEnabled(view, !busy);
getActivity().invalidateOptionsMenu();
}
private void checkAddress(InternetAddress[] addresses, Context context) throws AddressException {
if (addresses == null)
return;
@ -4944,6 +4958,12 @@ public class FragmentCompose extends FragmentBase {
}
};
private void setBusy(boolean busy) {
state = (busy ? State.LOADING : State.LOADED);
Helper.setViewsEnabled(view, !busy);
getActivity().invalidateOptionsMenu();
}
private static String unprefix(String subject, String prefix) {
subject = subject.trim();
prefix = prefix.trim().toLowerCase();