use of com.example.jingbin.cloudreader.adapter.CategoryArticleAdapter in project CloudReader by youlookwhat.
the class CategoryArticleFragment method initRefreshView.
private void initRefreshView() {
mAdapter = new CategoryArticleAdapter(activity);
bindingView.recyclerView.setLayoutManager(new LinearLayoutManager(activity));
bindingView.recyclerView.setItemAnimator(null);
bindingView.recyclerView.addItemDecoration(new SpacesItemDecoration(activity).setHeaderNoShowDivider(isRefresh ? 1 : 0));
bindingView.recyclerView.setRefreshHeaderView(new NeteaseRefreshHeaderView(activity));
bindingView.recyclerView.setLoadingMoreView(new NeteaseLoadMoreView(activity));
bindingView.recyclerView.setAdapter(mAdapter);
bindingView.recyclerView.setOnLoadMoreListener(new ByRecyclerView.OnLoadMoreListener() {
@Override
public void onLoadMore() {
int page = viewModel.getPage();
viewModel.setPage(++page);
getHomeList();
}
});
if (isRefresh) {
bindingView.recyclerView.setOnRefreshListener(new ByRecyclerView.OnRefreshListener() {
@Override
public void onRefresh() {
viewModel.setPage(0);
getHomeList();
}
});
}
}
use of com.example.jingbin.cloudreader.adapter.CategoryArticleAdapter in project CloudReader by youlookwhat.
the class SearchActivity method initRefreshView.
private void initRefreshView() {
binding.recyclerView.setLayoutManager(new LinearLayoutManager(this));
binding.recyclerView.setLoadingMoreView(new NeteaseLoadMoreView(this));
mAdapter = new CategoryArticleAdapter(this);
binding.recyclerView.setAdapter(mAdapter);
}
use of com.example.jingbin.cloudreader.adapter.CategoryArticleAdapter in project CloudReader by youlookwhat.
the class SearchActivity method initViewModel.
private void initViewModel() {
mAdapter = new CategoryArticleAdapter(this);
if (binding.recyclerView.getItemDecorationCount() > 0) {
binding.recyclerView.removeItemDecorationAt(0);
}
binding.recyclerView.addItemDecoration(new SpacesItemDecoration(this, SpacesItemDecoration.VERTICAL));
binding.recyclerView.setAdapter(mAdapter);
binding.recyclerView.setItemAnimator(null);
binding.recyclerView.setOnLoadMoreListener(new ByRecyclerView.OnLoadMoreListener() {
@Override
public void onLoadMore() {
int page = viewModel.getPage();
viewModel.setPage(++page);
loadWanData();
}
});
if (!TextUtils.isEmpty(keyWord)) {
viewModel.setPage(0);
loadWanData();
}
}
Aggregations