SurfaceControlViewHost Input in Android R
In a previous post,
I reviewed the basics of how you can use
in Android R to have the UI from one app be displayed in another app.
The one part that I was missing was user input, as that did not seem to work, though it was advertised as being supported.
Primarily, that was a matter of setting the
SurfaceView to be on top from a Z axis standpoint.
After that, user input worked just fine, at least for click events —
I have not yet experimented with anything more complex. In particular, it will
be interesting to see if text input works, given the three-way interaction
between the app supplying the UI, the app displaying the
Surface, and the input
Many thanks to the Google engineer who pointed out the problem!
Interested in Jetpack Compose?
jetc.dev has a weekly newsletter of the latest articles, samples, and other details of Compose development!