Example of Android SwipeRefreshLayout – Android Pull/Swipe Down to Refresh
Example of Android SwipeRefreshLayout – Android Pull/Swipe Down to Refresh
Android SwipeRefreshLayout is a ViewGroup that can hold only one scrollable child.
It can be either a ScrollView, ListView or RecyclerView. The basic need for a SwipeRefreshLayout is to allow the users to refresh
the screen manually. This is pretty common in the Facebook Newsfeed screen. Before this layout was available in the support library,
we had to resort to creating and detecting custom swipe down gestures to refresh let’s say a ListView.
This class consists of one important listener that is OnRefreshListener. On swiping down this listener is triggered and the OnRefresh()
method is called. We can override this method according to our needs.