Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
P

PullLoadMoreRecyclerView

> 编程语言
Open source

实现RecyclerView下拉刷新和上拉加载更多以及RecyclerView线性、网格、瀑布流效果演示

1.4K stars0 likes0 views
WebsiteGitHub

About

实现RecyclerView下拉刷新和上拉加载更多以及RecyclerView线性、网格、瀑布流效果演示

实现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);//参数为列数

绑定适配器

…

调用下拉刷新和加载更多

 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();

联系我

我的微信公众号:吴小龙同学,欢迎关注交流。

个人博客

https://wuxiaolong.github.io/

License

Apache-2.0

GitHub Issues· 0 open

View all on GitHub

No open issues yet, or sync has not completed.

Highlights

  • •Java

> Tags

Java

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言