Home » Android » android – In a RecyclerView, pass the opposite dragging motion event to view below it-Exceptionshub

android – In a RecyclerView, pass the opposite dragging motion event to view below it-Exceptionshub

Posted by: admin February 26, 2020 Leave a comment

Questions:

Current Layout (pseudo)

<Layout ..... >

<BottomSheet ..../>

<RecyclerView
  orientation="horizontal"/>

</Layout>

Video of layout interaction

The Issue
The bottom sheet peaks out over the horizontal recycler view, where a user can drag up on it and have the sheet be displayed. When the sheet is hidden, the recycler view above it consumes all touches including vertical dragging. So the user is forced to accurately find the 5dp peaking section to drag up.

Question
How can I override the recycler view to pass vertical drags to the view below it (bottom sheet)

Initial Attempts
Even if I return false for onItemTouch or onTouchIntercepted the vertical touch isn’t passed to the view below it, so I believe I’m missing a core concept behind touch events.

How to&Answers: