Skip to content
This repository was archived by the owner on Jul 11, 2025. It is now read-only.

Conversation

@tunjid
Copy link

@tunjid tunjid commented Feb 16, 2020

👋 👋 👋

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.

@codingjeremy codingjeremy changed the base branch from master to main September 29, 2020 18:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant