Created
March 9, 2021 09:10
-
-
Save iamutkarshtiwari/b0a5da2945d056c3b0a291ffa432617c to your computer and use it in GitHub Desktop.
ModalBottomSheetLayout Scrim Issue
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
@OptIn(ExperimentalMaterialApi::class) | |
@Composable | |
private fun SetupModal() { | |
val state = rememberModalBottomSheetState(ModalBottomSheetValue.Hidden) | |
val scope = rememberCoroutineScope() | |
ModalBottomSheetLayout( | |
sheetState = state, | |
sheetContent = { | |
PrimaryButton( | |
text = "Hello", | |
onClick = { | |
} | |
) | |
PrimaryButton( | |
text = "Elon's", | |
onClick = { | |
} | |
) | |
PrimaryButton( | |
text = "World", | |
onClick = { | |
} | |
) | |
} | |
) { | |
Column( | |
modifier = Modifier.fillMaxSize().padding(16.dp), | |
horizontalAlignment = Alignment.CenterHorizontally | |
) { | |
Text("Rest of the UI") | |
Spacer(Modifier.height(20.dp)) | |
Button(onClick = { scope.launch { state.show() } }) { | |
Text("Click to show sheet") | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment