Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hsongxian/SmileRefresh
微笑下拉刷新。这是在 SwipeRefreshLayout基础上修改的下拉刷新库。
https://github.com/hsongxian/SmileRefresh
android android-library listview recyclerview refresh smilerefresh
Last synced: about 1 month ago
JSON representation
微笑下拉刷新。这是在 SwipeRefreshLayout基础上修改的下拉刷新库。
- Host: GitHub
- URL: https://github.com/hsongxian/SmileRefresh
- Owner: hsongxian
- Created: 2016-10-13T10:58:17.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-11-01T04:28:05.000Z (about 8 years ago)
- Last Synced: 2024-08-04T00:04:53.540Z (4 months ago)
- Topics: android, android-library, listview, recyclerview, refresh, smilerefresh
- Language: Java
- Homepage:
- Size: 122 KB
- Stars: 197
- Watchers: 6
- Forks: 19
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-github-android-ui - SmileRefresh - 微笑下拉刷新 (下拉刷新)
README
# SmileRefresh
![这里写图片描述](http://img.blog.csdn.net/20161013202135750)
####描述:
PullToRefreshView 是基于v4库的SwipeRefreshLayout上修改的动画的,SwipeRefreshLayout 有的方法PullToRefreshView 也有。
####引入:
1.在Properties的build.gradle 添加
```java
allprojects {
repositories {
......
maven { url "https://jitpack.io" }}
}
```
2.在Module的build.gradle 添加
```java
compile 'com.github.songixan:SmileRefresh:1.1'```
####用法:
1. xml添加
```html
```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(); //请求数据
}
});
```- 刷新完成
```java
// 请求数据完成
mRefreshView.setRefreshing(false);```
博客:http://blog.csdn.net/qq_32464809/article/details/52809722