InfiniteViewPager icon indicating copy to clipboard operation
InfiniteViewPager copied to clipboard

setCurrentItem() freezes

Open DigitalDavo opened this issue 11 years ago • 3 comments
trafficstars

Seems some calls to setCurrentItem() to jump directly between the fragments freezes.

According to http://stackoverflow.com/questions/22937651/infiniteviewpager-freezes-on-setcurrentitem-method it is because of an infinite loop - but alas their solution of using 3000 does not fix the issue for me.

DigitalDavo avatar Aug 22 '14 06:08 DigitalDavo

me,too. I find README last line.

It is only possible to achieve wrapping when you have at least 4 pages. This is because of the way the ViewPager creates, destroys, and displays the pages. No fix for the general case has been found.

at least 4 pages.

Porval avatar Sep 02 '14 07:09 Porval

I had the same problem with more pages. Solved it by looking at forks.

Found akhoi90 two commits with getRealCurrentItem() and setRealCurrentItem(): https://github.com/khoi-nguyen-2359/InfiniteViewPager/commit/a4bf46a8f4340bef3e4f44e558ff8f2c169884ad https://github.com/khoi-nguyen-2359/InfiniteViewPager/commit/3ca4abc65405d6c4ee95dbab447d401ef4eaacd4

If I use those it works just fine.

PiNotEqual3 avatar May 08 '15 14:05 PiNotEqual3

I used the getRealCurrentItem() too. I got this problem with only 3 pages.

And i found another approach: http://stackoverflow.com/questions/22937651/infiniteviewpager-freezes-on-setcurrentitem-method

zayo avatar Sep 10 '15 09:09 zayo