WuXiaolong/PullLoadMoreRecyclerView
WuXiaolong/PullLoadMoreRecyclerView has 1,382 GitHub stars and 364 forks. GitHot measured 0 stars in 24 hours and 0 in 7 days. Last checked 2026-11-09 05:28 UTC. Last push 2024-09-30.
实现RecyclerView下拉刷新和上拉加载更多以及RecyclerView线性、网格、瀑布流效果演示
Measured star growth
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
Original实现RecyclerView下拉刷新和上拉加载更多以及RecyclerView线性、网格、瀑布流效果演示。如果你只需要简单地实现下拉刷新和上拉加载效果,不需要定制,那PullLoadMoreRecyclerView最适合不过。
效果预览

使用方法
build.gradle文件
dependencies {
compile 'com.wuxiaolong.pullloadmorerecyclerview:library:1.1.2'
}
xml引用
<com.wuxiaolong.pullloadmorerecyclerview.PullLoadMoreRecyclerView
android:id="@+id/pullLoadMoreRecyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
设置线性布局
mPullLoadMoreRecyclerView = (PullLoadMoreRecyclerView) view.findViewById(R.id.pullLoadMoreRecyclerView);
mPullLoadMoreRecyclerView.setLinearLayout();
设置网格布局
mPullLoadMoreRecyclerView.setGridLayout(2);//参数为列数
设置交错网格布局,即瀑布流效果
mPullLoadMoreRecyclerView.setStaggeredGridLayout(2);//参数为列数
绑定适配器
mRecyclerViewAdapter = new RecyclerViewAdapter();
mPullLoadMoreRecyclerView.setAdapter(mRecyclerViewAdapter);
public class RecyclerViewAdapter extends RecyclerView.Adapter<RecyclerViewAdapter.ViewHolder> {
public RecyclerViewAdapter() {
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.recycler_view_item, parent, false);
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
}
@Override
public int getItemCount() {
return 0;
}
public class ViewHolder extends RecyclerView.ViewHolder {
public ViewHolder(View itemView) {
super(itemView);
}
}
}
调用下拉刷新和加载更多
mPullLoadMoreRecyclerView.setOnPullLoadMoreListener(new PullLoadMoreRecyclerView.PullLoadMoreListener() {
@Override
public void onRefresh() {
}
@Override
public void onLoadMore() {
}
});
刷新结束
mPullLoadMoreRecyclerView.setPullLoadMoreCompleted();
其他方法
显示下拉刷新
mPullLoadMoreRecyclerView.setRefreshing(true);
不需要下拉刷新
mPullLoadMoreRecyclerView.setPullRefreshEnable(false);
不需要上拉刷新
mPullLoadMoreRecyclerView.setPushRefreshEnable(false);
设置上拉刷新文字
mPullLoadMoreRecyclerView.setFooterViewText("loading");
设置上拉刷新文字颜色
mPullLoadMoreRecyclerView.setFooterViewTextColor(R.color.white);
设置加载更多背景色
mPullLoadMoreRecyclerView.setFooterViewBackgroundColor(R.color.colorBackground);
设置下拉刷新颜色
mPullLoadMoreRecyclerView.setColorSchemeResources(android.R.color.holo_red_dark,android.R.color.holo_blue_dark);
快速Top
mPullLoadMoreRecyclerView.scrollToTop();
联系我
我的微信公众号:吴小龙同学,欢迎关注交流。

个人博客
License
Explore related projects
codecrafters-io/build-your-own-x
Master programming by recreating your favorite technologies from scratch.
561,210 starspublic-apis/public-apis
A collective list of free APIs
497,425 starsmorluto/rea
Reverse engineer anything with agents, from app behavior down to native binaries.
445,356 starsopenclaw/openclaw
The AI that really does things. Any OS. Any Platform. The lobster way. 🦞
394,225 stars