public class TouchTargetHelper
extends java.lang.Object
MotionEvent
.
It uses the event coordinates to traverse the view hierarchy and return a suitable view.Constructor and Description |
---|
TouchTargetHelper() |
Modifier and Type | Method and Description |
---|---|
static int |
findTargetTagAndCoordinatesForTouch(float eventX,
float eventY,
android.view.ViewGroup viewGroup,
float[] viewCoords,
int[] nativeViewTag)
Find touch event target view within the provided container given the coordinates provided
via
MotionEvent . |
static int |
findTargetTagForTouch(float eventX,
float eventY,
android.view.ViewGroup viewGroup)
Find touch event target view within the provided container given the coordinates provided
via
MotionEvent . |
static int |
findTargetTagForTouch(float eventX,
float eventY,
android.view.ViewGroup viewGroup,
int[] nativeViewId)
Find touch event target view within the provided container given the coordinates provided
via
MotionEvent . |
public static int findTargetTagForTouch(float eventX, float eventY, android.view.ViewGroup viewGroup)
MotionEvent
.eventX
- the X screen coordinate of the touch locationeventY
- the Y screen coordinate of the touch locationviewGroup
- the container view to traversepublic static int findTargetTagForTouch(float eventX, float eventY, android.view.ViewGroup viewGroup, @Nullable int[] nativeViewId)
MotionEvent
.eventX
- the X screen coordinate of the touch locationeventY
- the Y screen coordinate of the touch locationviewGroup
- the container view to traversenativeViewId
- the native react view containing this touch targetpublic static int findTargetTagAndCoordinatesForTouch(float eventX, float eventY, android.view.ViewGroup viewGroup, float[] viewCoords, @Nullable int[] nativeViewTag)
MotionEvent
.eventX
- the X screen coordinate of the touch locationeventY
- the Y screen coordinate of the touch locationviewGroup
- the container view to traverseviewCoords
- an out parameter that will return the X,Y value in the target viewnativeViewTag
- an out parameter that will return the native view id