Drop-down refresh of the Water Drop effect -- third-party open source -- WaveSwipeRefreshLayout and swiperefreshlayout

Source: Internet
Author: User

Drop-down refresh of the Water Drop effect -- third-party open source -- WaveSwipeRefreshLayout and swiperefreshlayout

: Https://github.com/recruit-lifestyle/WaveSwipeRefreshLayout

You can directly copy the code to your project:

 

Usage:

In xml:

<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 code:

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);  }}

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.