import DiscreteGestureHandler from './DiscreteGestureHandler' ; import { HammerInputExt } from './GestureHandler' ; import * as NodeManager from './NodeManager' ; import PressGestureHandler from './PressGestureHandler' ; import { TEST_MIN_IF_NOT_NAN , VEC_LEN_SQ } from './utils' ; class NativeViewGestureHandler extends PressGestureHandler { onRawEvent ( ev ) { super . onRawEvent ( ev ) ; if ( ! ev . isFinal ) { if ( TEST_MIN_IF_NOT_NAN ( VEC_LEN_SQ ( { x : ev . deltaX , y : ev . deltaY } ) , 10 ) ) { if ( this . config . disallowInterruption ) { const gestures = Object . values ( NodeManager . getNodes ( ) ) . filter ( ( gesture ) => { const { handlerTag , view , isGestureRunning } = gesture ; return ( handlerTag !== this . handlerTag && isGestureRunning && gesture instanceof DiscreteGestureHandler && view && this . view . contains ( view ) ) ; } ) ; for ( const gesture of gestures ) { gesture . forceInvalidate ( ev ) ; } } } } } } export default NativeViewGestureHandler ;