Package 

Class TouchTargetHelper


  • 
    public class TouchTargetHelper
    
                        

    Class responsible for identifying which react view should handle a given MotionEvent. It uses the event coordinates to traverse the view hierarchy and return a suitable view.

    • Method Detail

      • findTargetTagForTouch

         static int findTargetTagForTouch(float eventX, float eventY, ViewGroup viewGroup)

        Find touch event target view within the provided container given the coordinates provided via MotionEvent.

        Parameters:
        eventX - the X screen coordinate of the touch location
        eventY - the Y screen coordinate of the touch location
        viewGroup - the container view to traverse
      • findTargetTagForTouch

         static int findTargetTagForTouch(float eventX, float eventY, ViewGroup viewGroup, @Nullable() Array<int> nativeViewId)

        Find touch event target view within the provided container given the coordinates provided via MotionEvent.

        Parameters:
        eventX - the X screen coordinate of the touch location
        eventY - the Y screen coordinate of the touch location
        viewGroup - the container view to traverse
        nativeViewId - the native react view containing this touch target
      • findTargetTagAndCoordinatesForTouch

         static int findTargetTagAndCoordinatesForTouch(float eventX, float eventY, ViewGroup viewGroup, Array<float> viewCoords, @Nullable() Array<int> nativeViewTag)

        Find touch event target view within the provided container given the coordinates provided via MotionEvent.

        Parameters:
        eventX - the X screen coordinate of the touch location
        eventY - the Y screen coordinate of the touch location
        viewGroup - the container view to traverse
        viewCoords - an out parameter that will return the X,Y value in the target view
        nativeViewTag - an out parameter that will return the native view id
      • findTargetPathAndCoordinatesForTouch

         static List<TouchTargetHelper.ViewTarget> findTargetPathAndCoordinatesForTouch(float eventX, float eventY, ViewGroup viewGroup, Array<float> viewCoords)

        Find touch event target view within the provided container given the coordinates provided via MotionEvent.

        Parameters:
        eventX - the X screen coordinate of the touch location
        eventY - the Y screen coordinate of the touch location
        viewGroup - the container view to traverse
        viewCoords - an out parameter that will return the X,Y value in the target view