I have a normal XML view with a LinearLayout inside a NestedScrollView. Inside there is a normal View and a Composable view which contains an AndroidView.
The layout:
<NestedScrollView ...>
<LinearLayout ...>
<View .../> <!-- click listener works properly -->
<androidx.compose.ui.platform.ComposeView .../> <!-- click in inner AndroidView doesn't work properly -->
</LinearLayout>
</NestedScrollView>
The ComposeView is set like this:
composeView.setContent {
AndroidView(factory = {
TextView(it).apply {
setText("View in Compose")
setOnClickListener { } // This breaks the scroll
}
})
}
When tapping the View inside a Compose the scroll doesn't work. The click listener eats all touch events.
Is there any way to make Android View click inside Compose behave correctly?