NativeViewHierarchyManager

@NotThreadSafe
open class NativeViewHierarchyManager

Delegate of UIManagerModule that owns the native view hierarchy and mapping between native view names used in JS and corresponding instances of ViewManager. The communicates with this class by it's public interface methods:

executing all the scheduled UI operations at the end of JS batch.

NB: All native view management methods listed above must be called from the UI thread.

The ReactContext instance that is passed to views that this manager creates differs from the one that we pass as a constructor. Instead we wrap the provided instance of in an instance of ThemedReactContext that additionally provide a correct theme based on the root view for a view tree that we attach newly created view to. Therefore this view manager will create a copy of ThemedReactContext that wraps the instance of for each root view added to the manager (see addRootView).

TODO(5483031): Only dispatch updates when shadow views have changed

Constructors

Link copied to clipboard
constructor(viewManagers: ViewManagerRegistry)
constructor(viewManagers: ViewManagerRegistry, manager: RootViewManager)

Functions

Link copied to clipboard
open fun addRootView(tag: Int, view: View)
See addRootView.
Link copied to clipboard
open fun clearJSResponder()
Link copied to clipboard
open fun createView(themedContext: ThemedReactContext, tag: Int, className: String, @Nullable initialProps: ReactStylesDiffMap)
Link copied to clipboard
open fun dispatchCommand(reactTag: Int, commandId: Int, @Nullable args: ReadableArray)
open fun dispatchCommand(reactTag: Int, commandId: String, @Nullable args: ReadableArray)
Link copied to clipboard
open fun findTargetTagForTouch(reactTag: Int, touchX: Float, touchY: Float): Int
Link copied to clipboard
open fun getInstanceHandle(reactTag: Int): Long
Link copied to clipboard
open fun getRootViewNum(): Int
Return root view num
Link copied to clipboard
open fun manageChildren(tag: Int, @Nullable indicesToRemove: Array<Int>, @Nullable viewsToAdd: Array<ViewAtIndex>, @Nullable tagsToDelete: Array<Int>)
Link copied to clipboard
open fun measure(tag: Int, outputBuffer: Array<Int>)
Returns true on success, false on failure.
Link copied to clipboard
open fun measureInWindow(tag: Int, outputBuffer: Array<Int>)
Returns the coordinates of a view relative to the window (not just the RootView which is what measure will return)
Link copied to clipboard
open fun removeRootView(rootViewTag: Int)
Link copied to clipboard
fun resolveView(tag: Int): View
Link copied to clipboard
Link copied to clipboard
open fun sendAccessibilityEvent(tag: Int, eventType: Int)
Link copied to clipboard
open fun setChildren(tag: Int, childrenTags: ReadableArray)
Simplified version of manageChildren that only deals with adding children views
Link copied to clipboard
open fun setJSResponder(reactTag: Int, initialReactTag: Int, blockNativeResponder: Boolean)
Link copied to clipboard
Link copied to clipboard
open fun updateInstanceHandle(tag: Int, instanceHandle: Long)
Link copied to clipboard
open fun updateLayout(tag: Int, x: Int, y: Int, width: Int, height: Int)
open fun updateLayout(parentTag: Int, tag: Int, x: Int, y: Int, width: Int, height: Int, layoutDirection: YogaDirection)
Link copied to clipboard
open fun updateProperties(tag: Int, props: ReactStylesDiffMap)
Link copied to clipboard
open fun updateViewExtraData(tag: Int, extraData: Any)