I just answered this question in StackOverflow… Is...
# compose
n
I just answered this question in StackOverflow… Is there a better way? How about this error indication in Android Studio? https://stackoverflow.com/questions/67423907/possible-to-use-layout-a-compose-view-in-and-activity-written-in-java
a
generally this is where one should subclass
AbstractComposeView
from kotlin and java consumers can use that view subclass
☝️ 1
this lets you deal with parameters to the backing composable function(s) by declaring properties on the view as
var foo by mutableStateOf(initial)
from kotlin and refer to
foo
from the overridden
Content
method, which then lets java callers do
view.setFoo(value)
and compose does its reactive thing automatically in response
n
Thanks @Adam Powell! I updated my answer there 😉