https://kotlinlang.org logo
l

Lisandro Di Meo

08/30/2022, 1:25 AM
Since AndroidComposeView is implemented using a ViewGroup, is it possible to access to its children (composeviews) as they were normal android views? (I know there is a specific way to test Compose views, but I'd like to know how these compose nodes are implemented).
j

jw

08/30/2022, 1:28 AM
No, they are never materialized as
View
subtypes.
l

Lisandro Di Meo

08/30/2022, 1:39 AM
Thanks for the fast reply. Do you know if there are any resources on how these compose nodes are represented inside an AndroidComposeView
?
j

jw

08/30/2022, 1:48 AM
They are all instances of the
LayoutNode
class which is a tree of objects that can measure and render themselves. The bridge to the
View
world is only for propagating measurements and being given the
Canvas
onto which to render.
l

Lisandro Di Meo

08/30/2022, 1:54 AM
Great, I'll take a look into that. Thanks!
14 Views