Badran
08/13/2025, 11:39 AMBottom Sheet ( Android View ( Column/ Lazy Column ) ) )
The Lazy column is not scrollable at all... is this a known issue?
Code sample:
@OptIn(ExperimentalMaterial3Api::class)
@Preview
@Composable
fun TestScrollable() {
var isVisible by remember {
mutableStateOf(false)
}
val context = LocalContext.current
val bottomSheetState = rememberModalBottomSheetState()
Button(onClick = { isVisible = !isVisible }) {
Text("Click")
}
if (isVisible) {
ModalBottomSheet(
onDismissRequest = {
isVisible = false
},
sheetState = bottomSheetState,
dragHandle = { BottomSheetDefaults.DragHandle() }
) {
AndroidView(
modifier = Modifier
.fillMaxWidth()
.fillMaxSize(),
factory = {
val binding = MyBinding.inflate(
LayoutInflater.from(context),
null,
false
)
binding.composeView.setContent {
Column(
modifier = Modifier
.verticalScroll(rememberScrollState())
.padding(16.dp)
) {
repeat(400) { index ->
Text(
text = "$index"
)
}
}
}
binding.root
}
)
}
}
}
XML:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="<http://schemas.android.com/apk/res/android>"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<androidx.compose.ui.platform.ComposeView
android:id="@+id/composeView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</FrameLayout>
Lisandro Di Meo
08/13/2025, 1:16 PMBadran
08/13/2025, 1:18 PMLisandro Di Meo
08/13/2025, 1:20 PMwrap_content
Badran
08/13/2025, 1:24 PM<?xml version="1.0" encoding="utf-8"?>
<com.android.car.ui.FocusArea xmlns:android="<http://schemas.android.com/apk/res/android>"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<androidx.compose.ui.platform.ComposeView
android:id="@+id/composeView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</com.android.car.ui.FocusArea>
This doesn't work eitherBadran
08/13/2025, 1:25 PMLisandro Di Meo
08/13/2025, 1:28 PMLisandro Di Meo
08/13/2025, 1:28 PM<com.android.car.ui.FocusArea xmlns:android="<http://schemas.android.com/apk/res/android>"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.compose.ui.platform.ComposeView
android:id="@+id/composeView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</com.android.car.ui.FocusArea>
Badran
08/13/2025, 1:29 PMLisandro Di Meo
08/13/2025, 1:49 PMAndroidView
. I would avoid that, and use AndroidView only when you need to re-use XML'sLisandro Di Meo
08/13/2025, 1:55 PMBadran
08/13/2025, 2:03 PMLisandro Di Meo
08/13/2025, 2:04 PM