use of com.example.aleksejkocergin.myapplication.ToggleDislikeMutation in project RandomWebm by alkocher.
the class ToggleVotesUtil method toggleDislike.
public void toggleDislike(String webmId, boolean hasLike, boolean hasDislike) {
ApolloMutationCall<ToggleDislikeMutation.Data> dislikeMutationCall = WebmApolloClient.getWebmApolloClient().mutate(new ToggleDislikeMutation(webmId, hasLike, hasDislike));
mDisposable.add(Rx2Apollo.from(dislikeMutationCall).observeOn(AndroidSchedulers.mainThread()).subscribeOn(Schedulers.io()).subscribeWith(new DisposableObserver<Response<ToggleDislikeMutation.Data>>() {
@Override
public void onNext(Response<ToggleDislikeMutation.Data> dataResponse) {
}
@Override
public void onError(Throwable e) {
webmData.showErrorSnackbar();
}
@Override
public void onComplete() {
webmData.showSuccessSnackbar();
}
}));
}
Aggregations