mirror of https://github.com/M66B/FairEmail.git
Small improvement
This commit is contained in:
parent
94c5c3aa23
commit
1f1332a169
|
@ -136,12 +136,20 @@ public class FragmentAnswer extends FragmentBase {
|
|||
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
Helper.setViewsEnabled(view, false);
|
||||
|
||||
Bundle args = new Bundle();
|
||||
args.putLong("id", id);
|
||||
|
||||
new SimpleTask<Void>() {
|
||||
@Override
|
||||
protected void onPreExecute(Bundle args) {
|
||||
Helper.setViewsEnabled(view, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(Bundle args) {
|
||||
Helper.setViewsEnabled(view, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Void onExecute(Context context, Bundle args) {
|
||||
long id = args.getLong("id");
|
||||
|
@ -156,7 +164,6 @@ public class FragmentAnswer extends FragmentBase {
|
|||
|
||||
@Override
|
||||
protected void onException(Bundle args, Throwable ex) {
|
||||
Helper.setViewsEnabled(view, true);
|
||||
Helper.unexpectedError(getContext(), getViewLifecycleOwner(), ex);
|
||||
}
|
||||
}.execute(FragmentAnswer.this, args, "answer:delete");
|
||||
|
@ -167,14 +174,22 @@ public class FragmentAnswer extends FragmentBase {
|
|||
}
|
||||
|
||||
private void onActionSave() {
|
||||
Helper.setViewsEnabled(view, false);
|
||||
|
||||
Bundle args = new Bundle();
|
||||
args.putLong("id", id);
|
||||
args.putString("name", etName.getText().toString());
|
||||
args.putString("text", Html.toHtml(etText.getText()));
|
||||
|
||||
new SimpleTask<Void>() {
|
||||
@Override
|
||||
protected void onPreExecute(Bundle args) {
|
||||
Helper.setViewsEnabled(view, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(Bundle args) {
|
||||
Helper.setViewsEnabled(view, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Void onExecute(Context context, Bundle args) {
|
||||
long id = args.getLong("id");
|
||||
|
@ -204,7 +219,6 @@ public class FragmentAnswer extends FragmentBase {
|
|||
|
||||
@Override
|
||||
protected void onException(Bundle args, Throwable ex) {
|
||||
Helper.setViewsEnabled(view, true);
|
||||
Helper.unexpectedError(getContext(), getViewLifecycleOwner(), ex);
|
||||
}
|
||||
}.execute(this, args, "answer:save");
|
||||
|
|
Loading…
Reference in New Issue