android-PullRefreshLayout

介绍:

类似与谷歌的SwipeRefreshLayout,但比SwipeRefreshLayout漂亮。

运行效果:

使用说明:

使用方法和SwipeRefreshLayout差不多。

在xml中:

<com.baoyz.widget.PullRefreshLayout
    android:id="@+id/swipeRefreshLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <!-- ListView、ScrollView、RecyclerView、Other -->
</com.baoyz.widget.PullRefreshLayout>

实例化:

PullRefreshLayout layout = (PullRefreshLayout) findViewById(...);
// listen refresh event
layout.setOnRefreshListener(new PullRefreshLayout.OnRefreshListener() {
    @Override
    public void onRefresh() {
        // start refresh
    }
});
// refresh complete
layout.setRefreshing(false);

改变刷新样式:

layout.setRefreshStyle(PullRefreshLayout.STYLE_CIRCLES);

有三种样式,分别是:CIRCLESWATER_DROPRING.

已下载
0