Package 

Class TouchesHelper

    • Method Detail

      • sendTouchesLegacy

         static void sendTouchesLegacy(RCTEventEmitter rctEventEmitter, TouchEvent touchEvent)

        Generate and send touch event to RCTEventEmitter JS module associated with the given {@param * context} for legacy renderer. Touch event can encode multiple concurrent touches (pointers).

        Parameters:
        rctEventEmitter - Event emitter used to execute JS module call
        touchEvent - native touch event to read pointers count and coordinates from
      • sendTouchEvent

         static void sendTouchEvent(RCTModernEventEmitter eventEmitter, TouchEvent event)

        Generate touch event data to match JS expectations. Combines logic in sendTouchEvent and FabricEventEmitter to create the same data structure in a more efficient manner.

        Touches have to be dispatched as separate events for each changed pointer to make JS processthem correctly. To avoid allocations, we preprocess touch events in Java world and then convertthem to native before dispatch.

        Parameters:
        eventEmitter - emitter to dispatch event to
        event - the touch event to extract data from