I have a parent ViewPager
, each page of which contains a child ViewPager
.
Child ViewPager
may contain a ListView
or a vertical ScrollView
.
I want to pass horizontal scroll from child ViewPager
to parent ViewPager
, but want to keep child ViewPager
scrollable vertical.
Overriding dispatchTouchEvent(MotionEvent event)
in child ViewPager and returning false
helps to pass motion events to parent ViewPager, but how to keep ListView
and ScrollView
in child ViewPager
scrollable?
The solution was easier than I expected.
Just override canScrollHorizontally
in child ViewPager and return false.