use of com.hippo.ehviewer.client.EhRequest in project EhViewer by seven332.
the class CommonOperations method removeFromFavorites.
public static void removeFromFavorites(Activity activity, GalleryInfo galleryInfo, final EhClient.Callback<Void> listener) {
EhClient client = EhApplication.getEhClient(activity);
EhRequest request = new EhRequest();
request.setMethod(EhClient.METHOD_ADD_FAVORITES);
request.setArgs(galleryInfo.gid, galleryInfo.token, -1, "");
request.setCallback(listener);
client.execute(request);
}
use of com.hippo.ehviewer.client.EhRequest in project EhViewer by seven332.
the class SignInScene method getProfile.
private void getProfile() {
Context context = getContext2();
MainActivity activity = getActivity2();
if (null == context || null == activity) {
return;
}
hideSoftInput();
showProgress(true);
EhCallback callback = new GetProfileListener(context, activity.getStageId(), getTag());
mRequestId = ((EhApplication) context.getApplicationContext()).putGlobalStuff(callback);
EhRequest request = new EhRequest().setMethod(EhClient.METHOD_GET_PROFILE).setCallback(callback);
EhApplication.getEhClient(context).execute(request);
}
use of com.hippo.ehviewer.client.EhRequest in project EhViewer by seven332.
the class CommonOperations method doAddToFavorites.
private static void doAddToFavorites(Activity activity, GalleryInfo galleryInfo, int slot, EhClient.Callback<Void> listener) {
if (slot == -1) {
EhDB.putLocalFavorites(galleryInfo);
listener.onSuccess(null);
} else if (slot >= 0 && slot <= 9) {
EhClient client = EhApplication.getEhClient(activity);
EhRequest request = new EhRequest();
request.setMethod(EhClient.METHOD_ADD_FAVORITES);
request.setArgs(galleryInfo.gid, galleryInfo.token, slot, "");
request.setCallback(listener);
client.execute(request);
} else {
// TODO Add text
listener.onFailure(new Exception());
}
}
Aggregations