I Have the following View:
_____________________________
| ___________________________ |-- ScrollView
|| _________________________ ||-- Vertical Linear Layout
||| _______ ______________ |||-- Horizontal Linear Layout
|||| ListA || RecyclerView ||||
|||| Head || <========> ||||
||||_______||______________||||
|||_________________________|||
|| _________________________ ||
||| _______ ______________ |||
|||| ListB || RecyclerView ||||
|||| Head || <========> ||||
||||_______||______________||||
|||_________________________|||
|| /\ ||
|| || LinearLayout ||
|| \/ ||
||___________________________||
|_____________________________|
The Linear layout should scroll vertically and the RecyclerView's should independently from each other scroll horizontally when touched and scrolled inside them.
This already works mostly fine.But I have two problems.
1) When I touch down on one View (RecyclerView or ScrollView) only this view will get all scroll events until I release the finger again. So when I scroll right in the RecyclerView I can't scroll up and down in the ScrollView simultaneously. This behaviour is ok'ish but would love to test how it feels if I could scroll both views simultaneously.
2) Bigger problem: As long as the ScrollView keeps scrolling after releasing the finger due to momentum, I can't start scrolling the child RecyclerViews as even a new touch event above the RecyclerView is still caught by the ScrollView.
So how can I get rid of the behaviour in 2) ?
UPDATE:
The buttons on the left should stay visible when the RecyclerView is scrolled horizontally.
I know that I could solve this with a big RecyclerView having all elements in it, But it would be quite complex. As each recyclerView content should scroll independently and the buttons on the left should stay visible unless scrolled vertically outside of view.
Is there maybe a possibility to prevent the momentum scrolling of the ScrollView or to immediately stop it on the next touch? Or can I pass the scrollevents to the childView so both views can act upon it?
Update 2: Updated the example with missing Horizontal Linear Layout