Created
March 9, 2021 09:21
-
-
Save iamutkarshtiwari/3437c2855e5ee1ca64d6ceb7e95e7023 to your computer and use it in GitHub Desktop.
Scrim issue in ModalBottomSheetLayout with column container with full width wrapping contents within sheet
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 = { | |
Column( | |
modifier = Modifier | |
.fillMaxWidth() | |
.wrapContentHeight() | |
) { | |
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