chahine / pageindicator

An Instagram like page indicator compatible with RecyclerView and ViewPager.
MIT License
279 stars 42 forks source link

Bug inside RecyclerView #17

Open AngleV opened 6 years ago

AngleV commented 6 years ago

Hello

i am using your awesome library in one of my projects and i have discover the following bug

Having a viewpager inside a recyclerview. I'm overiding the onViewRecycled and i save in a HashMap what item was visible in the viewpager at that recyclerview position.

Next time i bind this item again if there is in hashmap i set the correct item to be selected in viewpager. It works perfect.

The problem is that the indicator is in wrong position. For example in a viewpager with 3 items i swipe to the last. After the recycling the viewpager show correctly the last item but the indicator is in position 2.

winnerawan commented 5 years ago

@AngleV i got same issue, take a look on other library, maybe related to this ? Did your issue already resolved?

PageIndicatorView

Because setViewPagerId uses an instance of ViewPager, using it in recycler could lead to id conflicts, so PageIndicatorView will not know properly what is the right ViewPager to work with. Instead you should handle selected indicators on your own programatically.