你的位置:首页 > 操作系统

[操作系统]水滴效果的下拉刷新


直接把代码复制到你的项目于即可使用:

 

使用:

<jp.co.recruit_lifestyle.android.widget.WaveSwipeRefreshLayout    android:layout_width="match_parent"    android:layout_height="match_parent"    android:id="@+id/main_swipe">   <ListView     android:id="@+id/main_list"     android:layout_width="match_parent"     android:layout_height="match_parent"/></jp.co.recruit_lifestyle.android.widget.WaveSwipeRefreshLayout>

 

JAVA代码:

mWaveSwipeRefreshLayout = (WaveSwipeRefreshLayout) findViewById(R.id.main_swipe);mWaveSwipeRefreshLayout.setOnRefreshListener(new WaveSwipeRefreshLayout.OnRefreshListener() { @Override public void onRefresh() {  // Do work to refresh the list here.  new Task().execute(); }});private class Task extends AsyncTask<Void, Void, String[]> { ... @Override protected void onPostExecute(String[] result) {  // Call setRefreshing(false) when the list has been refreshed.  mWaveSwipeRefreshLayout.setRefreshing(false);  super.onPostExecute(result); }}