Hello everyone. Is there a documentation anywhere ...
# compose
m
Hello everyone. Is there a documentation anywhere about how exactly reusing in lazy layouts works behind the scenes? What is reused? Composition still needs to be re-done for every item, right?
This video seems to contain only info I found:

https://youtu.be/1ANt65eoNhQ?t=1223

n
Not sure about documentation, but what lazy layouts do is allocate a certain number of compose nodes, just like RecyclerView allocates Views. The actual number is an implementation detail but roughly, enough to fill the available space + a few more for prefetching. Only these nodes are composed, not all items in the dataset. Then as you scroll and/or the dataset changes, they are reused and bound to new data.