DImuthuUpe / AndroidPdfViewer

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

HorizontalScrolling Like Viewpager #475

Open iNicod opened 6 years ago

iNicod commented 6 years ago

Is it possible to configure the library to an horizontal scroll like a view pager (2 pages per 2 pages or 1 by one) ?

I've made it with a viewpager loading in pdfview everytime but I don't think it would be a good practice.

1stmetro commented 6 years ago

in theory if you add some width code to the source you could do this, i was thinking of doing mini pages across the bottom with a click to take you to the page.

iNicod commented 6 years ago

Could you explain me a little bit more how could I make this ?

1stmetro commented 6 years ago

Its not too hard, its not finished but you get the ideal..

Single click changes the main page..

device-2017-12-19-234131

1stmetro commented 6 years ago

Sorry i never explained how to create the mini maps as it was late,

Basically create two pdfview methods but one of them you resize in height and then set the zoom otherwise you will get one page filling the width.

From their you add the click listener and set the page number selected onto the larger image.

As you can see for speed i have the Fab button which will hide or display the minimap, just got to create the animations for slide in and out.

Its not a lot of work as i said but on this image does look quite impressive, i dont use the activity background color as a border so it doesnt clip in anyway it works very fluid to the end user.

If you get something working post a pic it would be nice to get some more ideals of how to improve upon this.