I have a SwipeRefreshLayout around a ViewPager. The fragments loaded by the ViewPager contain ScrollViews. When I scroll d
I solved the problem. I created SwipeRefreshLayout like this:
public class MenuSwipeRefreshLayout: SwipeRefreshLayout {
public var target: View? = null
constructor(ctx: Context): super(ctx)
constructor(ctx: Context, attr: AttributeSet): super(ctx, attr)
override fun canChildScrollUp(): Boolean {
return target?.canScrollVertically(-1) ?: super.canChildScrollUp()
}
}
and I set the target to the visible ScrollView every time the ViewPager changes views.
BTW that's Kotlin, not Java.