十六、 BRVAH 笔记


1. 什么是BRVAH?全称叫: Base RecyclerView Quick Helper , 也就是我们写RecyclerView的Adapter继承的父类: BaseQuickAdapter.为了便于使用RecyclerView而开发的第三方组件。

2. 使用 RecyclerView 时,如果需要 下拉刷新,上拉加载功能,那得要跟谷歌提供的view组件: android.support.v4.widget.SwipeRefreshLayout一起配合使用:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/layout_full"
android:orientation="vertical" >

<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipeRefreshLayout"
style="@style/layout_full"
android:background="@color/color_white">

<android.support.v7.widget.RecyclerView
android:id="@+id/rvMeetingList"
style="@style/layout_full"
android:scrollbars="vertical" />

</android.support.v4.widget.SwipeRefreshLayout>

</LinearLayout>

swipeRefreshLayout.isRefreshing = true 就会在当前界面展示菊花进度条 swipeRefreshLayout.isRefreshing = false 会关闭该进度条