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 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!