I have RecyclerView
, using orientation LinearLayoutManager
c HORIZONTAL
, nested inside a FrameLayout
with BottomSheet
Behavior
.
When you try to drag vertically through RecyclerView
, it BottomSheet
does not respond to the drag event. Presumably this is due to the fact that vertical scrolling is disabled for LayoutManager
horizontal orientation.
I tried to override LinearLayoutManager.canScrollVertically()
and return true. Such work. If you pull vertically very carefully, answer BottomSheet
. However, as soon as any horizontal movement is involved, it BottomSheet
stops responding to vertical drag events.
I am not sure if this is the right approach canScrollVertically()
- this, of course, does not seem to be right from the point of view of UX.
I also noticed that if I use ViewPager
, and not RecyclerView
with a horizontally oriented LayoutManager
, it BottomSheet
responds to events of a vertical swipe as desired.
Is there any other method LayoutManager
, RecyclerView
, BottomSheet Behavior
or something else that can help to spread the events on the vertical scroll BottomSheet Behavior
?
Here is an example of a problem here:
https://github.com/timusus/bottomsheet-test
(The problem can be reproduced using commit # f59a7031)
Just expand the first bottom sheet.
source
share