grandstaish
09/23/2020, 8:59 PMColumn
children?pardom
09/23/2020, 9:01 PMDivider()
composable between each child.grandstaish
09/23/2020, 9:05 PMColumn
. Then I want my custom composable to be able to add dividers in between each child. Maybe I need a custom Layout for this thoughpardom
09/23/2020, 9:06 PMLazyColumnFor
?grandstaish
09/23/2020, 9:07 PMpardom
09/23/2020, 9:08 PMZach Klippenstein (he/him) [MOD]
09/23/2020, 9:11 PMdrawContent
modifier to draw over/under the children in those spaces. If all your items are the same size, you can use the spacedBy
arrangement with Column and just calculate where the dividers go without doing a custom layout.grandstaish
09/23/2020, 9:19 PMZach Klippenstein (he/him) [MOD]
09/23/2020, 9:47 PMgrandstaish
09/23/2020, 9:52 PMZach Klippenstein (he/him) [MOD]
09/23/2020, 9:55 PMgrandstaish
09/23/2020, 10:26 PMZach Klippenstein (he/him) [MOD]
09/23/2020, 10:44 PMLouis Pullen-Freilich [G]
09/23/2020, 10:47 PMSubcomposeLayout
is designed exactly for these sort of use cases - you can avoid the 1f lag this way by measuring the content first, and then composing the dividers afterwards.grandstaish
09/23/2020, 10:49 PMSubcomposeLayout
tomorrow. Thanks both!efemoney
09/23/2020, 11:02 PMSubcomposeLayout
?Zach Klippenstein (he/him) [MOD]
09/23/2020, 11:11 PMLazyList
and WithConstraints
use it, which are pretty different use cases so looking at their implementations is helpful.Louis Pullen-Freilich [G]
09/23/2020, 11:42 PMLazyList
and WithConstraints
can be useful.
Or for a more high level 'component' point of view, you can see the TabRow
implementation, or the upcoming Scaffold change that moves to using SubcomposeLayout
grandstaish
09/24/2020, 9:44 AMTabRow
is doing dividers too, so this makes things pretty easy for me 🙂SubcomposeLayout
(and Layout
) are so easy to use 👏. I managed to add my dividers fairly easily: https://gist.github.com/grandstaish/9eec95d879eb754cb5109caa49822dceefemoney
09/25/2020, 10:48 AMgrandstaish
09/25/2020, 11:22 AM