I've a Compose LazyColumn which contains AndroidViews each of which contains clickable and non-clickable views. When scrolling non-clickable area (the TextView view), the LazyColumn can be scrolled. However, when trying to scroll by starting to press down from the clickable area (the Button view), the LazyColumn cannot be scrolled, as if the Button consumes the event without telling the LazyColumn. Is there a workaround for this?
This happens only when using Android View within Compose. However, when the items are Composable instead of View, it works as expected. So does when a clickable Composable is used within a RecyclerView, the clickable Composable doesn't prevent the RecyclerView to scroll.
This is the simple version of what I talk about:
LazyColumn {
items(100) { idx ->
AndroidView(
factory = { ctx ->
LinearLayout(ctx).apply {
orientation = LinearLayout.VERTICAL
addView(TextView(ctx).apply {
text = "Non-clickable view $idx"
})
addView(android.widget.Button(ctx).apply {
text = "Clickable view $idx"
setOnClickListener {}
})
}
}
)
}
}
Compose version: 1.0.5
Kotlin version: 1.5.31