Android教程網
  1. 首頁
  2. Android 技術
  3. Android 手機
  4. Android 系統教程
  5. Android 游戲
 Android教程網 >> Android技術 >> Android開發 >> 關於android開發 >> 水滴效果的下拉刷新--第三方開源 開源--WaveSwipeRefreshLayout,swiperefreshlayout

水滴效果的下拉刷新--第三方開源 開源--WaveSwipeRefreshLayout,swiperefreshlayout

編輯:關於android開發

水滴效果的下拉刷新--第三方開源 開源--WaveSwipeRefreshLayout,swiperefreshlayout


下載地址:https://github.com/recruit-lifestyle/WaveSwipeRefreshLayout

直接把代碼復制到你的項目於即可使用:

 

使用:

在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代碼:

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

 

  1. 上一頁:
  2. 下一頁:
熱門文章
閱讀排行版
Copyright © Android教程網 All Rights Reserved