A more beautiful and powerful pull-down refresh control than SwipeRefreshLayout: Android-MaterialRefreshLayout

This is a pull-to-refresh control, which is more beautiful and powerful than SwipeRefreshLayout. It is easy to use and supports API LEVEL >= 8. Hope you like it.

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

 

Project home page: http://www.open-open.com/lib/view/home/1442240411977

Guess you like

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