XRefreshLayout

by li-xiaojun

li-xiaojun /XRefreshLayout

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

128 Stars 29 Forks Last release: over 3 years ago (1.0.4) Other 12 Commits 5 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

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

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

Get Start

  • make your layout
  

  <android.support.v7.widget.recyclerview android:id="@+id/recyclerview" android:layout_width="match_parent" android:layout_height="match_parent"></android.support.v7.widget.recyclerview>

</com.lxj.xrefreshlayout.xrefreshlayout>

或者

  

  <android.support.v4.widget.nestedscrollview android:id="@+id/recyclerview" android:layout_width="match_parent" android:layout_height="match_parent"></android.support.v4.widget.nestedscrollview>

</com.lxj.xrefreshlayout.xrefreshlayout>

  • set refresh listener
  xrefreshLayout.setOnRefreshListener(new XRefreshLayout.OnRefreshListener() {
              @Override
              public void onRefresh() {
              }

          @Override
          public void onLoadMore() {
          }
      });

  • finish refresh
  xrefreshLayout.completeRefresh();
  • set custom loadinglayout
  //you can see the DefaultLoadingLayout for some help.
  xrefreshLayout.setLoadingLayout(...);

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.