Skip to content

Instantly share code, notes, and snippets.

@ExperimentalMaterialApi
@Composable
fun DetailArea(
...
modalBottomSheetState: ModalBottomSheetState
) {
...
val coroutineScope = rememberCoroutineScope()
@ExperimentalMaterialApi
@Composable
fun ShowDetailScreen(...) {
...
ModalBottomSheetLayout(
...
sheetContent = {
Surface(
@ExperimentalMaterialApi
@Composable
fun ShowDetailScreen(...) {
...
val modalBottomSheetState = rememberModalBottomSheetState(ModalBottomSheetValue.Hidden)
...
ModalBottomSheetLayout(
@ExperimentalMaterialApi
@Composable
fun ShowDetailScreen(
viewModel: ShowDetailViewModel = hiltViewModel(),
...
) {
...
ModalBottomSheetLayout( // <---- This was Surface
sheetState = modalBottomSheetState,
@Composable
fun ShowDetailScreen(
viewModel: ShowDetailViewModel = hiltViewModel(),
...
) {
...
val showCast = viewModel.showCast.observeAsState()
Surface(
modifier = Modifier
@Composable
fun DetailArea(
...
showCast: List<ShowCast>?,
onCastItemClick: (item: ShowCast) -> Unit
) {
val scrollState = rememberScrollState()
Column(
modifier = Modifier
override fun onCreateView(...): View {
...
binding.composeContainer.apply {
// Dispose of the Composition when the view's
// LifecycleOwner is destroyed
// https://developer.android.com/jetpack/compose/interop/interop-apis
setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed)
setContent {
MdcTheme {
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.compose.ui.platform.ComposeView
android:id="@+id/compose_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:transitionGroup="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"