Skip to content

Instantly share code, notes, and snippets.

@andreymusth
Created Jul 18, 2021
Embed
What would you like to do?
dispatch touch event
override fun dispatchTouchEvent(motionEvent: MotionEvent): Boolean {
...
try {
...
val pointerInputEvent =
motionEventAdapter.convertToPointerInputEvent(motionEvent)
if (pointerInputEvent != null) {
pointerInputEventProcessor.process(pointerInputEvent)
} else {
pointerInputEventProcessor.processCancel()
ProcessResult(
dispatchedToAPointerInputModifier = false,
anyMovementConsumed = false
)
}
if (processResult.anyMovementConsumed) {
parent.requestDisallowInterceptTouchEvent(true)
}
return processResult.dispatchedToAPointerInputModifier
} finally {
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment