Last month I saw a question here regarding WebView...
# compose
n
Last month I saw a question here regarding WebView and handling touch events on
AndroidView
. Does this issue still happening? I have a layout with a
TextView
and a
CalendarView
and I’m just trying to show/hide the
CalendarView
when I click on the
TextView
. But the screen is frozen… 😕
Copy code
@Composable
fun MyCalendar() {
    var currentDate by state { Date() }

    AndroidView(resId = R.layout.my_layout) { view ->
        val textView = view.findViewById<TextView>(R.id.txtDate)
        val calendarView = view.findViewById<CalendarView>(R.id.calendarView)

        calendarView?.visibility = View.GONE
        textView?.text = currentDate.toString()
        textView?.setOnClickListener {
            calendarView?.let {
                it.visibility = if (it.visibility == View.VISIBLE)
                    View.GONE
                else View.VISIBLE
            }
        }
    }
}
That’s curious… if the
CalendarView
starts visible, it works fine 😕 I just remove this line and it worked…
Copy code
calendarView?.visibility = View.GONE
j
fwiw I'm using
AndroidView
to contain a google map view.....touch is working in general but pinch/zoom isn't
p
AndroidView
does not fully support some user events yet
👍 1