More and less toast

This commit is contained in:
M66B
2022-04-28 10:57:13 +02:00
parent b4e9927d10
commit 25630cd063
11 changed files with 140 additions and 23 deletions

View File

@@ -790,7 +790,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
@Override
protected void onPostExecute(Bundle args) {
prefs.edit().remove("debug").apply();
ToastEx.makeText(v.getContext(), R.string.title_completed, Toast.LENGTH_LONG).show();
}
@Override
@@ -829,6 +828,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
@Override
protected void onExecuted(Bundle args, Void data) {
ToastEx.makeText(v.getContext(), R.string.title_completed, Toast.LENGTH_LONG).show();
ServiceSynchronize.reload(v.getContext(), null, true, "repair");
}
@@ -1613,16 +1613,20 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private void onCleanup() {
new SimpleTask<Void>() {
private Toast toast = null;
@Override
protected void onPreExecute(Bundle args) {
btnCleanup.setEnabled(false);
ToastEx.makeText(getContext(), R.string.title_executing, Toast.LENGTH_LONG).show();
toast = ToastEx.makeText(getContext(), R.string.title_executing, Toast.LENGTH_LONG);
toast.show();
}
@Override
protected void onPostExecute(Bundle args) {
btnCleanup.setEnabled(true);
ToastEx.makeText(getContext(), R.string.title_completed, Toast.LENGTH_LONG).show();
if (toast != null)
toast.cancel();
}
@Override
@@ -1631,6 +1635,11 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
return null;
}
@Override
protected void onExecuted(Bundle args, Void data) {
ToastEx.makeText(getContext(), R.string.title_completed, Toast.LENGTH_LONG).show();
}
@Override
protected void onException(Bundle args, Throwable ex) {
Log.unexpectedError(getParentFragmentManager(), ex);