本文整理了Java中com.jcodecraeer.xrecyclerview.XRecyclerView
类的一些代码示例,展示了XRecyclerView
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XRecyclerView
类的具体详情如下:
包路径:com.jcodecraeer.xrecyclerview.XRecyclerView
类名称:XRecyclerView
暂无
代码示例来源:origin: wutongke/AndroidSkinAnimator
private void initRecyclerView() {
mDataBinding.recyclerView.setPullRefreshEnabled(false);
mDataBinding.recyclerView.setLoadingMoreEnabled(true);
mDataBinding.recyclerView.addHeaderView(mHeaderBinding.getRoot());
mDataBinding.recyclerView.setLayoutManager(new GridLayoutManager(this, 3));
mDataBinding.recyclerView.setNestedScrollingEnabled(false);
mDataBinding.recyclerView.setHasFixedSize(false);
mDataBinding.recyclerView.setItemAnimator(new DefaultItemAnimator());
mAdapter = new SkinLibAdapter();
mDataBinding.recyclerView.setAdapter(mAdapter);
}
代码示例来源:origin: JmStefanAndroid/PVCloudGroupn
@Override
public void init() {
mRecyclerView.setLayoutManager(new LinearLayoutManager(context));
mRecyclerView.setAdapter(new ShopCirRecyclerViewAdapter(DummyContent.ITEMS, mListener));
mRecyclerView.setLoadingListener(new XRecyclerView.LoadingListener() {
@Override
public void onRefresh() {
//refresh data here
new Handler(getActivity().getMainLooper()).postDelayed(new Runnable() {
@Override
public void run() {
mRecyclerView.refreshComplete();
}
},3000);
}
@Override
public void onLoadMore() {
// load more data here
new Handler(getActivity().getMainLooper()).postDelayed(new Runnable() {
@Override
public void run() {
mRecyclerView.loadMoreComplete();
}
},3000);
}
});
mRecyclerView.setRefreshProgressStyle(ProgressStyle.BallBeat);
mRecyclerView.setLoadingMoreProgressStyle(ProgressStyle.BallPulseSync);
}
代码示例来源:origin: CarGuo/linkagescroll
public void reset() {
setNoMore(false);
loadMoreComplete();
refreshComplete();
}
代码示例来源:origin: AdleyLong/RecyclerViewDemo
/**
* @param type 刷新完成类型
*/
public void setComplete(int type) {
switch (type) {
case REFRESH:
super.refreshComplete();
break;
case LOADMORE:
super.loadMoreComplete();
break;
default:
super.refreshComplete();
break;
}
curState = NONE;
}
代码示例来源:origin: CarGuo/linkagescroll
private void initView() {
linearLayoutManager = new LinearLayoutManager(getActivity());
listItemRecycler.setLayoutManager(linearLayoutManager);
listItemRecycler.addItemDecoration(new AlphaDividerItemDecoration(getDevider(), AlphaDividerItemDecoration.LIST));
listItemRecycler.setPullRefreshEnabled(false);
listItemRecycler.setLoadingMoreProgressStyle(ProgressStyle.SysProgress);
resolveData();
recyclerBaseAdapter = new RecyclerBaseAdapter(getActivity(), dataList);
listItemRecycler.setAdapter(recyclerBaseAdapter);
listItemRecycler.setLoadingListener(new XRecyclerView.LoadingListener() {
@Override
public void onRefresh() {
//使用的是外部全局刷新
}
@Override
public void onLoadMore() {
if (isRefreshing())
return;
setRefreshing(true);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
setRefreshing(false);
resolveData();
listItemRecycler.loadMoreComplete();
}
}, 2000);
}
});
}
代码示例来源:origin: agxxxx/AIDLMusicPlayer
private void initVie() {
mBottomMusicPlayer = new BottomMusicPlayer(this);
mBottomContainer.addView(mBottomMusicPlayer);
StaggeredGridLayoutManager staggeredGridLayoutManager = new StaggeredGridLayoutManager(2,
StaggeredGridLayoutManager.VERTICAL);
mRvContainer.setLayoutManager(staggeredGridLayoutManager);
mRvContainer.setLoadingListener(this);
mSongListAdapter = new SongListAdapter(mSong_list);
mSongListAdapter.setOnItemClickListener(mSongListAdapter);
mRvContainer.setAdapter(mSongListAdapter);
/******************************************************************/
}
代码示例来源:origin: Null-Ouwenjie/zhizhihu
mMyTrendsListView.setLayoutManager(layoutManager);
mMyTrendsListView.setAdapter(mAdapter);
mFollowerChart = ButterKnife.findById(headerView, R.id.follower_chart);
mMyTrendsListView.addHeaderView(headerView);
代码示例来源:origin: zhujun2730/WeiKanDian
private void handleResponseData(HomeNewsData homeNewsData, int type) {
if (type == PULL_TO_REFRESH) { // 下拉刷新
mProgressBar.setVisibility(View.GONE);
if (homeNewsData.getItems() != null) {
pullStep = homeNewsData.getStep();
mRecyclerView.setLoadingMoreEnabled(true);
mTextViewError.setVisibility(View.GONE);
mRecyclerView.setVisibility(View.VISIBLE);
homeNewsDataItems.clear();
homeNewsDataItems.addAll(homeNewsData.getItems());
homeRecyclerViewAdapter.notifyDataSetChanged();
} else if (homeNewsDataItems.isEmpty()) {
mTextViewError.setVisibility(View.VISIBLE);
}
mRecyclerView.refreshComplete();
} else { // 加载更多
if (homeNewsData.getItems() != null) {
moreStep = homeNewsData.getStep();
mTextViewError.setVisibility(View.GONE);
mRecyclerView.setVisibility(View.VISIBLE);
homeNewsDataItems.addAll(homeNewsData.getItems());
homeRecyclerViewAdapter.notifyDataSetChanged();
}
mRecyclerView.loadMoreComplete();
}
}
代码示例来源:origin: Null-Ouwenjie/zhizhihu
LinearLayoutManager layoutManager = new LinearLayoutManager(this);
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
mTopAnswerListView.setLayoutManager(layoutManager);
Adapter adapter = new Adapter(this, objects);
adapter.setOnItemClickListener(new OnItemClickListener() {
mTopAnswerListView.setAdapter(adapter);
代码示例来源:origin: AdleyLong/RecyclerViewDemo
/**
* 设置下拉刷新及上拉加载监听
*
* @param listener
*/
public void setLoadingListener(final LoadingListener listener) {
super.setLoadingListener(new XRecyclerView.LoadingListener() {
@Override
public void onRefresh() {
curState = REFRESH;
listener.onRefresh();
}
@Override
public void onLoadMore() {
curState = LOADMORE;
listener.onLoadMore();
}
});
}
代码示例来源:origin: zhujun2730/WeiKanDian
public View inflateView() {
LogUtil.e("HomePager inflate View ...");
View mRootView = View.inflate(mContext, R.layout.pager_home, null);
mRecyclerView = (XRecyclerView) mRootView.findViewById(R.id.recycle_view);
mRecyclerView.setLoadingMoreProgressStyle(ProgressStyle.CubeTransition);
mRecyclerView.setRefreshProgressStyle(ProgressStyle.CubeTransition);
mTextViewError = (TextView) mRootView.findViewById(R.id.tv_error);
mProgressBar = (ProgressBar) mRootView.findViewById(R.id.pb_pager_loading);
initPagerView();
return mRootView;
}
代码示例来源:origin: AdleyLong/RecyclerViewDemo
/**
* 刷新完成
*/
public void refreshComplete() {
super.refreshComplete();
}
代码示例来源:origin: AdleyLong/RecyclerViewDemo
/**
* 设置没有更多可以加载时不显示上拉加载
*/
public void setLoadingMoreEnabled(boolean b) {
super.setLoadingMoreEnabled(b);
}
代码示例来源:origin: AdleyLong/RecyclerViewDemo
/**
* 加载更多完成
*/
public void loadMoreComplete() {
super.loadMoreComplete();
}
代码示例来源:origin: CarGuo/linkagescroll
public void refreshComplete() {
mRefreshHeader.refreshComplete();
setNoMore(false);
}
代码示例来源:origin: Null-Ouwenjie/zhizhihu
mPostCountTxt.setText(detail.getDetail().getPost());
mTopAnswerListView.addHeaderView(headerView);
代码示例来源:origin: zhujun2730/WeiKanDian
private void initPagerView() {
homeNewsDataItems = new ArrayList<>();
mSubscriptions = new CompositeSubscription();
LinearLayoutManager layoutManager = new LinearLayoutManager(mContext);
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
mRecyclerView.setLayoutManager(layoutManager);
homeRecyclerViewAdapter = new HomeRecyclerViewAdapter(mContext, homeNewsDataItems);
mRecyclerView.setAdapter(homeRecyclerViewAdapter);
mRecyclerView.setLoadingListener(this);
homeRecyclerViewAdapter.setOnItemClickListener(new RecyclerItemClickListener(mContext));
}
代码示例来源:origin: agxxxx/AIDLMusicPlayer
@Override
public void onFailure(String msg) {
ToastUtil.showShortToast(MainActivity.this, msg);
mRvContainer.refreshComplete();
mRvContainer.loadMoreComplete();
}
});
代码示例来源:origin: zhujun2730/WeiKanDian
public void refreshData(String catId) {
this.catId = catId;
if (!hasInitData) {
Subscription subscribe = App.getApi().getHomeNewsData(catId, pullStep, 0,
13946282, System.currentTimeMillis())
.compose(RxApiThread.convert())
.subscribe(homeNewsData -> {
hasInitData = true;
handleResponseData(homeNewsData, PULL_TO_REFRESH);
}, e -> {
App.toast("网络君暂时出了一些问题");
mProgressBar.setVisibility(View.GONE);
mRecyclerView.refreshComplete();
});
mSubscriptions.add(subscribe);
}
}
代码示例来源:origin: ximsfei/Skin-Demo
private void initRecyclerView() {
mDataBinding.recyclerView.setPullRefreshEnabled(false);
mDataBinding.recyclerView.setLoadingMoreEnabled(true);
mDataBinding.recyclerView.addHeaderView(mHeaderBinding.getRoot());
mDataBinding.recyclerView.setLayoutManager(new GridLayoutManager(this, 3));
mDataBinding.recyclerView.setNestedScrollingEnabled(false);
mDataBinding.recyclerView.setHasFixedSize(false);
mDataBinding.recyclerView.setItemAnimator(new DefaultItemAnimator());
mAdapter = new SkinLibAdapter();
mDataBinding.recyclerView.setAdapter(mAdapter);
}
内容来源于网络,如有侵权,请联系作者删除!