Colton Idle
08/26/2021, 1:54 PMColton Idle
08/26/2021, 1:54 PMColton Idle
08/26/2021, 1:55 PM@Composable
@OptIn(ExperimentalMaterialApi::class)
fun BottomSheetScaffoldSample() {
val scope = rememberCoroutineScope()
val scaffoldState = rememberBottomSheetScaffoldState()
BottomSheetScaffold(
modifier = Modifier.fillMaxSize(),
sheetContent = {
Surface(
color = Color.Blue,
shape = RoundedCornerShape(topStart = 48.dp, topEnd = 48.dp),
modifier = Modifier
.fillMaxWidth()
.height(400.dp)
) {
Text("Swipe up to expand sheet")
}
},
scaffoldState = scaffoldState,
sheetPeekHeight = 128.dp, //Any way to set this to be percentage based?
) { innerPadding ->
Column {
Box(
modifier = Modifier
.background(Color(0xffFFF2CC))
.weight(.7f)
.fillMaxWidth()
)
Box(
modifier = Modifier
.background(Color.Magenta)
.weight(.3f)
.fillMaxWidth()
)
}
}
}
Alexandru Hadăr
08/26/2021, 2:02 PMColton Idle
08/26/2021, 2:06 PMVadzim Filipovich
08/26/2021, 2:16 PMColton Idle
08/26/2021, 2:17 PMVadzim Filipovich
08/26/2021, 2:18 PMVadzim Filipovich
08/26/2021, 2:19 PMColton Idle
08/26/2021, 2:21 PMsheetPeekHeight = 128.dp, //Any way to set this to be percentage?
Vadzim Filipovich
08/26/2021, 2:57 PMHalil Ozercan
08/26/2021, 3:31 PMColton Idle
08/26/2021, 3:32 PM