Intercepting touch events passed to PSPDFKit
PSPDFKit consumes touch events on displayed documents while providing simple callbacks for the most interesting events. See 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 you to wrap the PdfFragment
inside a custom ViewGroup
. You can then observe all touch events and intercept them before being handled in PdfFragment
by implementing ViewGroup#onInterceptTouchEvent()
. You can read more about this mechanism in Manage touch events in a ViewGroup guide.