I want my webview to not respond to any touches; I just want it to display content(hence the touchListener returning true). The parent Surface composable should handle the touches. But it doesn't work.
@OptIn(ExperimentalMaterialApi::class)
@Preview
@Composable
fun MyComposable() {
Surface(
modifier = Modifier.size(250.dp).padding(10.dp),
onClick = { Log.e("TEST", "Clicked") },
elevation = 5.dp
) {
AndroidView(
factory = { context ->
WebView(context).apply {
this.setOnTouchListener { _, _ -> true }
}
},
update = {
it.loadUrl("https://stackoverflow.com/")
}
)
}
}