eschao / android-PageFlip

3D Style Page Flip on Android
Apache License 2.0
1.74k stars 262 forks source link

How to maintain the sequence of the page flip. #51

Open SachinSoma opened 4 years ago

SachinSoma commented 4 years ago

Hey its a wonderful library . I am trying to implement it, but the library does not the show pages in sequence I declared in array. And when i go to previous page their is some other random page. I want to maintain the sequence just like a book. Can you help on this.

eschao commented 4 years ago

Please see this line: https://github.com/eschao/android-PageFlip/blob/adf677e156fd83c8a6eaea650e493e82c876f8c2/Sample/src/main/java/com/eschao/android/widget/sample/pageflip/SinglePageRender.java#L181
This line is used to draw new page into a bitmap and then the bitmap will be passed to PageFlip to show, and here, you will see its function has a number parameter: https://github.com/eschao/android-PageFlip/blob/adf677e156fd83c8a6eaea650e493e82c876f8c2/Sample/src/main/java/com/eschao/android/widget/sample/pageflip/SinglePageRender.java#L174 You can load the bitmap according to the number, number means which page will be showed, it could be an index of you bitmap array. With that, I think you will get the sequence pages to show.