This repository has been archived by the owner on Sep 27, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
122 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
language: android | ||
|
||
sudo: false | ||
|
||
android: | ||
components: | ||
- platform-tools | ||
- tools | ||
- build-tools-23.0.3 | ||
- android-23 | ||
- extra-android-m2repository | ||
- extra-google-m2repository | ||
|
||
script: | ||
- ./gradlew assembleRelease | ||
mvim | ||
deploy: | ||
provider: releases | ||
api_key: | ||
secure: uNBKygZvLAvIZZG9gssfqIWwU0eXXstCmWfZXk9Z40rutmPuJg5d6vJCLi0fYUU16bGywfDJn8nsOlRJibgLbA7+k29GkCIzsXUNoDpWnEFZBCVCkAnKgqU6KYdza29tapZ8+owDlfsCxHRUjAjWGO4pl6FNM0XozoUCZtLUg0I0Tnh8y0oGwZTTRk4gaxpYhTkTbL+twnvHd9CUCEz4+N6ABJTkf3Trl69iPOg38Qvxb3qzVcTCWgCI5CFqrOxfu9H6nC43c4iUghtE8KRiAdINdSvQKU2paI0oBS1e0qIRZysmHJFAABqLSkbHbPubAEhINrIap5/gwu2TpWEbiD2ZQrgF8znq5Q5hrWtxpKEnCSTf812EZChJTAsDkzSJLGqLRZRPdJ1/Cl1YKo+EdXQKr8W11L4cA9/8dJNWd+VPGKiR3rN5NPk3lbzqbw4YSHSfoVbarZMGV4xbXJ/EXFUnb5Mj4AYQbbmZgS08CEi4ni7GA92utH0crps4u6YtIT5gmdE8eZXi4grWTxaeais5NsIyyrdu9qsDZfnxLzlLX9KBxdWanCEfmMlJPhiq1eqw91PHHLY9Wekdd383BK+Sd3pERokhT8QDSFHNRZv1YDKxza8A/dsKcOFlHZo17dm4TqCaRn0jMeyvcX1XpgFe0uDj8vlaUR+YtB6HMG8= | ||
file: library/build/outputs/aar/library-release.aar | ||
on: | ||
tags: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,58 @@ | ||
## PullLaunchRocket | ||
|
||
[中文文档](./README_CHN.md) | ||
|
||
[![Twitter](https://img.shields.io/badge/Twitter-@LuMengHZ-blue.svg?style=flat-square)](https://twitter.com/LuMengHZ) | ||
[![License](https://img.shields.io/github/license/lubeast/PullLaunchRocket.svg?style=flat-square)](https://github.com/lubeast/PullLaunchRocket/blob/master/LICENSE) | ||
|
||
Thanks to [Yalantis](https://github.com/Yalantis) for creating a great logic of `PullToRefresh`. And that's logic is the fundation of `PullLaunchRocket` also. | ||
|
||
![sample](https://raw.github.com/lubeast/PullLaunchRocket/master/screenshots/sample.gif) | ||
|
||
### Usage | ||
*You can have a look at Sample Project* `sample` for better use. | ||
1.include the library as local library project in your module-level `build.gradle` | ||
```groove | ||
compile 'com.lumenghz' | ||
``` | ||
|
||
2. `PullToRefreshView` widget in your layout.xml | ||
```xml | ||
<lumenghz.com.pullrefresh.PullToRefreshView | ||
android:id="@+id/pull_to_refresh" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
app:lrefresh="rocket" | ||
> | ||
|
||
<ListView | ||
android:id="@+id/list_view" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:divider="@null" | ||
android:dividerHeight="0dp" | ||
android:fadingEdge="none" | ||
/> | ||
|
||
</lumenghz.com.pullrefresh.PullToRefreshView> | ||
``` | ||
|
||
3. Initial the `PullToRefreshView` and setup `OnRefreshListener` in your `onCreate` method | ||
```java | ||
mPullToRefreshView.setOnRefreshListener(new PullToRefreshView.OnRefreshListener() { | ||
@Override | ||
public void onRefresh() { | ||
mPullToRefreshView.postDelayed(new Runnable() { | ||
@Override | ||
public void run() { | ||
mPullToRefreshView.setRefreshing(false); | ||
} | ||
}, REFRESH_DELAY); | ||
} | ||
}); | ||
``` | ||
|
||
4.You can change refresh state through call | ||
```java | ||
mPullToRefreshView.setRefreshing(boolean isRefreshing) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
## PullLaunchRocket | ||
|
||
[![Twitter](https://img.shields.io/badge/Twitter-@LuMengHZ-blue.svg?style=flat-square)](https://twitter.com/LuMengHZ) | ||
[![License](https://img.shields.io/github/license/lubeast/PullLaunchRocket.svg?style=flat-square)](https://github.com/lubeast/PullLaunchRocket/blob/master/LICENSE) | ||
|
||
感谢[Yalantis](https://github.com/Yalantis)为下拉刷新创建了一个炒鸡棒的逻辑案例, 也是`PullLaunchRocket`的基础. | ||
|
||
![sample](https://raw.github.com/lubeast/PullLaunchRocket/master/screenshots/sample.gif) | ||
|
||
### 使用 | ||
*为了更好使用也可参照示例工程`sample`* | ||
|
||
1.在module层级`build.gradle`中加入 | ||
`compile 'com.lumenghz.'pullrefresh` | ||
2.在布局文件中使用`PullToRefreshView` | ||
```xml | ||
<lumenghz.com.pullrefresh.PullToRefreshView | ||
android:id="@+id/pull_to_refresh" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
app:lrefresh="rocket" | ||
> | ||
|
||
<ListView | ||
android:id="@+id/list_view" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:divider="@null" | ||
android:dividerHeight="0dp" | ||
android:fadingEdge="none" | ||
/> | ||
|
||
</lumenghz.com.pullrefresh.PullToRefreshView> | ||
``` | ||
3.在`onCreate`方法中初始化此View并添加刷新监听 | ||
```java | ||
mPullToRefreshView.setOnRefreshListener(new PullToRefreshView.OnRefreshListener() { | ||
@Override | ||
public void onRefresh() { | ||
mPullToRefreshView.postDelayed(new Runnable() { | ||
@Override | ||
public void run() { | ||
mPullToRefreshView.setRefreshing(false); | ||
} | ||
}, REFRESH_DELAY); | ||
} | ||
}); | ||
``` | ||
4.你可以调用`mPullToRefreshView.setRefreshing(boolean isRefreshing);`修改刷新状态. |