Set busy on encrypt

pull/188/head
M66B 4 years ago
parent 94ce9eabd4
commit 2092bd7b5c

@ -2317,6 +2317,16 @@ public class FragmentCompose extends FragmentBase {
args.putParcelable("data", data); args.putParcelable("data", data);
new SimpleTask<Object>() { new SimpleTask<Object>() {
@Override
protected void onPreExecute(Bundle args) {
setBusy(true);
}
@Override
protected void onPostExecute(Bundle args) {
setBusy(false);
}
@Override @Override
protected Object onExecute(Context context, Bundle args) throws Throwable { protected Object onExecute(Context context, Bundle args) throws Throwable {
// Get arguments // Get arguments
@ -2620,6 +2630,16 @@ public class FragmentCompose extends FragmentBase {
private void onSmime(Bundle args, final int action, final Bundle extras) { private void onSmime(Bundle args, final int action, final Bundle extras) {
new SimpleTask<Void>() { new SimpleTask<Void>() {
@Override
protected void onPreExecute(Bundle args) {
setBusy(true);
}
@Override
protected void onPostExecute(Bundle args) {
setBusy(false);
}
@Override @Override
protected Void onExecute(Context context, Bundle args) throws Throwable { protected Void onExecute(Context context, Bundle args) throws Throwable {
long id = args.getLong("id"); 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 { private void checkAddress(InternetAddress[] addresses, Context context) throws AddressException {
if (addresses == null) if (addresses == null)
return; 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) { private static String unprefix(String subject, String prefix) {
subject = subject.trim(); subject = subject.trim();
prefix = prefix.trim().toLowerCase(); prefix = prefix.trim().toLowerCase();

Loading…
Cancel
Save