I added a BottomSheet with a RecyclerView in it to my app, but I can't scroll the RecyclerView, and I can't find out what is the problem.
Here is my BottomSheet:
<!-- bottom sheet -->
<FrameLayout
android:id="@+id/bottom_sheet"
style="@style/Widget.Design.BottomSheet.Modal"
android:layout_width="match_parent"
android:layout_height="0dp"
app:behavior_hideable="true"
app:behavior_peekHeight="90dp"
app:layout_behavior="@string/bottom_sheet_behavior">
<!-- horizontal thumbnail -->
<android.support.v7.widget.RecyclerView
android:id="@+id/horizontal_thumbnail"
android:layout_width="match_parent"
android:layout_height="90dp"/>
<!-- vertical thumbnail -->
<android.support.v7.widget.RecyclerView
android:id="@+id/vertical_thumbnail"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"/>
</FrameLayout>
The vertical thumbnail is visible when the sheet is expanded, the horizontal is visible when the list is collapsed.
Also you can put the RecyclerView inside NestedScrollView.
Solved it. The problem was I added two RecyclerViews to the BottomSheet, and the second one didn't scroll in this case. I don't really need the first when and when I removed it, I was able to scroll the other.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With