emilsjolander / android-FlipView

A small, easy to use android library for implementing flipping between views as seen in the popular Flipboard application
Apache License 2.0
925 stars 273 forks source link

Initial state is non-functional #42

Open pivotal-ykulbashian opened 9 years ago

pivotal-ykulbashian commented 9 years ago

When we initialize the FlipView with basic TextViews, the initial load state shows the bottom part flapping back and forth. In this state, when we call flipTo it will not go to that page, and if we call smoothFlipTo it will flip to that page, then immediately return to the initial page, as though it was reset.

Curiously, if we force it to flip by hand once when it first loads, the hanging behavior stops (it becomes static), then both flipTo and smoothFlipTo work more or less as expected.

It also seems to wrap around to -1 when we go over the top.

Edit: we've tracked the error, and it appears that the peekNext (spelled peakNext) was running indefinitely, and it was resetting the flipDistance value to 0. Recommendation: halt the peek behavior as soon as flipping is started. I would do a pull request but Gradle won't build the project on my computer for some reason.