美文网首页
XRefreshLayout, 无侵入刷新你所有LayoutMa

XRefreshLayout, 无侵入刷新你所有LayoutMa

作者: 李晓俊 | 来源:发表于2017-04-04 19:33 被阅读89次

    XRefreshLayout

    Github Repository : https://github.com/li-xiaojun/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 :

    • refresh RecyclerView for GridLayoutManager :

    • refresh RecyclerView for LinearLayoutManager :

    • refresh NestedScrollView :

    Depedency

    Step 1. Add it in your root build.gradle at the end of repositories:

    allprojects {
        repositories {
            ...
            maven { url 'https://jitpack.io' }
        }
    }
    

    Step 2. Add the dependency

    dependencies {
        compile 'com.github.li-xiaojun:XRefreshLayout:1.0.0'
    }
    

    Get Start

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

    相关文章

      网友评论

          本文标题:XRefreshLayout, 无侵入刷新你所有LayoutMa

          本文链接:https://www.haomeiwen.com/subject/oijzottx.html