Android实现了下拉刷新的自定义布局: CircleRefreshLayout
一个实现了下拉刷新的自定义布局,动画效果不错。

使用说明:
动画的灵感来自于: https://dribbble.com/shots/1797373-Pull-Down-To-Refresh 。
<com.tuesda.walker.circlerefresh.CircleRefreshLayout xmlns:app="http://schemas.android.com/apk/res-auto" app:AniBackColor="#ff8b90af" app:AniForeColor="#ffffffff" app:CircleSmaller="6" android:id="@+id/refresh_layout" android:layout_width="match_parent" android:layout_height="match_parent"> <ListView android:background="#ffffffff" android:id="@+id/list" android:layout_width="match_parent" android:layout_height="match_parent"> </ListView> </com.tuesda.walker.circlerefresh.CircleRefreshLayout>
在刷新开始和完成的时候回调:
mRefreshLayout.setOnRefreshListener( new CircleRefreshLayout.OnCircleRefreshListener() { @Override public void refreshing() { // do something when refresh starts } @Override public void completeRefresh() { // do something when refresh complete } });
在刷新完成的时候(比如,图片加载完成),你可以触发:
mRefreshLayout.finishRefreshing();
本文由用户 jopen 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
转载本站原创文章,请注明出处,并保留原始链接、图片水印。
本站是一个以用户分享为主的开源技术平台,欢迎各类分享!