memorion
fun showSheet(context: Activity) { context.addContentView(ComposeView(context).apply { setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnDetachedFromWindow) setContent { var showSheet by remember { mutableStateOf(true) } if (showSheet) { ModalBottomSheet(onDismissRequest = { showSheet = false visibility = View.GONE context.findViewById<ViewGroup>(android.R.id.content) ?.removeView(this) }) { Text(text = "Hello", modifier = Modifier.padding(16.dp)) } } } }, ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT)) }
agrosner
A modern programming language that makes developers happier.