A pull to refresh you can call your own
▻https://hackernoon.com/a-pull-to-refresh-you-can-call-your-own-6609870a1806?source=rss----3a814
Introduced in 22.1.0, the SwipeToRefreshLayout has become a staple in many modern Android apps. This is my attempt at creating a simple SwipeToRefreshLayout clone utilizing the ValueAnimator and the Android Touch Framework.Lets first summarize the two functions from the Android touch framework used in this tutorial : onInterceptTouchEvent and onTouchEvent.onInterceptTouchEvent allows a viewgroup to “intercept” a touch event and decide whether to pass it on to its child or consume the event for itself. Hence, this function is a part of the ViewGroup and not View.onTouchEvent is present in both the View and ViewGroup class. In the Viewgroup class, this function is only called when the parent decides not to pass on the touch event to its children (i.e it passes true on (...)