Android 比SwipeRefreshLayout更漂亮和强大的下拉刷新控件:Android-MaterialRefreshLayout

Posted 星辰

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Android 比SwipeRefreshLayout更漂亮和强大的下拉刷新控件:Android-MaterialRefreshLayout相关的知识,希望对你有一定的参考价值。

这是一个下拉刷新的控件,它比SwipeRefreshLayout更加漂亮和强大。它易于使用并且支持API LEVEL >= 8。希望你能够喜欢。
技术分享图片

Now let me talk about MaterialRefreshLayout of function

(1)It can be done like SwipeRefreshLayout drop-down refresh effect,this is a kind of intrusive drop-down refresh.

技术分享图片

(2)However, there are some people who are not as like invasive drop-down refresh, so, it also has a non-invasive drop-down refresh function.

技术分享图片

(3)If you feel too drab, we can add a background of the wave shape.

技术分享图片

(4)If you want to make waveform covering on content, it can be done.

技术分享图片

(5)if you like the most simple effect,You can see the image below.

技术分享图片

(6)There are a lot of functions, you can see the source code...

Usage

Add dependency.

dependencies {
    compile com.cjj.materialrefeshlayout:Library:1.0.0
}

Use it in your layout xml.

<com.cjj.MaterialRefreshLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/refresh"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    >
      <...ListView or GridView or RecyclerView or ScrollView and more...>

</com.cjj.MaterialRefreshLayout>

Get instance and use it.

 materialRefreshLayout = (MaterialRefreshLayout) findViewById(R.id...);
 materialRefreshLayout.setMaterialRefreshListener(new MaterialRefreshListener() {
      @Override
      public void onRefresh(final MaterialRefreshLayout materialRefreshLayout) {
          //refreshing...
      }
  }
// refresh complete 
materialRefreshLayout.finishRefresh();

项目主页:http://www.open-open.com/lib/view/home/1442240411977

以上是关于Android 比SwipeRefreshLayout更漂亮和强大的下拉刷新控件:Android-MaterialRefreshLayout的主要内容,如果未能解决你的问题,请参考以下文章

使用SwipeRefreshLayout和RecyclerView实现仿“简书”下拉刷新和上拉加载更多

为啥 android webview 比原生 android 浏览器慢很多?

NSURLConnection 执行速度比 android 慢

Android:拍摄的照片比预览大

行情Android系统各版本占比出炉 你吃上8.0了吗?

android 发布的 apk 比调试 apk 大