I used a simple ListAdapter with a RecyclerView.Viewholder for my ViewPager2 and noticed quite a few weird things happened. If i used a conditional in the setup of my itemview (bind method that's called in onBindViewHolder) like so
if (item.id == 1) itemView.removeButton.hide()
the remove button actually appeared for each fifth (???) element, despite the condition only triggering once. After inverting it. and quickly removing items from the ViewPager2 (via submitting a new list into the listadapter) when arriving onto the last item left, the remove button shows up (while it shouldn't).
I can only assume this has something to do with view recycling for faster rendering, but I can't seem to figure out what the actual issue can be.
I used a simple ListAdapter with a RecyclerView.Viewholder for my ViewPager2 and noticed quite a few weird things happened. If i used a conditional in the setup of my itemview (bind method that's called in onBindViewHolder) like so
if (item.id == 1) itemView.removeButton.hide()
the remove button actually appeared for each fifth (???) element, despite the condition only triggering once. After inverting it. and quickly removing items from the ViewPager2 (via submitting a new list into the listadapter) when arriving onto the last item left, the remove button shows up (while it shouldn't).
I can only assume this has something to do with view recycling for faster rendering, but I can't seem to figure out what the actual issue can be.