Is there any friendly way to create a custom view ...
# compose
c
Is there any friendly way to create a custom view (or a viewholder for an item) with compose in a project using the old fashioned xml style?
r
Do you want to use XML to create
android.view.View
subclasses or to use composable functions?
If the former use
AndroidView()
If the latter, we don't offer anything and don't plan on doing so
c
I would like to create a component with compose and use it in my current project so I could start using it a bit without rewriting any existing views
but I guess that´s the second case you mention, so I will forget about it, thanks đŸ™‚
r
You can embed Compose in existing view hierarchies
But you can't invoke composables from XML. So you need to define a Compose host in your XML and you can then jump into Compose from there (but in your code)
c
Thanks