Are you happy with your logging solution? Would you help us out by taking a 30-second survey? Click here


a RecyclerView that implements pullrefresh and loadingmore can use it like a standard RecyclerView

Subscribe to updates I use XRecyclerView

Statistics on XRecyclerView

Number of watchers on Github 3901
Number of open issues 239
Average time to close an issue about 1 month
Main language Java
Average time to merge a PR about 20 hours
Open pull requests 13+
Closed pull requests 2+
Last commit over 1 year ago
Repo Created almost 4 years ago
Repo Last Updated over 1 year ago
Size 6.35 MB
Organization / Authorxrecyclerview
Page Updated
Do you use XRecyclerView? Leave a review!
View open issues (239)
View XRecyclerView activity
View on github
Fresh, new opensource launches 🚀🚀🚀
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating XRecyclerView for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)


a RecyclerView that implements pullrefresh , loadingmore and header can use it like a standard RecyclerView. you don't need to implement a special adapter .qq 478803619



on real device it is much more smoother.



// 1.5.9 is the main
compile 'com.jcodecraeer:xrecyclerview:1.5.9'

just like a standard RecyclerView

LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());

pull to refresh and load more

the pull to refresh and load more featrue is enabled by default. we provide a callback to trigger the refresh and LoadMore event.

 mRecyclerView.setLoadingListener(new XRecyclerView.LoadingListener() {
    public void onRefresh() {
       //refresh data here

    public void onLoadMore() {
       // load more data here

new function of 1.5.7 version.

    .getDefaultRefreshHeaderView() // get default refresh header view
    .setRefreshTimeVisible(true);  // make refresh time visible,false means hiding

// if you are not sure that you are 100% going to
// have no data load back from server anymore,do not use this
public void setEmptyView(View emptyView) {

new function of 1.5.6 version,fixed a memory leak problem,use the code below to release XR's memory

// any time,when you finish your activity or fragment,call this below
if(mRecyclerView != null){
    mRecyclerView.destroy(); // this will totally release XR's memory
    mRecyclerView = null;

new function of 1.5.3 version,you can use XR in the sticky scroll model now,like the code below,the demo activity is 'LinearStickyScrollActivity'

final View topView = findViewById(;
final View tabView = findViewById(;
final View content = findViewById(;

final StickyScrollLinearLayout s = findViewById(;
        new View.OnLayoutChangeListener() {
            public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
                if(s.getContentView() != null)
                //  height  =0
                // add from here just in case they height==0
                        new StickyScrollLinearLayout.StickyScrollInitInterface() {
                            public View setTopView() {
                                return topView;

                            public View setTabView() {
                                return tabView;

                            public View setContentView() {
                                return content;

call notifyItemRemoved or notifyItemInserted, remember to use the functions inside XRecyclerView


and of course you have to tell our RecyclerView when the refreshing or loading more work is done. you can use


to control when the item number of the screen is list.size-2,we call the onLoadMore

mRecyclerView.setLimitNumberToCallLoadMore(2); // default is 1

to notify that the loading more work is done. and


to notify that the refreshing work is done.

here is what we get:


call refresh() manually(I change the previous setRefreshing() method to refresh() )


custom refresh and loading more style

pull refresh and loading more style is highly customizable.

custom loading style

the loading effect we use the AVLoadingIndicatorView . and it is built in(make a little change). we provide all the effect in AVLoadingIndicatorView library besides we add a system style. you can call

mRecyclerView.setRefreshProgressStyle(int style);


mRecyclerView.setLaodingMoreProgressStyle(int style);

to set the RefreshProgressStyle and LaodingMoreProgressStyle respectively.

for example





BallPulse effect


all the effect can be get in the ProgressStyle class

public class ProgressStyle {
    public static final int SysProgress=-1;
    public static final int BallPulse=0;
    public static final int BallGridPulse=1;
    public static final int BallClipRotate=2;
    public static final int BallClipRotatePulse=3;
    public static final int SquareSpin=4;
    public static final int BallClipRotateMultiple=5;
    public static final int BallPulseRise=6;
    public static final int BallRotate=7;
    public static final int CubeTransition=8;
    public static final int BallZigZag=9;
    public static final int BallZigZagDeflect=10;
    public static final int BallTrianglePath=11;
    public static final int BallScale=12;
    public static final int LineScale=13;
    public static final int LineScaleParty=14;
    public static final int BallScaleMultiple=15;
    public static final int BallPulseSync=16;
    public static final int BallBeat=17;
    public static final int LineScalePulseOut=18;
    public static final int LineScalePulseOutRapid=19;
    public static final int BallScaleRipple=20;
    public static final int BallScaleRippleMultiple=21;
    public static final int BallSpinFadeLoader=22;
    public static final int LineSpinFadeLoader=23;
    public static final int TriangleSkewSpin=24;
    public static final int Pacman=25;
    public static final int BallGridBeat=26;
    public static final int SemiCircleSpin=27;

refresh arrow icon

we provide a default arrow icon:


but if you don't like it,you can replace it with any other icon you want. just call



disable refresh and load more featrue

if you don't want the refresh and load more featrue(in that case,you probably dont'n need the lib neither),you can call




in which false means disabled ,true means enabled.


you can add header to XRecyclerViewjust call addHeaderView().

View header =   LayoutInflater.from(this).inflate(R.layout.recyclerview_header, (ViewGroup)findViewById(,false);

if you like ,you can add two header

View header =   LayoutInflater.from(this).inflate(R.layout.recyclerview_header, (ViewGroup)findViewById(,false);
View header1 =   LayoutInflater.from(this).inflate(R.layout.recyclerview_header1, (ViewGroup)findViewById(,false);


Copyright 2015 jianghejie

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.
XRecyclerView open issues Ask a question     (View All Issues)
  • almost 3 years 为什么compile导入的包和github下载的包的代码不一样?没更新吗?
  • almost 3 years the interface getLayoutPosition of ViewHolder doesn't return the right value
  • almost 3 years 请问可否去掉下拉刷新的弹性下拉效果
  • almost 3 years XRecyclerView 使用 notifyItemChanged 会闪的原因,以及解决方法
  • almost 3 years XRecyclerView getItemViewType position 从-1 开始,简直无情,附带解决方法
  • almost 3 years 适配器的getItemViewType()中的position出现负值
  • almost 3 years 发现XRecyclerView没有下传setSpanSizeLookup
  • almost 3 years 上次更新时间无法显示
  • almost 3 years 这个库还在维护的吗?无意中看到有人使用发现的bug
  • almost 3 years 这个支持其他view的下拉刷新吗?
  • almost 3 years 底部留白
  • almost 3 years 集成到Eclipse中的时候,v7和v4包冲突,怎么解决啊?
  • almost 3 years 能添加items的添加删除滑动动画就很好了,就不必再添加其他的库了
  • almost 3 years 我想知道 我想改变下字体颜色 改怎么改 为什么许多方法 都是私有的 还不对外提供扩展
  • almost 3 years 能不能支持下自定义动画头部的类似于美团的那种刷新动画
  • almost 3 years setRefreshProgressStyle有内存泄露
  • almost 3 years 关于setRefreshing(true)
  • almost 3 years 不重写getAdapter() 出现的ClassCastException
  • almost 3 years item 重复点击
  • almost 3 years 连续上拉加载时,程序会crash
  • about 3 years 自动刷新,setRefreshing(true) 不起作用
  • about 3 years 添加了Header之后position返回的值不是从0开始,设置点击事件数组越界
  • about 3 years Toolbar配合的CoordinatorLayout的layout_behavior,Toolbar无法滑动下来
  • about 3 years 下拉刷新时间不显示?上拉加载无提示?
  • about 3 years 不使用加载更多时仍然会空出一个item
  • about 3 years 怎么去掉下拉刷新的文字显示?看了下代码好像没有接口
  • about 3 years 高度未超过一屏,上拉不回调onLoadMore
  • about 3 years 为RecyclerView 添加分割线 第一条分割线在顶部
  • about 3 years 上拉加载过快,动画没有销毁引起的bug
  • about 3 years 为何设置刷新和加载更多的style没有效果。
XRecyclerView open pull requests (View All Pulls)
  • Update
  • 添加支持 : 上次更新时间
  • 添加了支持横向刷新和加载
  • 自定义下拉刷新头部样式
  • 解决issue#164 Android Studio 预览错误 Couldn't resolve resource @id/listvie…
  • add alpha change listener
  • 修复GridLayoutManager布局下setSpanSizeLookup失效问题
  • 解决内存泄漏:动画依赖context导致的泄漏以及footView的泄漏
  • Allow custom header texts
  • 仿微信通讯录
  • Update
  • // 增加自定义加载完成页面的功能,并在sample中实现
  • 修复事件的不连续导致的自动滚动
XRecyclerView list of languages used
Other projects in Java