Created
December 6, 2022 14:26
-
-
Save MrNtlu/3cb81fc76aeec04e344bf96d695decbb to your computer and use it in GitHub Desktop.
Bottom Sheet Activity Part 2
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
ModalBottomSheetLayout( | |
sheetState = modalSheetState, | |
sheetShape = RoundedCornerShape(topStart = 12.dp, topEnd = 12.dp), | |
sheetContent = { | |
Column( | |
//... | |
) { | |
//... | |
Button( | |
onClick = { | |
coroutineScope.launch { modalSheetState.hide() } | |
} | |
) { | |
Text(text = "Hide Sheet") | |
} | |
} | |
} | |
) { | |
Scaffold { | |
Box( | |
//... | |
) { | |
Button( | |
onClick = { | |
coroutineScope.launch { | |
if (modalSheetState.isVisible) | |
modalSheetState.hide() | |
else | |
modalSheetState.animateTo(ModalBottomSheetValue.Expanded) | |
} | |
}, | |
) { | |
Text(text = "Open Sheet") | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment