siralam / LoopingViewPager

A ViewPager and PagerAdapter combination that support auto scroll, infinite loop and page indicators.
532 stars 64 forks source link

isinfinite=false not working #8

Closed matinashtiani closed 6 years ago

matinashtiani commented 6 years ago

I am using your sample code and I set the isinfinite =false in xml. Also I set it false in adapter constructor. but the view pager is in loop yet and unfortunately nothing happend!! please help me with this problem. thank you so mush :)

siralam commented 6 years ago

but the view pager is in loop yet and unfortunately nothing happend!!

Would you mind clarify this sentence? I am not sure I get what you mean.

If you set isInfinite to false, autoScroll is still enabled and it will jumps to the first page after it reaches the end, just the animation (flip page) direction should be different. isInfinite only means that you can flip using the same direction, from the last page to the first page, as if the loop is circular.

If this does not answer your question and what you mean is isInfinite="false" is not working, please post your code, thanks!

matinashtiani commented 6 years ago

oh, I used isinfinite=false to make my viewpager non-circular. Then, how can I do this? (make non-circular auto-scroll viewpager)

siralam commented 6 years ago

autoScroll="true"

matinashtiani commented 6 years ago

Thank you for your response but setting autoScroll="true" cannot help me. I want to the viewpager scroll automatically from first page to the last one, but stay in the last page and does not move to first page. Can you help me about this?

siralam commented 6 years ago

Oh, this cannot be accomplished by this library (lose the point of using it), but also need not to use any library.

Simply use a Handler with postDelayed() and flip page every N seconds until the last page, then you are done.

Like this stackoverflow answer.

matinashtiani commented 6 years ago

Ok, thanks for your time and consideration.

siralam commented 6 years ago

You're welcomed, happy coding!