Colton Idle
10/07/2020, 8:27 PMZach Klippenstein (he/him) [MOD]
10/07/2020, 8:49 PMColumn
is extremely cheap, even compared to LazyColumnFor
, because it works in the same composition and is just a really straighforward layout, unconcerned with scrolling, gestures, animations, etc. Because it’s so lightweight, you can use it to construct more complicated layouts by nesting columns of small numbers of items, combining with other simple layouts, etc.
The LazyList
components have a lot of internal code to track scroll position, manage fling animations, and they use subcomposition which involves creating a whole other slot table. Another example is a CL that just landed, I believe, that automatically creates a separate layer for each child of a LazyList, which I think is an optimization that makes sense for scrolling things but if you’re just using a column to stack two text labels on top of each other would be very much overkill. I’m sure google has benchmarks for all of these somewhere, so i’d be curious to see if this is true, and if so, what the performance difference actually is for small numbers of children.
That said, I could see more of an argument for dropping ScrollableColumn
in favor of the lazy ones, since it seems much more similar to them in spirit.romainguy
10/07/2020, 9:02 PMLinearLayout
vs a RecyclerView
ansman
10/07/2020, 9:27 PMColton Idle
10/07/2020, 9:32 PMromainguy
10/07/2020, 9:33 PMromainguy
10/07/2020, 9:36 PMConstraintLayout
vs other layoutsromainguy
10/07/2020, 9:36 PMConstraintLayout
romainguy
10/07/2020, 9:36 PMColton Idle
10/07/2020, 9:38 PMJoost Klitsie
10/08/2020, 6:38 AM