Created
December 6, 2022 14:51
-
-
Save MrNtlu/116021f14b0449a6cfba6cf841eef3ce to your computer and use it in GitHub Desktop.
Bottom Sheet Activity Part 4 Extra
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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