4

I was using android.support.design.widget.BottomSheetBehavior before, now it's not available in AndroidX, some suggest using com.google.android.material.bottomsheet.BottomSheetBehavior (see this link BottomSheetBehavior not in androidX libraries), but it has some bugs and conflicts with NestedScrollView, sometimes it doesn't pass drag to NestedScrollView. Is there any AndroidX replacement, instead of google material's?

I checked following link from Google, but didn't find replacement for android.support.design.widget.BottomSheetBehavior : https://developer.android.com/jetpack/androidx/migrate

Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
AVEbrahimi
  • 17,993
  • 23
  • 107
  • 210

2 Answers2

3

You can use

app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior"

instead of

app:layout_behavior="android.support.design.widget.BottomSheetBehavior"
Ali
  • 2,702
  • 3
  • 32
  • 54
Arul Pandian
  • 1,685
  • 15
  • 20
2

The new component is inside the Material Components library.

Use this class:

com.google.android.material.bottomsheet.BottomSheetBehavior

Also:

Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841