use of com.scwang.smart.refresh.layout.api.RefreshLayout in project ManPinAPP by AnyMarvel.
the class BookRRecommendFImpl method notifyRecyclerView.
@Override
public void notifyRecyclerView(List<SourceListContent> recommendList, List<SourceListContent> hotRankingList, List<SourceListContent> contentList, boolean useCache) {
if (useCache || recommendRecyclerAdapter == null) {
recommendRecyclerAdapter = new BookRRecommendFRecyclerAdapter(getContext(), this, recommendList, hotRankingList, contentList);
recommendRecyclerView.setAdapter(recommendRecyclerAdapter);
} else {
recommendRecyclerAdapter.setRecommendList(recommendList);
recommendRecyclerAdapter.setHotRankingList(hotRankingList);
recommendRecyclerAdapter.setContentList(contentList);
recommendRecyclerAdapter.notifyDataSetChanged();
}
bookRrefreshLayout.setOnLoadMoreListener(new OnLoadMoreListener() {
@Override
public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
mPresenter.getNextPageContent(recommendRecyclerAdapter.getmContentListPage() + 1);
}
});
bookRrefreshLayout.setOnRefreshListener(new OnRefreshListener() {
@Override
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
mPresenter.initBookRRcommendData();
}
});
bookRrefreshLayout.finishRefresh();
}
use of com.scwang.smart.refresh.layout.api.RefreshLayout in project ManPinAPP by AnyMarvel.
the class BookRankListActivity method bindEvent.
@Override
protected void bindEvent() {
super.bindEvent();
LinearLayoutManager layoutManager = new LinearLayoutManager(getContext());
layoutManager.setOrientation(RecyclerView.VERTICAL);
recommendRecyclerView.setLayoutManager(layoutManager);
recommendRecyclerView.setItemAnimator(new DefaultItemAnimator());
bookRrefreshLayout.setOnLoadMoreListener(new OnLoadMoreListener() {
@Override
public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
if (bookRankListAdapter != null) {
mPresenter.getNextPageContent(bookRankUrl, bookRankListAdapter.getPageNumber() + 1);
}
}
});
bookRrefreshLayout.setOnRefreshListener(new OnRefreshListener() {
@Override
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
mPresenter.initBookRankListData(bookRankUrl);
}
});
}
Aggregations