HomeAndroidCompose phases. Episode 2 of MAD Abilities —  Compose… | by Jolanda Verhoef...

Compose phases. Episode 2 of MAD Abilities —  Compose… | by Jolanda Verhoef | Android Builders | Feb, 2023


Three phases
Two boxes. The left box shows code of a composable function, highlighted line by line. An arrow moves to a next box, where a tree structure is built node by node. This box is annotated with the term “UI tree”. An arrow points to one of the nodes saying “Layout Node”.
The Composition section executes composable features and creates a tree that represents your UI.
Two boxes. The left box shows the tree structure from the previous image. An arrow points to the right box. The right box shows a phone screen, with an animation of dotted orange rectangles being added to that screen. Those boxes represent the various elements of the UI.
The Structure section measures and locations every structure node within the UI tree.
Two boxes. Left box shows the screen with orange dotted lines from the last image. The right box shows those dotted lines being animated into a screen of a sample application, where each dotted box maps to an element on the screen.
The drawing section attracts the pixels on the display.

Composition section

Screenshot of app article screen, highlighting a round image showing Florina’s avatar, with her name next to it and another line of text that says “July 09, 1 minute read”

Structure section

Drawing section

Two boxes. Left one shows composables with modifiers added to them. Right side shows the tree structure from before, but now with boxes wrapping the nodes, representing how the modifiers are wrapper nodes.
The tree structure from before, but now each node is just a simple layout, with a lot of modifier wrapping nodes around it.
It’s modifiers all the way in which down!
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments