引入步骤:
1、在 build.gradle 中添加以下依赖
//SmartRefreshLayout 开源库
implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0-alpha-21'
implementation 'com.scwang.smartrefresh:SmartRefreshHeader:1.1.0-alpha-21'
//引入design主要是为了使用RecyclerView组件
implementation 'com.android.support:design:28.0.0'
2、在XML布局文件中添加 SmartRefreshLayout
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id="@+id/srl"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/rv"
android:layout_width="match_parent"
android:layout_h