Invalid indicator position using ViewPager2
Magno-Ramos opened this issue · 4 comments
Magno-Ramos commented
I'm using ViewPager2
.
When I setCurrentItem
to ViewPager2
with smoothScroll=false
, the indicator remains at the start position and not at the correct ViewPager2
position
MaximilianFrick commented
Have the same problem :/
with smoothScroll=true
it is working
AGENTxXx commented
You need add delay before set current page. My decision
Handler(Looper.getMainLooper()).postDelayed({ binding.dotsIndicator.refreshDots() }, 50)
It's becase dots have not received coordinates yet and pos = 0,0 for any page. We need to wait, while they are drawn on the canvas
tommybuonomo commented
Fixed in 4.3
tommybuonomo commented
Hello, thanks for your contribution !
This issue is now fixed in the new version 4.3
Thanks 🔥