1

I am a strange situation. I have made a standard bottom sheet in my app. Everything works fine until I start dragging to close the bottom sheet in a speedy way. The bottom sheet seems go out off screen (you can check the attached gif below). I have checked its slide-offset and the slide-offset reached negative float in this case. Any ideas to keep the bottom sheet not go out of screen?

enter image description here

Update: This is my layout structure and bottom sheet config for double checking if necessary.

<androidx.constraintlayout.widget.ConstraintLayout>

    <androidx.coordinatorlayout.widget.CoordinatorLayout>

        <androidx.fragment.app.FragmentContainerView />

        <androidx.constraintlayout.widget.ConstraintLayout android:id="@+id/standard_bottom_sheet" app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">
            // Bottom sheet content
        </androidx.constraintlayout.widget.ConstraintLayout>
    </androidx.coordinatorlayout.widget.CoordinatorLayout>

    <com.google.android.material.bottomnavigation.BottomNavigationView
</androidx.constraintlayout.widget.ConstraintLayout>

Material lib version 1.9.0

App theme is extended from Theme.Material3.Dark.NoActionBar

Init bottom sheet like this: BottomSheetBehavior.from(binding.standardBottomSheet)

  • 1
    I would double check if all of this configured properly. If it is I would open issue in ```BottomSheet``` repository and either submit PR which fix issue or take a code to customize it to use it locally with the patch. – Gleichmut Aug 14 '23 at 10:33
  • @Gleichmut Yeah. If you don't mind, please let me know if your find a solution for this case. Thanks – Thái Quốc Toàn Aug 15 '23 at 02:27

0 Answers0