Marko Novaković
02/18/2024, 6:57 PMLazyColumn
that I pass list of items into. I want to update items, new list with appended items, every second of so. when new items are received LazyColumn
flickers and resets scroll to top.
this happens even when I’m using ImmutableList
and having item key
defined.
how can I append items without flicker and moving to top?Anum Amin
02/18/2024, 7:08 PMMarko Novaković
02/18/2024, 7:16 PMSean Proctor
02/18/2024, 7:41 PMSean Proctor
02/18/2024, 7:41 PMSean Proctor
02/18/2024, 7:42 PMKaanixir
02/19/2024, 6:20 AMhashCode()
and equals()
of the items that are getting diff'ed, which is what's causing the flicker I think, it's not just the keys.
If these items are complex objects, properly implemented hashCode() and equals() methods help Compose efficiently identify changes
you need to help it identify content or instantiation differences (one is a structural / partial difference, the other is difference in entire object itself )
this used to be a part of the DiffUtil
process tooKaanixir
02/19/2024, 7:05 AMMarko Novaković
02/19/2024, 2:11 PMLazyColumn
you can imagine 😄Marko Novaković
02/19/2024, 2:11 PMSean Proctor
02/19/2024, 3:06 PMMarko Novaković
02/19/2024, 3:15 PM