dimsuz
08/06/2022, 11:16 AMState
value to affect placement of layout children, will it impact performance in some way? Is there some in-depth look of what is cached and when during layout in compose?
E.g.
fun MyLayout(x: Int) {
Layout(content = {...}) { m, c ->
...
layout(w,h) { child.placeRelative(x, 0) }
}
}
fun Screen() {
// or x is from pointerInput + stored in State
val x by animateValue(300)
MyLayout(x)
}
Stylianos Gakis
08/06/2022, 11:35 AMlayout {}
lambda by passing in a lambda fetching that value instead of the value itself. That could mean that you can only do a re-layout and not an entire recomposition.
I haven't tried doing that myself, not sure if it'd work, I'm only basing it off of my understanding of the docs so please if you do try it tell me how it goes.Zach Klippenstein (he/him) [MOD]
08/06/2022, 3:11 PMdimsuz
08/07/2022, 12:23 AM