GitPedia

XRefreshLayout

【已过时,不再更新,请使用更强大的SmartRefreshLayout!】A refresh layout(无侵入下拉刷新和加载布局), can refresh RecyclerView for all LayoutManager, NestedScrollView。

From junixapp·Updated July 22, 2025·View on GitHub·

A refresh layout, can refresh RecyclerView for all LayoutManager, NestedScrollView and Any View that implements NestedScrollChild ! The project is written primarily in Java, distributed under the Other license, first published in 2017. Key topics include: pull-to-refresh, pulltorefresh, recyclerview, refreshlayout, refreshrecyclerview.

Latest release: 1.0.4增加新功能

XRefreshLayout

A refresh layout, can refresh RecyclerView for all LayoutManager, NestedScrollView and Any View that implements NestedScrollChild !

Feature

  • support RecyclerView for all LayoutManager in vertical orientation !
  • support NestedScrollView !
  • support any view that implements NestedScrollChild !
  • support custom refresh header and footer , which means you can make you wanderful animation !
  • not support ListView, GridView, ScrollView !

Screenshot

  • refresh RecyclerView for StaggeredGridLayoutManager :

    staggered

  • refresh RecyclerView for GridLayoutManager :

    grid

  • refresh RecyclerView for LinearLayoutManager :

    linear

  • refresh NestedScrollView :

    nestedscroll

  • custom refresh animation! There is two animation style now, I will support more animation in future...

    custom_anim

Gradle

groovy
dependencies { compile 'com.lxj:xrefreshlayout:0.0.1' }

Get Start

  • make your layout

    xml
    <com.lxj.xrefreshlayout.XRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:id="@+id/xrefreshLayout" android:layout_height="match_parent"> <android.support.v7.widget.RecyclerView android:id="@+id/recyclerview" android:layout_width="match_parent" android:layout_height="match_parent"/> </com.lxj.xrefreshlayout.XRefreshLayout>

    或者

    xml
    <com.lxj.xrefreshlayout.XRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:id="@+id/xrefreshLayout" android:layout_height="match_parent"> <android.support.v4.widget.NestedScrollView android:id="@+id/recyclerview" android:layout_width="match_parent" android:layout_height="match_parent"/> </com.lxj.xrefreshlayout.XRefreshLayout>

  • set refresh listener

    java
    xrefreshLayout.setOnRefreshListener(new XRefreshLayout.OnRefreshListener() { @Override public void onRefresh() { } @Override public void onLoadMore() { } });
  • finish refresh

    java
    xrefreshLayout.completeRefresh();
  • set custom loadinglayout

    java
    //you can see the DefaultLoadingLayout for some help. xrefreshLayout.setLoadingLayout(...);

Contributors

Showing top 1 contributor by commit count.

View all contributors on GitHub →

This article is auto-generated from junixapp/XRefreshLayout via the GitHub API.Last fetched: 6/28/2026