Open Bernhardino opened 1 year ago
I also set in the .xml
<com.github.barteksc.pdfviewer.PDFView
android:longClickable="true"
...
I imported the library into my project and observed the following: In DragPinchManager.java, the method onLongPress (line 198) is executed exactly on a LongClick. But somehow the event is passed incorrectly to pdfView.onLongClickListener. I passed the event according to https://guides.codepath.com/android/Creating-Custom-Listeners and voila, everything works fine now... _:)
My last post: I must confess, I was wrong. LongClick (which is called LongPress here) works fine. I used the wrong syntax: pdfView.setOnLongPressListener((OnLongPressListener) e -> {..., which worked with a few tweaks (see last post). Only by chance I saw that the correct syntax is pdfView.fromFile(new File(file)).onLongPress(onLongPressListener).load();. Well, the instructions on the site https://github.com/barteksc/AndroidPdfViewer are a bit poor...
Although I set pdfView.setLongClickable(true), the OnLongClickListener does not respond to a long Click. Click and OnClickListener work fine.