When I try to scroll list, sometimes this works incorrect - BottomSheet intercepts the scroll event and hides.
How to reproduce this:
Assuming page is a NestedScrollView, I was able to solve the problem by toggling its isNestedScrollingEnabled property depending on whether or not it's the incoming or outgoing page.
val viewPager = findViewById(R.id.viewPager)
viewPager.setPageTransformer(false) { page, position ->
if (position == 0.0f) {
page.isNestedScrollingEnabled = true
} else if (position % 1 == 0.0f) {
page.isNestedScrollingEnabled = false
}
}