Search code examples
androidandroid-custom-viewpull-to-refresh

How to implements a HorizontalPullTorefreshLayout in Android?


I want to implements a HorizontalPullToRefreshLayout. Now I am planed to extends FrameLayout and make it can host only one child, but if the child is a scrollable view, like ListView or RecyclerView, I don't when to pass the TouchEvent or intercept it. Is there any method to determine whether a child can scroll? Please share your idea of implements this HorizontalPullToRefreshView. My Project minSdk is 15.

Thank you for helping.


Solution

  • you can use ViewCompat.canScrollHorizontally to check if the child view can be scrolled or not.