themishkun
10/03/2022, 2:36 PMFilip Wiesner
10/03/2022, 2:43 PMCasey Brooks
10/03/2022, 2:45 PMCasey Brooks
10/03/2022, 2:46 PMthemishkun
10/03/2022, 2:49 PMCasey Brooks
10/03/2022, 2:56 PMLayout { }
API is pretty expressive yet simple to work with, though a full FlexBox implementation would be anything by trivial. Here’s the docs on basic custom layouts if you’d like to give it a try yourself: https://developer.android.com/jetpack/compose/layouts/customFilip Wiesner
10/03/2022, 3:02 PMFlowLayout
is implemented and iterate from thatthemishkun
10/03/2022, 3:05 PMFilip Wiesner
10/03/2022, 3:14 PMSubcomposeLayout
example.Stylianos Gakis
10/03/2022, 3:49 PMthemishkun
10/03/2022, 3:52 PMStylianos Gakis
10/03/2022, 3:57 PMZach Klippenstein (he/him) [MOD]
10/04/2022, 11:00 AMSubcomposeLayout … enables you to influence one part of your layout with measure result from other part.Sorry to be pedantic here, but this is a mistake a lot of people make so I wanted to call it out. Different parts of a layout can influence other parts of the layout in a normal
Layout
, you don’t need subcomposition for that and shouldn’t use it to do so because it is relatively expensive and inefficient. SubcomposeLayout
allows the layout (measure or placement) to influence the composition of other children of that layout. That is needed in many fewer cases. Eg I believe Scaffold uses this capability to completely avoid composing whole complicated parts of itself when certain params are null.Stylianos Gakis
10/04/2022, 11:05 AMthemishkun
10/04/2022, 3:21 PMZach Klippenstein (he/him) [MOD]
10/04/2022, 3:23 PMthemishkun
10/04/2022, 3:35 PMZach Klippenstein (he/him) [MOD]
10/04/2022, 3:38 PMStylianos Gakis
10/04/2022, 3:43 PMthemishkun
10/04/2022, 3:45 PMthemishkun
10/05/2022, 1:14 PMMultiMeasureLayout
Zach Klippenstein (he/him) [MOD]
10/05/2022, 2:56 PMBrian Guertin
12/14/2022, 4:38 PMthemishkun
12/15/2022, 1:38 PMBrian Guertin
12/15/2022, 4:11 PMcommonMain
, so that's why I did not make a Composable yet.
Feel free to use my fork if you'd like to support Desktop/iOS/WASM as well. It even includes all the unit tests (passing!) from upstream Yoga (If there's interest I can put it on maven central and get CI going, etc.)