Stylianos Gakis
08/30/2023, 11:30 AMLayout(content = { Box(Modifier.layoutId("id")) { content() }
and then in the block I do measurables.fastFirstOrNull { it.layoutId == "id }
to find it.
This works well to get the item that I want (this layout takes more than 1 slot), but it breaks another assumption, regarding the modifier that is used in the call site for content
. In particular, I got a modifier that animates the placement offset the item gets, but this is broken because in my custom layout I am now laying out the Box actually, and not the content itself.
Is there something clever I can do here to still get the layout ID to my composable, without breaking what I describe above?Stylianos Gakis
08/30/2023, 11:32 AMcontent: @Composable (Modifier) -> Unit
instead, and take the modifier there and append the layoutId to it instead, but this makes the API of my custom layout really non-standard, as I need to remember to use the modifier myself on the call-site. It becomes really awkward.
Anything else I can do here? 👀