Skip to content

Instantly share code, notes, and snippets.

@MrNtlu
Created December 6, 2022 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MrNtlu/116021f14b0449a6cfba6cf841eef3ce to your computer and use it in GitHub Desktop.
Save MrNtlu/116021f14b0449a6cfba6cf841eef3ce to your computer and use it in GitHub Desktop.
Bottom Sheet Activity Part 4 Extra
@Composable
fun BottomSheetLayout() {
//...
var isSheetFullScreen by remember { mutableStateOf(false) }
val roundedCornerRadius = if (isSheetFullScreen) 0.dp else 12.dp
val modifier = if (isSheetFullScreen)
Modifier
.fillMaxSize()
else
Modifier.fillMaxWidth()
ModalBottomSheetLayout(
sheetShape = RoundedCornerShape(topStart = roundedCornerRadius, topEnd = roundedCornerRadius),
sheetContent = {
Column(
modifier = modifier,
//...
) {
Button(
onClick = {
isSheetFullScreen = !isSheetFullScreen
}
) {
Text(text = "Toggle Sheet Fullscreen")
}
}
}
) {
//...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment