RecyclerRefreshLayout
A pull to refresh layout for android, the RecyclerRefreshLayout is based on the SwipeRefreshLayout. support all the views, highly customizable, code simplicity, etc. really a practical RefreshLayout!
RecyclerRefreshLayout based on the {@link android.support.v4.widget.SwipeRefreshLayout} The RecyclerRefreshLayout should be used whenever the user can refresh the contents of a view via a vertical swipe gesture. The activity that instantiates this view should add an OnRefreshListener to be notified whenever the swipe to refresh gesture is completed.
The RecyclerRefreshLayout will notify the listener each and every time the gesture is completed again; the listener is responsible for correctly determining when to actually initiate a refresh of its content. If the listener determines there should not be a refresh, it must call setRefreshing(false) to cancel any visual indication of a refresh. If an activity wishes to show just the progress animation, it should call setRefreshing(true). To disable the gesture and progress animation, call setEnabled(false) on the view.
Installation
Add the following dependency to your build.gradle file:
Usage
Config in xml
Configure the attributes(* must)
Set the listener to be notified when a refresh is triggered via the swipe gesture.
Notify the widget that refresh state has changed. Do not call this
when refresh is triggered by a swipe gesture.
Configure the attributes(optional)
Set the interpolator used by the animation that move the refresh view
the release point to the refreshing point.
Set the interpolator used by the animation that move the refresh view
from the refreshing point or (the release point) to the start point.
Set the duration used by the animation that move the refresh view
the release point to the refreshing point.
Set the duration used by the animation that move the refresh view
from the refreshing point or (the release point) to the start point.
Set the top position of the RefreshView relative to its parent.
Set The minimum distance that trigger refresh
Set the style of the RefreshView
Customize
Customize a refresh view (need to implements IRefreshStatus
) for RecyclerRefreshLayout
.
Eg. RefreshView or RefreshViewEg
Customize a drag distance converter (need to implements IDragDistanceConverter
) for RecyclerRefreshLayout
.
Eg. MaterialDragDistanceConverter or DragDistanceConverterEg