-
-
Save andreymusth/ebf2c9008b6eedadd46b0d4c8e443046 to your computer and use it in GitHub Desktop.
dispatch touch event
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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