blipinsk / FlippableStackView

An Android library introducing a stack of Views with the first item being flippable.
Apache License 2.0
810 stars 150 forks source link

Move items programatically #22

Closed RobertoAlvarezCeballos closed 8 years ago

RobertoAlvarezCeballos commented 8 years ago

Hi,

Not really an issue, just a question. Would it be possible to move the items inside the StackView programatically? Imagine I have a button and once I click it I want to see the next item on the array.

Any ideas?

Thank you!

blipinsk commented 8 years ago

Hi, you have to remember that it's just a ViewPager. So how would you do this in the ViewPager? You have to utilize [setCurrentItem(int item, true)](https://developer.android.com/reference/android/support/v4/view/ViewPager.html#setCurrentItem%28int, boolean%29) method.

A different issue might be that you might not see the item being flipped, due to ViewPager smooth scroll animation being to fast. To resolve that you can take one of the approaches from here.

Cheers, Bartek

RobertoAlvarezCeballos commented 8 years ago

Hi,

Thanks you!!! I tried that and for some reason the method wasn't showing up and I thought it was something different.

Hope it works :)