This PR modifies the NestedScrollableHost to be a View.OnTouchListener rather than a ViewGroup that houses the nested scrolling child.
I don't think this is a better implementation per se, just more of a different one. I'm mostly curious about the design decisions that led to opting for nesting the scrollable child rather than using the View.OnTouchListener.
Off the top of my head, I can see the View.onTouchListener is a bit intrusive and limits custom touch interception on the nested scrollable View, however this is mitigated if this View were a RecyclerView as it could use the RecyclerView.OnItemTouchListener instead, which would be perfect for this example.
FWIW, this solution worked with nested ViewPagers, i.e I had ViewPager2 -> ViewPager2 -> HorizontalScrollView where the middle ViewPager2 had isUserInputEnabled = false and it worked a charm.
👋 👋 👋
This PR modifies the NestedScrollableHost to be a
View.OnTouchListener
rather than aViewGroup
that houses the nested scrolling child.I don't think this is a better implementation per se, just more of a different one. I'm mostly curious about the design decisions that led to opting for nesting the scrollable child rather than using the
View.OnTouchListener
.Off the top of my head, I can see the
View.onTouchListener
is a bit intrusive and limits custom touch interception on the nested scrollableView
, however this is mitigated if thisView
were aRecyclerView
as it could use theRecyclerView.OnItemTouchListener
instead, which would be perfect for this example.FWIW, this solution worked with nested ViewPagers, i.e I had
ViewPager2
->ViewPager2
->HorizontalScrollView
where the middleViewPager2
hadisUserInputEnabled = false
and it worked a charm.