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
924 stars 273 forks source link

Save state on orientation change #3

Open emilsjolander opened 11 years ago

rafaelekol commented 10 years ago

Any progress on this issue? How I can save item position to show it on orientation change?

I tried to use flipTo(); method on onRestoreInstanceState but it gives error

emilsjolander commented 10 years ago

Not really looked into it yet but shouldn't be hard to fix. Have a look at the source and see if you can contribute that yourself. I might have time to look into it this week also

rafaelekol commented 10 years ago

I solved this issue, by feeding FlipView page position from SharedPreferences. I just store FlipView current page in onSaveInstanceState. So on each rotation FlipView reads page position from SharedPreferences

emilsjolander commented 10 years ago

you should probably save the position in the bundle passed to onSaveInstanceState instead

rafaelekol commented 10 years ago

I tried to do it with Bundle but couldn't make it :) I use SharedPreferences because I need to pass page position for from other activity too. Anyway using SharedPreferences solved my problem.