Now PullToRefresh was updated version to 1.x , If you have any question or suggestion with this library , welcome to tell me !
PullToRefresh is a collection of nice pull to refresh layout for Android.
Add it in your root build.gradle at the end of repositories.
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add dependencies in build.gradle.
dependencies {
compile 'com.github.vetrio2511:PullToRefresh:v1.4'
}
Add the PullToRefreshView to your layout:
Simple
<com.vetrio.library.PullToRefreshView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/pull_to_refresh"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:progressColor="@color/colorPrimary"
app:titleColor="@color/colorPrimary"
app:titleText="@string/pull_to_refresh">
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</com.vetrio.library.PullToRefreshView>
Advance
<com.vetrio.library.PullToRefreshView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/pull_to_refresh"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:progressName="BallIndicator"
app:progressColor="@color/colorPrimary"
app:titleColor="@color/colorPrimary"
app:titleText="Pull down to refresh!"
app:showTitle="true">
......
</com.vetrio.library.PullToRefreshView>
Register listener for list pulled:
mPullToRefreshView.setOnRefreshListener(new PullToRefreshView.OnRefreshListener() {
@Override
public void onRefresh() {
//Do some thing when loading
}
});
Thanks for share library