Intercepting Touch Events Passed to PSPDFKit
PSPDFKit consumes touch events on displayed documents while providing simple callbacks for the most interesting events. Refer to the document listeners guide for a full list of exposed events.
If you need to observe all touch events — for example, to detect multitouch — we recommend wrapping PdfFragment
inside a custom ViewGroup
. You can then observe all touch events and intercept them before they’re handled in PdfFragment
by implementing ViewGroup#onInterceptTouchEvent()
. You can read more about this mechanism in the Manage touch events in a ViewGroup guide.