Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add collapseOnFlingDown parameter to FlexibleSheetState #69

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

terrakok
Copy link

Introduce the collapseOnFlingDown property to control whether the bottom sheet collapses on a downward fling gesture. Updated constructors, property initializations, and logic to use this parameter, ensuring greater flexibility for sheet behavior customization.

val sheetState = rememberFlexibleBottomSheetState(
  collapseOnFlingDown = false //by default = !isModal
)

Before, the behavior depended on type of the bottom sheet:

  • for isModal=true downward fling gestures didn't collapse the bottomsheet unless inner scroll is ended
  • for isModal=false the gestures always collapsed the bottomsheet to the possible smaller state

You will see the difference below:

collapseOnFlingDown = true collapseOnFlingDown = false
Screen.Recording.2025-01-12.at.23.30.02.mp4
Screen.Recording.2025-01-12.at.23.30.27.mp4

Introduce the `collapseOnFlingDown` property to control whether the bottom sheet collapses on a downward fling gesture. Updated constructors, property initializations, and logic to use this parameter, ensuring greater flexibility for sheet behavior customization.
@terrakok terrakok requested a review from skydoves as a code owner January 12, 2025 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant