SmileRefresh

by songixan

songixan / SmileRefresh

微笑下拉刷新。这是在 SwipeRefreshLayout基础上修改的下拉刷新库。

203 Stars 19 Forks Last release: almost 4 years ago (1.1) 11 Commits 2 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

SmileRefresh

这里写图片描述

描述:

PullToRefreshView 是基于v4库的SwipeRefreshLayout上修改的动画的,SwipeRefreshLayout 有的方法PullToRefreshView 也有。

引入:

1.在Properties的build.gradle 添加

allprojects {
    repositories {
        ......
        maven { url "https://jitpack.io" }

}

}

2.在Module的build.gradle 添加 ```java compile 'com.github.songixan:SmileRefresh:1.1'

####用法:



  1. xml添加

        <com.song.refresh_view.pulltorefreshview xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/refreshView" tools:context="com.songxian.smilerefresh.MainActivity">
    
            <listview android:id="@+id/list" android:layout_width="match_parent" android:layout_height="match_parent"></listview>
    
        </com.song.refresh_view.pulltorefreshview>
  2. java设置

  • 初始化

```java mRefreshView = (PullToRefreshView) findViewById(R.id.refreshView); mRefreshView.setColorSchemeColors(Color.RED,Color.BLUE); // 颜色 mRefreshView.setSmileStrokeWidth(8); // 设置绘制的笑脸的宽度 mRefreshView.setSmileInterpolator(new LinearInterpolator()); // 笑脸动画转动的插值器 mRefreshView.setSmileAnimationDuration(2000); // 设置笑脸旋转动画的时长 //设置下拉刷新监听 mRefreshView.setOnRefreshListener(new PullToRefreshView.OnRefreshListener() { @Override public void onRefresh() { requestData(); //请求数据 }

        });

  • 刷新完成
// 请求数据完成
 mRefreshView.setRefreshing(false);

博客:http://blog.csdn.net/qq_32464809/article/details/52809722

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.