use of com.github.vase4kin.teamcityapp.tests.data.TestsDataModelImpl 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.tests.data.TestsDataModelImpl in project TeamCityApp by vase4kin.
the class TestsPresenterImpl method onOptionsItemSelected.
/**
* {@inheritDoc}
*/
@Override
public boolean onOptionsItemSelected(MenuItem item) {
mView.showRefreshAnimation();
mView.hideErrorView();
mView.hideEmpty();
mView.showData(new TestsDataModelImpl(Collections.<TestOccurrences.TestOccurrence>emptyList()));
return mView.onOptionsItemSelected(item);
}
Aggregations