DImuthuUpe / AndroidPdfViewer

Android view for displaying PDFs rendered with PdfiumAndroid
Apache License 2.0
8.05k stars 1.85k forks source link

autoSpacing not working when jumping between pages in swipeHorizontal(false) #1074

Closed perdix1975 closed 2 years ago

perdix1975 commented 2 years ago

When .swipeHorizontal(true), then .autoSpacing(true) works just fine. However, when .swipeHorizontal(false), then .autoSpacing(true) works only when swiping between pages, meaning that, when using pdfView.jumpTo(pageNumber), then autoSpacing doesn't seem to work!

perdix1975 commented 2 years ago

I found a workaround for this issue.

After calling jumpTo, call performPageSnap. Note that jumpTo animation must be false, otherwise jumpTo will not work.

pdfView.jumpTo(pageNumber, false); pdfView.performPageSnap();