A PullToRefresh widget.

Min SDK   9
Latest Commit   2017-04-09 15:03:08
License   

Github   https://github.com/lubeast/PullToRefresh

         

标签

使用APP客户端扫描二维码运行Demo


...

lubeast
Glority
China


Android, IOS developer

         

类似的还有....
LoadingViewFinal android下拉刷新/加载更多组件库
SwipeToLoadLayout A reusable pull-to-refresh and pull-to-loadmore widget
RecyclerRefreshLayout A pull to refresh layout for android, the RecyclerRefreshLayout is based on the SwipeRefreshLayout. support all the views, highly customizable, code simplicity, etc
README

README.md

PullLaunchRocket

中文文档

License Travis Android Arsenal Github Issues

You guys can see another project depends on this one.

Thanks to Yalantis for creating a great logic of PullToRefresh. And that's logic is the fundation of PullLaunchRocket also.

Give me a Star please :D And welcome to contact me or make a PR if you have any good style, we make it better together.

We use Launch-Rocket as our default style.

rocket

And also, we provided a custom refresh style - sunrise

rocket

**Attention : ** version 1.0.2 is just a pre-release.

Usage

You can have a look at Sample Project sample for better use.

  • Add it in your root build.gradle at the end of repositories:
allprojects {
		repositories {
			...
			maven { url "https://jitpack.io" }
		}
	}
  • Add the dependency in your module-level build.gradle
dependencies {
    compile 'com.github.lubeast:PullToRefresh:1.0.2'
}
  • PullToRefreshView widget in your layout.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>
  • Initial the PullToRefreshView and setup OnRefreshListener in your onCreate method
mPullToRefreshView.setOnRefreshListener(new PullToRefreshView.OnRefreshListener() {
    @Override
    public void onRefresh() {
        mPullToRefreshView.postDelayed(new Runnable() {
            @Override
            public void run() {
                mPullToRefreshView.setRefreshing(false);
            }
        }, REFRESH_DELAY);
    }
 });
  • You can change refresh state through call
mPullToRefreshView.setRefreshing(boolean isRefreshing)