use of com.example.aleksejkocergin.myapplication.WebmListQuery in project RandomWebm by alkocher.
the class WebmListFragment method fetchWebmList.
private void fetchWebmList() {
errorCheckConnection.setVisibility(View.GONE);
errorNoResults.setVisibility(View.GONE);
bottomLayout.setVisibility(View.VISIBLE);
ApolloCall<WebmListQuery.Data> webmListQuery = WebmApolloClient.getWebmApolloClient().query(new WebmListQuery(PAGE_SIZE, Order.valueOf(order), ++currentPage, tagName, likedWebms));
disposables.add(Rx2Apollo.from(webmListQuery).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribeWith(new DisposableObserver<Response<WebmListQuery.Data>>() {
@Override
public void onNext(Response<WebmListQuery.Data> dataResponse) {
setWebmData(dataResponse.data());
}
@Override
public void onError(Throwable e) {
swipeContainer.setRefreshing(false);
errorCheckConnection.setVisibility(View.VISIBLE);
Log.e(TAG, e.getMessage(), e);
}
@Override
public void onComplete() {
swipeContainer.setRefreshing(false);
bottomLayout.setVisibility(View.GONE);
}
}));
}
Aggregations