【开源】Taurus
Taurus
- https://github.com/Yalantis/Phoenix
介绍:
开发商Yalantis在继 Phoenix 之后的又一个很酷的下拉刷新源码。这是下拉出现的是一个飞机。运行效果:
![]()
使用说明:
开发商Yalantis的网站 http://yalantis.com/works
使用方法和Phoenix是完全一样的(其实整个项目代码相似度应该在90%以上)
在布局中添加PullToRefreshView
<com.yalantis.taurus.PullToRefreshView android:id="@+id/pull_to_refresh" android:layout_width="match_parent" android:layout_height="match_parent" app:type="sun"> <ListView android:id="@+id/list_view" android:divider="@null" android:dividerHeight="0dp" android:layout_width="match_parent" android:layout_height="match_parent" /> </com.yalantis.taurus.PullToRefreshView>
在onCreate中设置监听者
mPullToRefreshView = (PullToRefreshView) findViewById(R.id.pull_to_refresh);
mPullToRefreshView.setOnRefreshListener(new PullToRefreshView.OnRefreshListener() {
@Override
public void onRefresh() {
mPullToRefreshView.postDelayed(new Runnable() {
@Override
public void run() {
mPullToRefreshView.setRefreshing(false);
}
}, REFRESH_DELAY);
}
});
posted on 2015-04-29 10:21 wasdchenhao 阅读(192) 评论(0) 收藏 举报

浙公网安备 33010602011771号