pull/147/head
M66B 6 years ago
parent 9b865d9068
commit 2ff5b3f773

@ -160,7 +160,7 @@ public class AdapterAttachment extends RecyclerView.Adapter<AdapterAttachment.Vi
protected void onException(Bundle args, Throwable ex) {
Helper.unexpectedError(context, owner, ex);
}
}.execute(context, owner, args);
}.execute(context, owner, args, "attachment:delete");
} else if (view.getId() == R.id.ivSave) {
LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(context);
@ -270,7 +270,7 @@ public class AdapterAttachment extends RecyclerView.Adapter<AdapterAttachment.Vi
protected void onException(Bundle args, Throwable ex) {
Helper.unexpectedError(context, owner, ex);
}
}.execute(context, owner, args);
}.execute(context, owner, args, "attachment:fetch");
}
}
}

@ -294,7 +294,7 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
protected void onException(Bundle args, Throwable ex) {
Helper.unexpectedError(context, owner, ex);
}
}.execute(context, owner, args);
}.execute(context, owner, args, "folder:sync");
}
private void OnActionDeleteLocal() {
@ -319,7 +319,7 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
public void onException(Bundle args, Throwable ex) {
Helper.unexpectedError(context, owner, ex);
}
}.execute(context, owner, args);
}.execute(context, owner, args, "folder:delete:local");
}
private void onActionEmptyTrash() {
@ -358,7 +358,7 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
protected void onException(Bundle args, Throwable ex) {
Helper.unexpectedError(context, owner, ex);
}
}.execute(context, owner, args);
}.execute(context, owner, args, "folder:delete");
}
})
.setNegativeButton(android.R.string.cancel, null)

@ -166,7 +166,7 @@ public class AdapterImage extends RecyclerView.Adapter<AdapterImage.ViewHolder>
protected void onException(Bundle args, Throwable ex) {
Helper.unexpectedError(context, owner, ex);
}
}.execute(context, owner, args);
}.execute(context, owner, args, "image:fetch");
}
}
}

@ -303,7 +303,7 @@ public class FragmentAccount extends FragmentEx {
else
Helper.unexpectedError(getContext(), getViewLifecycleOwner(), ex);
}
}.execute(FragmentAccount.this, args);
}.execute(FragmentAccount.this, args, "account:config");
}
});
@ -623,7 +623,7 @@ public class FragmentAccount extends FragmentEx {
});
}
}
}.execute(FragmentAccount.this, args);
}.execute(FragmentAccount.this, args, "account:check");
}
});
@ -937,7 +937,7 @@ public class FragmentAccount extends FragmentEx {
});
}
}
}.execute(FragmentAccount.this, args);
}.execute(FragmentAccount.this, args, "account:save");
}
});
@ -1071,7 +1071,7 @@ public class FragmentAccount extends FragmentEx {
protected void onException(Bundle args, Throwable ex) {
Helper.unexpectedError(getContext(), getViewLifecycleOwner(), ex);
}
}.execute(FragmentAccount.this, new Bundle());
}.execute(FragmentAccount.this, new Bundle(), "account:primary");
} else {
int provider = savedInstanceState.getInt("provider");
spProvider.setTag(provider);
@ -1111,14 +1111,14 @@ public class FragmentAccount extends FragmentEx {
protected void onException(Bundle args, Throwable ex) {
Helper.unexpectedError(getContext(), getViewLifecycleOwner(), ex);
}
}.execute(FragmentAccount.this, args);
}.execute(FragmentAccount.this, args, "account:folders");
}
@Override
protected void onException(Bundle args, Throwable ex) {
Helper.unexpectedError(getContext(), getViewLifecycleOwner(), ex);
}
}.execute(this, args);
}.execute(this, args, "account:get");
}
@Override
@ -1181,7 +1181,7 @@ public class FragmentAccount extends FragmentEx {
protected void onException(Bundle args, Throwable ex) {
Helper.unexpectedError(getContext(), getViewLifecycleOwner(), ex);
}
}.execute(FragmentAccount.this, args);
}.execute(FragmentAccount.this, args, "account:delete");
}
})
.setNegativeButton(android.R.string.cancel, null)

@ -127,7 +127,7 @@ public class FragmentAnswer extends FragmentEx {
protected void onException(Bundle args, Throwable ex) {
Helper.unexpectedError(getContext(), getViewLifecycleOwner(), ex);
}
}.execute(this, args);
}.execute(this, args, "answer:get");
}
private void onActionTrash() {
@ -159,7 +159,7 @@ public class FragmentAnswer extends FragmentEx {
Helper.setViewsEnabled(view, true);
Helper.unexpectedError(getContext(), getViewLifecycleOwner(), ex);
}
}.execute(FragmentAnswer.this, args);
}.execute(FragmentAnswer.this, args, "answer:delete");
}
})
.setNegativeButton(android.R.string.cancel, null)
@ -207,7 +207,7 @@ public class FragmentAnswer extends FragmentEx {
Helper.setViewsEnabled(view, true);
Helper.unexpectedError(getContext(), getViewLifecycleOwner(), ex);
}
}.execute(this, args);
}.execute(this, args, "answer:save");
}
private void handleExit() {

@ -259,7 +259,7 @@ public class FragmentFolder extends FragmentEx {
else
Helper.unexpectedError(getContext(), getViewLifecycleOwner(), ex);
}
}.execute(FragmentFolder.this, args);
}.execute(FragmentFolder.this, args, "folder:save");
}
});
@ -342,7 +342,7 @@ public class FragmentFolder extends FragmentEx {
else
Helper.unexpectedError(getContext(), getViewLifecycleOwner(), ex);
}
}.execute(FragmentFolder.this, args);
}.execute(FragmentFolder.this, args, "folder:delete");
}
})
.setNegativeButton(android.R.string.cancel, null)
@ -399,6 +399,6 @@ public class FragmentFolder extends FragmentEx {
protected void onException(Bundle args, Throwable ex) {
Helper.unexpectedError(getContext(), getViewLifecycleOwner(), ex);
}
}.execute(this, args);
}.execute(this, args, "folder:get");
}
}

@ -421,7 +421,7 @@ public class FragmentIdentity extends FragmentEx {
else
Helper.unexpectedError(getContext(), getViewLifecycleOwner(), ex);
}
}.execute(FragmentIdentity.this, args);
}.execute(FragmentIdentity.this, args, "identity:config");
}
});
@ -659,7 +659,7 @@ public class FragmentIdentity extends FragmentEx {
});
}
}
}.execute(FragmentIdentity.this, args);
}.execute(FragmentIdentity.this, args, "identity:save");
}
});
@ -752,7 +752,7 @@ public class FragmentIdentity extends FragmentEx {
protected void onException(Bundle args, Throwable ex) {
Helper.unexpectedError(getContext(), getViewLifecycleOwner(), ex);
}
}.execute(FragmentIdentity.this, new Bundle());
}.execute(FragmentIdentity.this, new Bundle(), "identity:count");
} else {
tilPassword.getEditText().setText(savedInstanceState.getString("password"));
grpAdvanced.setVisibility(savedInstanceState.getInt("advanced"));
@ -849,14 +849,14 @@ public class FragmentIdentity extends FragmentEx {
protected void onException(Bundle args, Throwable ex) {
Helper.unexpectedError(getContext(), getViewLifecycleOwner(), ex);
}
}.execute(FragmentIdentity.this, args);
}.execute(FragmentIdentity.this, args, "identity:accounts:get");
}
@Override
protected void onException(Bundle args, Throwable ex) {
Helper.unexpectedError(getContext(), getViewLifecycleOwner(), ex);
}
}.execute(this, args);
}.execute(this, args, "identity:get");
}
@Override
@ -917,7 +917,7 @@ public class FragmentIdentity extends FragmentEx {
protected void onException(Bundle args, Throwable ex) {
Helper.unexpectedError(getContext(), getViewLifecycleOwner(), ex);
}
}.execute(FragmentIdentity.this, args);
}.execute(FragmentIdentity.this, args, "identity:delete");
}
})
.setNegativeButton(android.R.string.cancel, null)
@ -984,7 +984,7 @@ public class FragmentIdentity extends FragmentEx {
protected void onException(Bundle args, Throwable ex) {
Helper.unexpectedError(getContext(), getViewLifecycleOwner(), ex);
}
}.execute(this, args);
}.execute(this, args, "identity:folders:get");
}
class IdentityFolders {

@ -154,7 +154,7 @@ public class FragmentOperations extends FragmentEx {
protected void onException(Bundle args, Throwable ex) {
Helper.unexpectedError(getContext(), getViewLifecycleOwner(), ex);
}
}.execute(FragmentOperations.this, new Bundle());
}.execute(FragmentOperations.this, new Bundle(), "operation:delete");
}
})
.setNegativeButton(android.R.string.cancel, null)

@ -256,7 +256,7 @@ public class FragmentOptions extends FragmentEx implements SharedPreferences.OnS
protected void onException(Bundle args, Throwable ex) {
Helper.unexpectedError(getContext(), getViewLifecycleOwner(), ex);
}
}.execute(FragmentOptions.this, null);
}.execute(FragmentOptions.this, new Bundle(), "options:preview");
}
});

@ -184,7 +184,7 @@ public class FragmentWebView extends FragmentEx {
protected void onException(Bundle args, Throwable ex) {
Helper.unexpectedError(getContext(), getViewLifecycleOwner(), ex);
}
}.execute(this, args);
}.execute(this, args, "webview:format");
}
((ActivityBase) getActivity()).addBackPressedListener(onBackPressedListener);

@ -51,34 +51,18 @@ public abstract class SimpleTask<T> implements LifecycleObserver {
private static ExecutorService executor = Executors.newCachedThreadPool(Helper.backgroundThreadFactory);
public void execute(Context context, LifecycleOwner owner, Bundle args) {
execute(context, owner, args, null);
}
public void execute(Context context, LifecycleOwner owner, Bundle args, String name) {
run(context, owner, args, name);
}
public void execute(LifecycleService service, Bundle args) {
execute(service, args, null);
}
public void execute(LifecycleService service, Bundle args, String name) {
run(service, service, args, name);
}
public void execute(AppCompatActivity activity, Bundle args) {
execute(activity, args, null);
}
public void execute(AppCompatActivity activity, Bundle args, String name) {
run(activity, activity, args, name);
}
public void execute(Fragment fragment, Bundle args) {
execute(fragment, args, null);
}
public void execute(final Fragment fragment, Bundle args, String name) {
try {
run(fragment.getContext(), fragment.getViewLifecycleOwner(), args, name);

Loading…
Cancel
Save