n

    nglauber

    2 years ago
    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… 😕
    @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…
    calendarView?.visibility = View.GONE
    John O'Reilly

    John O'Reilly

    2 years ago
    fwiw I'm using
    AndroidView
    to contain a google map view.....touch is working in general but pinch/zoom isn't
    ppvi

    ppvi

    2 years ago
    AndroidView
    does not fully support some user events yet