Jon Willis has posted on how to enable an infinite scrolling with his code.
In there he said that he made some changes in the ViewPager class in the android support library. Which changes have been made and how is it possible to "recompile" the library with the ViewPager change?
Thank you for your answer Shereef.
I solved it a little bit differently.
I changed the code of the ViewPager class of the android support library. The method
setCurrentItem(int)changes the page with animation. This method calls an internal method that requires the index and a flag enabling smooth scrolling. This flag is
boolean smoothScroll.Extending this method with a second parameter
boolean smoothScrollsolved it for me.Calling this method
setCurrentItem(int index, boolean smoothScroll)allowed me to make it scroll indefinitely.Here is a full example:
Please consider that only the center page is shown.
Moreover did I store the pages seperately, allowing me to handle them with more ease.
However, without Jon Willis Code I wouldn’t have solved it myself.
EDIT: here is a blogpost about this: