Patricia Tarazaga
11/28/2022, 8:15 AMAmeen Essa
11/28/2022, 3:39 PMPatricia Tarazaga
11/28/2022, 4:48 PM_state.value = _state.value.copy(events = events)
data class UiState(
val recyclerViewItems: List<MarvelItem>? = null
val events: List<EventItem>? = null
)
every time I update my _state.value with copy function my r_ecyclerViewItems_ reload and my recyclerView reload losing the scrollKevin S
11/28/2022, 6:24 PMnotifyDataSetChanged
, so that it would update. I think the root issue being that if you update the source information, it will clear the current rows, which put the index of the view to 0, then create all new ones with the new data.
I could be wrong with compose, it may be different, but hopefully this at least helps a little.jermainedilao
11/29/2022, 1:18 AMevents
list?Patricia Tarazaga
11/29/2022, 7:14 AMviewLifecycleOwner.launchAndCollect(viewModel.state) {
binding.recyclerViewItems = it.recyclerViewItems
binding.events = it.events
}
of course when I change events it would change recyclerViewItems, reloading everything. How can I update just events when I need (multiple times) and not recyclerViewItems (just in some occasions) or updating everything but maintaining scroll?Ameen Essa
11/29/2022, 7:28 AMPatricia Tarazaga
11/29/2022, 8:17 AMAmeen Essa
11/29/2022, 8:18 AMjermainedilao
12/06/2022, 3:11 AM