Atul Gupta
03/19/2025, 1:40 PManchoredDraggable
but sometimes while trying to change the state of sheet while flinging, sheet drops the gesture and goes back to initial state. This only happen when I try to add the anchoredDraggable
to ComposeView
which is present in xml layout
I have attached the video of UI where in the first iteration I show complete UI in compose where this issue is not happening and in the second I show the UI using ComposeView
in added xml view where this issue is happening.
is there any workaround or parameter that I am missing? BottomSheet.zip
contains the code of the projectAtul Gupta
03/20/2025, 1:02 PMColton Idle
03/24/2025, 4:26 PMAtul Gupta
03/24/2025, 4:33 PMColton Idle
03/24/2025, 5:08 PMAlex Styl
03/25/2025, 2:17 AMAtul Gupta
03/25/2025, 6:01 PMColton Idle
03/26/2025, 12:33 PMAtul Gupta
03/26/2025, 2:00 PMAlex Styl
03/26/2025, 2:04 PMval Peek = SheetDetent(identifier = "peek") { containerHeight, sheetHeight ->
containerHeight * 0.6f
}
val sheetState = rememberBottomSheetState(
initialDetent = Peek,
detents = listOf(Hidden, Peek, FullyExpanded)
)
BottomSheet(
state = sheetState,
modifier = Modifier.fillMaxWidth(),
) {
Box(
modifier = Modifier
.fillMaxWidth()
.background(Color.White)
.height(1200.dp),
contentAlignment = Alignment.TopCenter
) {
DragIndication(
modifier = Modifier
.padding(top = 22.dp)
.background(Color.Black.copy(0.4f), RoundedCornerShape(100))
.width(32.dp)
.height(4.dp)
)
}
}
Full code examples and docs at https://composeunstyled.com/bottom-sheet/#customizing-sheet-heightsAlex Styl
03/26/2025, 2:08 PMval Detent = SheetDetent(identifier = "peek") { containerHeight, sheetHeight ->
sheetHeight
}
Atul Gupta
03/26/2025, 2:09 PMAlex Styl
03/26/2025, 2:09 PM