自动下拉刷新
模块化依赖
如果自己处理下拉刷新可跳过本章, Net可以仅仅作为简单的网络框架存在
Net可依赖三方库 BRV 实现自动处理下拉刷新
PageRefreshLayout¶
<com.drake.brv.PageRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/page"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".ui.fragment.PushRefreshFragment">
    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/rv_push"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
</com.drake.brv.PageRefreshLayout>
创建列表¶
网络请求¶
- 请求开始, 显示下拉刷新动画
 - 请求成功, 显示
内容缺省页 - 请求失败,  显示
错误缺省页 
page.onRefresh {
    scope {
        // 请求到数据设置到RecyclerView
        rv_push.models = Get<Game>(Api.PATH).await().data.list
    }
}.autoRefresh()
生命周期¶
| 生命周期 | 描述 | 
|---|---|
| 开始 | showLoading/autoRefresh触发onRefresh, 开始请求 | 
| 结束 | PageRefreshLayout被销毁, 请求自动取消 |