A funny Pull to refresh view on Android , you can add your own RecyclerView 一个有趣的下拉刷新 (我也不知道我为什么就要做这个下拉刷新动画)
<com.bao.ptp.PullToRefreshView
android:id="@+id/pull_to_refresh"
android:layout_below="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="#ffffff"
android:dividerHeight="1dp"
android:fadingEdge="vertical"
android:fadingEdgeLength="5dp"/>
</com.bao.ptp.PullToRefreshView>
pullToRefreshView = (PullToRefreshView) findViewById(R.id.pull_to_refresh);
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
assert recyclerView != null;
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(new SampleAdapter());
pullToRefreshView.setOnRefreshListener(new PullToRefreshView.OnRefreshListener() {
@Override
public void onRefresh() {
// your code
}
});