KamilH
02/22/2023, 6:35 AMLazy*
item scope? For example, I would like to apply some background color to an item in my LazyColumn.
While a user is scrolling, I want the content to be changed but keep the same background color. If I understand it correctly, items are being recycled in the Lazy*
components, so I guess it should be possible to remember
something in a “container” (it would be equivalent to keeping something in ViewHolder
in RecyclerView
world and binding different data).
I could achieve that by hoisting a list of background colors and querying them using a modulo like that: index.rem(visibleItemCount)
however, it doesn’t feel right, and also visibleItemCount
can vary.myanmarking
02/22/2023, 9:01 AMKamilH
02/22/2023, 10:50 AM