美文网首页
常用依赖

常用依赖

作者: 树新蜜蜂 | 来源:发表于2019-07-30 18:37 被阅读0次

SmartRefreshLayout 依赖

implementation 'com.scwang.smartrefresh:SmartRefreshHeader:1.1.0-andx-15'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'

优点:
支持多点触摸
支持淘宝二楼和二级刷新
支持嵌套多层的视图结构布局(LinearLayout,FrameLayout ......)
支持所有的View(AbsListView,RecyclerView,WebView ....查看)
支持自定义并且已经集成了很多炫酷的Header和Footer。
支持和ListView的无缝同步滚动和CoordinatorLayout的嵌套滚动。
支持自动刷新,自动上拉加载(自动检测列表惯性滚动到底部,而不用手动上拉)。
支持自定义回弹动画的插值器,实现各种炫酷的动画效果。
支持设置主题来适配任何场景的App,不会出现炫酷但很尴尬的情况。
支持设多种滑动方式:平移,拉伸,背后固定,顶层固定,全屏
支持所有可滚动视图的越界回弹
支持Header和Footer交换混用
支持AndroidX

用法

<?xml version = “ 1.0 ” encoding = “ utf-8 ”?>
< com .scwang.smartrefresh.layout.SmartRefreshLayout xmlns :android = “ http://schemas.android.com/apk/res/android ”
     android :id = “ @ + id / refreshLayout ”
     android :layout_width = “ match_parent ”
     android :layout_height = “ match_parent ” >
    < android .support.v7.widget.RecyclerView
         android :id = “ @ + id / recyclerView ”
         android :layout_width = “ match_parent ”
         android :layout_height = “ match_parent ”
         android :overScrollMode = “ never ”
         android :background = “# fff ” />
</ com .scwang.smartrefresh.layout.SmartRefreshLayout>

3.在活动或者片段中添加代码

RefreshLayout refreshLayout =(RefreshLayout)findViewById(ř 。 ID 。 refreshLayout);
refreshLayout 。setOnRefreshListener(new  OnRefreshListener(){
     @ 
    Override public  void  onRefresh(RefreshLayout  refreshlayout){
        refreshlayout 。finishRefresh(2000 / *,false * /); //传入虚假表示刷新失败
    }
});
refreshLayout 。setOnLoadMoreListener(new  OnLoadMoreListener(){
     @ 
    Overver public  void  onLoadMore(RefreshLayout  refreshlayout){
        refreshlayout 。finishLoadMore(2000 / *,false * /); //传入虚假表示加载失败
    }
});

相关文章

  • 常用依赖

    1. 实现数字滚动 动态效果 https://github.com/inorganik/CountUp.js 2....

  • 常用依赖

    SmartRefreshLayout 依赖 优点:支持多点触摸支持淘宝二楼和二级刷新支持嵌套多层的视图结构布局(L...

  • 常用依赖

    implementation 'com.google.code.gson:gson:2.2.4' implemen...

  • Android常用依赖

    Retrofit RxJava&RxAndroid okhttp拦截器,打印网络请求日志

  • 常用依赖包

    maven中央仓库http://maven.outofmemory.cn/ Spring Web 包含spring...

  • Android常用依赖

    cardView布局依赖 RecyclerView布局依赖 Banner依赖 Gson依赖 Okhtt 依赖 Re...

  • Android常用依赖

    Fresco(依赖) Fresco是FaceBook推出的一个Android开源图片管理框架,它提供了图片下载、渐...

  • Android常用依赖

    ### Gson解析依赖 implementation 'com.google.code.gson:gson:2....

  • Maven常用依赖

    1、数据库连接mybatis 2、JSON相关 3、HTTP相关

  • python 常用依赖

    https://pypi.org

网友评论

      本文标题:常用依赖

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