problem is that i have a list item that changes it’s size depending on an interaction
this change is not picked up, bc. the items list itself is not altered. don’t want to expose the in-memory state if the item to the list so i could listen to it on list-level.
is there any other way apart from providing a scrollToBottom callback down to the item - that it can call when it’s size changes?
c
Casey Brooks
12/09/2022, 3:32 PM
LazyColumn() { }
has a
reverseLayout
parameter for exactly this purpose
m
mattinger
12/10/2022, 5:48 PM
If i'm understanding your question correctly, your list of items doesn't change, just some piece of data within the item. Compose, of course will never pick up on that, because you're not re-assigning the value of some mutable state object. I would recommend having immutable data in your list, and updating the list as as a whole when the state changes.
c
Christoph Wiesner
12/13/2022, 7:36 AM
i can’t use reverseLayout as I also need to query the visible list items for displaying sticky headers (can’t use the platform provided ones)
yes, i fear i need to re-architect a bit here. thanks for the responses