-
public class ReactFindViewUtilFinds views in React Native view hierarchies
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceReactFindViewUtil.OnViewFoundListenerCallback to be invoked when a react native view has been found
public interfaceReactFindViewUtil.OnMultipleViewsFoundListenerCallback to be invoked when all react native views with geiven NativeIds have been found
-
Method Summary
Modifier and Type Method Description static ViewfindView(View root, String nativeId)Finds a view that is tagged with {@param nativeId} as its nativeID prop under the {@param root} view hierarchy. static voidfindView(View root, ReactFindViewUtil.OnViewFoundListener onViewFoundListener)Finds a view tagged with {@param onViewFoundListener}'s nativeID in the given {@param root} view hierarchy. static voidaddViewListener(ReactFindViewUtil.OnViewFoundListener onViewFoundListener)Registers an OnViewFoundListener to be invoked when a view with a matching nativeID is found.Remove this listener using removeViewListener() if it's no longer needed. static voidremoveViewListener(ReactFindViewUtil.OnViewFoundListener onViewFoundListener)Removes an OnViewFoundListener previously registered with addViewListener(). static voidaddViewsListener(ReactFindViewUtil.OnMultipleViewsFoundListener listener, Set<String> ids)static voidremoveViewsListener(ReactFindViewUtil.OnMultipleViewsFoundListener listener)static voidnotifyViewRendered(View view)Invokes any listeners that are listening on this {@param view}'s native id -
-
Method Detail
-
findView
@Nullable() static View findView(View root, String nativeId)
Finds a view that is tagged with {@param nativeId} as its nativeID prop under the {@param root} view hierarchy. Returns the view if found, null otherwise.
- Parameters:
root- root of the view hierarchy from which to find the view
-
findView
static void findView(View root, ReactFindViewUtil.OnViewFoundListener onViewFoundListener)
Finds a view tagged with {@param onViewFoundListener}'s nativeID in the given {@param root} view hierarchy. If the view does not exist yet due to React Native's async layout, a listenerwill be added. When the view is found, the {@param onViewFoundListener} will be invoked.
- Parameters:
root- root of the view hierarchy from which to find the view
-
addViewListener
static void addViewListener(ReactFindViewUtil.OnViewFoundListener onViewFoundListener)
Registers an OnViewFoundListener to be invoked when a view with a matching nativeID is found.Remove this listener using removeViewListener() if it's no longer needed.
-
removeViewListener
static void removeViewListener(ReactFindViewUtil.OnViewFoundListener onViewFoundListener)
Removes an OnViewFoundListener previously registered with addViewListener().
-
addViewsListener
static void addViewsListener(ReactFindViewUtil.OnMultipleViewsFoundListener listener, Set<String> ids)
-
removeViewsListener
static void removeViewsListener(ReactFindViewUtil.OnMultipleViewsFoundListener listener)
-
notifyViewRendered
static void notifyViewRendered(View view)
Invokes any listeners that are listening on this {@param view}'s native id
-
-
-
-