All you need to do is look at the example here
You will find that in line 295 the page is always set to 1 so that it is scrollable
and that the count of pages is 3 in getCount()
method.
Those are the 2 main things you need to change, the rest is your logic and you can handle them differently.
Just make a personal counter that counts the real page you are on because position will no longer be usable after always setting current page to 1 on line 295.
p.s. this code is not mine it was referenced in the question you linked in your question