1 、需求
RecyclerView多布局里面加入SwipeRefreshLayout实现下拉刷新
2、关键代码
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/mainRefresh"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/llRemind"
app:layout_constraintVertical_bias="0.0"
tools:layout_editor_absoluteX="0dp" >
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app: