use of com.github.vase4kin.teamcityapp.account.create.data.OnLoadingListener in project TeamCityApp by vase4kin.
the class TestsPresenterImpl method initViews.
/**
* {@inheritDoc}
*/
@Override
protected void initViews() {
super.initViews();
mView.setListener(this);
mView.setOnLoadMoreListener(new MugenCallbacks() {
@Override
public void onLoadMore() {
mIsLoadMoreLoading = true;
mView.addLoadMore();
mDataManager.loadMore(new OnLoadingListener<List<TestOccurrences.TestOccurrence>>() {
@Override
public void onSuccess(List<TestOccurrences.TestOccurrence> data) {
mView.removeLoadMore();
mView.addMoreBuilds(new TestsDataModelImpl(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();
}
use of com.github.vase4kin.teamcityapp.account.create.data.OnLoadingListener 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