首页 » Andorid » 临时分类 » 正文

XRefreshLayout

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

    或者

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

下载 (0)

发表评论