DImuthuUpe / AndroidPdfViewer

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

Why does it not have .setSwipeHorizontal just like .setSnapPages and .setNightMode? #1126

Open CosyLocales opened 1 year ago

CosyLocales commented 1 year ago

I want the pdfviewer to swipe horizontal on the click of a switch. That is the user can change the mode to either vertical or horizontal. I can't seem to find a way to set that without having to load the input stream code again. Is there a way to work it out?

code

ThreeMinutesFix commented 1 year ago

Not checked but i guess we can do it this way

if(sideways.ischecked()
{
pdfview.swipeHorizontal(true)
}
else
{
pdfview.swipeHorizontal(false)
}
CosyLocales commented 1 year ago

Not checked but i guess we can do it this way


if(sideways.ischecked()
{
pdfview.swipeHorizontal(true)
}
else
{
pdfview.swipeHorizontal(false)
}

Hi, there's no such option.

ThreeMinutesFix commented 1 year ago

in latest release this have pdfView.fromAsset(String) .pages(0, 2, 1, 3, 3, 3) // all pages are displayed by default .enableSwipe(true) // allows to block changing pages using swipe .swipeHorizontal(false) .enableDoubletap(true) .defaultPage(0)

CosyLocales commented 1 year ago

in latest release this have pdfView.fromAsset(String) .pages(0, 2, 1, 3, 3, 3) // all pages are displayed by default .enableSwipe(true) // allows to block changing pages using swipe .swipeHorizontal(false) .enableDoubletap(true) .defaultPage(0)

Yes, It has that which I have used for the first load. After the pdf loads, I want a switch button to trigger vertical and horizontal modes as indicated in the screenshot. That's where it gets tricky because there's no option for pdfview.swipeHorizontal. It seems that for me to use that option, I have to load the pdf from stream again. Please try it out and help me.