use of com.github.vase4kin.teamcityapp.changes.data.ChangesDataModelImpl in project TeamCityApp by vase4kin.
the class ChangesPresenterImpl method initViews.
/**
* {@inheritDoc}
*/
@Override
protected void initViews() {
super.initViews();
mView.setLoadMoreListener(new MugenCallbacks() {
@Override
public void onLoadMore() {
mIsLoadMoreLoading = true;
mView.addLoadMore();
mDataManager.loadMore(new OnLoadingListener<List<Changes.Change>>() {
@Override
public void onSuccess(List<Changes.Change> data) {
mView.removeLoadMore();
mView.addMoreBuilds(new ChangesDataModelImpl(data));
mIsLoadMoreLoading = false;
}
@Override
public void onFail(String errorMessage) {
mView.removeLoadMore();
mView.showRetryLoadMoreSnackBar();
mIsLoadMoreLoading = false;
}
});
}
@Override
public boolean isLoading() {
return mIsLoadMoreLoading;
}
@Override
public boolean hasLoadedAllItems() {
return !mDataManager.canLoadMore();
}
});
mView.replaceSkeletonViewContent();
}
Aggregations