ShimmerRecyclerView是一个可以在加载数据的时候显示闪烁效果(Shimmer)的 RecyclerView。这个 RecyclerView 内置一个 adapter,控制 shimmer 的外观。
使用方法说明什么的不再在介绍,可去github上搜索。
说一下注意事项:
预加载的闪烁布局界面里的子控件一定要使用View,不然不会出现闪烁效果。像下面这样
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_margin="@dimen/kj_space_5"
android:layout_width="match_parent"
android:layout_height="@dimen/kj_space_30">
<View
android:alpha="0.5"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#9B9C9C"/>
</LinearLayout>