The drop-down refresh of the WaveSwipeRefreshLayout water drop effect is very good.

WaveSwipeRefreshLayout

introduce:

The drop-down refresh of the water drop effect is very good.

running result:

Instructions for use:

1) build.gradle.

1
2
3
4
5
6
7
8
9
repositories {
     maven {
         url  "https://jitpack.io"
     }
}
 
dependencies {
   compile  'com.github.recruit-lifestyle:WaveSwipeRefreshLayout:1.1'
}

2) Add jp.co.recruit_lifestyle.android.widget.WaveSwipeRefreshLayout to the xml layout file, which must contain at least one AbsListView.

1
2
3
4
5
6
7
8
9
10
11
<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>

3) Monitoring and callback

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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);
   }
}

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326765918&siteId=291194637