Open fujidaiti opened 1 year ago
With the current implementation, there are 2 problems that must be solved before we can provide the option to always allow the pagination:
The former can be fixed by changing the way to calculate the visual positions of each page (see the working branch).
The later is, say, you vertically scroll certain pixels up the page A and horizontally swipe to the next page B keeping the vertical scroll position of A, then vertically scroll down B to the top to shrink the pages. If you horizontally swipe back to A, you should notice that the vertical scroll position of A is not at the top even though the pages have been fully shrunk (see the video at the bottom). To solve this problem, it is necessary to synchronize (set to 0) the scroll position of all pages at some point, but it is not clear where this should be done. A naive idea is to reset the scroll positions to 0 when the pages are completely switched, but this solution has a downside that the scroll position is not preserved before and after switching pages.
Maybe in this situation, we can have 2 controllers, one default with a default viewport fraction like 0.96 for example, and when the page is changed (we can use the built-in onPageChanged function) we can just switch to that default controller and that will reset and switch to default mode for viewport fraction?
Discussed in https://github.com/fujidaiti/exprollable_page_view/discussions/43