其實這個動畫效果 我們自己以前的項目中也是需要的 後面還是在新聞快訊 的開源項目中找到的,這個是Google自己弄得 一個2014年自己弄的一個針對listview 添加重新整理資料的動畫效果的控件 SwipeRefreshLayout
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipe_container"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<ListView
android:id="@+id/lv_listview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/tv_onclick111" >
</ListView>
</android.support.v4.widget.SwipeRefreshLayout>
其中用到的方法也很簡單
swipeRefreshLayout.setOnRefreshListener( new OnRefreshListener());
這個是用來加載資料的方法
還有一個比較重要的方法是 setColorScheme(int colorRes1, int colorRes2, int colorRes3, int colorRes4);
swipeRefreshLayout.setColorScheme(android.R.color.holo_blue_bright,
android.R.color.holo_green_light,
android.R.color.holo_orange_light,
android.R.color.holo_red_light);