Skip to content
Advertisement

BottomSheetDialogFragment behaviour disorder when added nested fragment in Android

I’ve a BottomSheetDialogFragment inside a RecyclerView, when is clicked a button BottomSheet is showing. BottomSheetDialog expanding when scrolling down and collapsing when scroll finished on top normally.

enter image description here

But when I place the RecyclerView inside a fragment and lay the fragment to BottomSheetDialog; BottomSheet behaviours not working on the fragment, only works RecyclerView scrolling. On the other hand the behaviours work other places on BottomSheet. How to enable the behaviours as in the first?

Advertisement

Answer

You should check that your container layout has app:layout_behavior="@string/bottom_sheet_behavior"> and check that any listener/event you define extra, otherwise BottomSheetDialog normally behaive as you expect.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement