Closed akurbanoff closed 2 weeks ago
What do you mean by disabling hiding the bottom sheet when you dismiss? Isn't it meant to be the same as not dismissing?
What do you mean by disabling hiding the bottom sheet when you dismiss? Isn't it meant to be the same as not dismissing?
I mean that I want to block hiding bottom sheet by user. As I understand bottom sheet animates to Hidden when user dismiss this sheet, but I want to disable this feature for users. I trued to manage this state in another function using show(), slightlyExpand() and so on to expand sheet when user dismiss sheet, but it doesn't work if user tries to hide sheet by slow sliding down, but if it fast everything works. I want to allow every state except Hidden
@Uspesh Sounds interesting. Let me consider implementing the skipHidden
property.
I tried to find option to disable hide Bottom Sheet when I dismiss, but I didn't find the solution, can you explain?
I created a tricky solution for this. Here is the code:
var flexibleSheetValue by remember { mutableStateOf(FlexibleSheetValue.SlightlyExpanded) }
val flexibleBottomSheetState = rememberFlexibleBottomSheetState(
. . .
confirmValueChange = {
flexibleSheetValue = it
true
}
)
LaunchedEffect(key1 = flexibleSheetValue) {
when (flexibleSheetValue) {
FlexibleSheetValue.SlightlyExpanded -> flexibleBottomSheetState.slightlyExpand()
FlexibleSheetValue.IntermediatelyExpanded -> flexibleBottomSheetState.intermediatelyExpand()
FlexibleSheetValue.FullyExpanded -> flexibleBottomSheetState.fullyExpand()
else -> flexibleBottomSheetState.slightlyExpand()
}
}
or, you could do like this:
sheetState = rememberFlexibleBottomSheetState( ... confirmValueChange = { it != FlexibleSheetValue.Hidden } )
or, you could do like this:
sheetState = rememberFlexibleBottomSheetState( ... confirmValueChange = { it != FlexibleSheetValue.Hidden } )
this still hides the bottom sheet on a system back back event @skydoves can u help here?
Any updates about this feature @skydoves ?
@skydoves any plans to address this?
Hi everyone, apologies for the delayed response. Since version 0.1.3, you can prevent the bottom sheet from hiding and keep it displayed across user actions by setting the skipHiddenState
property to true
.
val sheetState = rememberFlexibleBottomSheetState(
skipHiddenState = true,
..
)
I appreciate your patience!
I tried to find option to disable hide Bottom Sheet when I dismiss, but I didn't find the solution, can you explain?