Intercepting touch events passed to Nutrient
Nutrient 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
(opens in a new tab). You can then observe all touch events and intercept them before they’re handled in PdfFragment
by implementing ViewGroup#onInterceptTouchEvent()
(opens in a new tab). You can read more about this mechanism in the Manage touch events in a ViewGroup(opens in a new tab) guide.