// 컨텐트 뷰 설정을 ComposeView 로
setContentView(
ComposeView(this).apply {
// drawerState 기억.
val drawerState = rememberDrawerState(initialValue = Closed)
val drawerOpen by
viewModel.drawerShouldBeOpened.collectAsStateWithLifecycle()
if (drawerOpen) {
// Open drawer and reset state in VM.
LaunchedEffect(Unit) {
// wrap in try-finally to handle interruption whiles opening drawer
try {
drawerState.open()
} finally {
viewModel.resetOpenDrawerAction()
}
}
}
}
)