WaveSwipeRefreshLayout
- Category: List (ListView)
- Rating: ★★★★★
- Updated: 2015-08-05 11:43
- Size: 3700kb
- Development environment: Android Studio
- Views: 1804 times
- Downloads: 397 times
- Project address: https://github.com/recruit-lifestyle/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 {
}
}
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);
}
}
|