Dotsindicator not refreshed when viewpager2 change size
bruzzers opened this issue · comments
Hi,
we have a problem with the library when we have a view pager 2 that changes his size.
At start we have 3 items and everything is good.
After that i delete the central item and i slide programmatically my view pager to the first item, but the indicator doesn't refresh. It shows two dots correctly, but when i am in the first item of the pager it doesn't show any dot selected and when i move to the Second and last item the indicator shows the first dot as selected.
The only way to return to normal situation is go back to another activity and open again the one that contains the DotsIndicator.
We have also tried with tab layout and we see that it works, so we think is a Library problem. Can you send us some instruction or make a new release for avoid this?
Thank you so much.
Matteo
Thank you, i have tried this version but i have another bug that is solved with latest release
Any solution??
With the latest version, I still have the same issue reflected in my end. Any recommended help is always welcomed.
This issue occurs in case of using only method onChanged from AdapterDataObserver.
You also need to trigger on onItemRangeChanged, onItemRangeInserted, onItemRangeMoved methods.
I'm using workaround in my code. But it can be easily fixed on library code.
my solution just temporary. Kotlin + coroutine + ListAdapter
viewModel.myList.observe(viewLifecycleOwner, {
myListAdapter.submitList(it)
lifecycleScope.launch {
delay(300)
myListAdapter.notifyDataSetChanged()
}
})
Duplicate of #139
Hello, thanks for your contribution !
This issue is now fixed in the new version 4.3
Thanks 🔥