-
- All Implemented Interfaces:
-
com.facebook.react.bridge.JSIModule
,com.facebook.react.bridge.PerformanceCounter
public interface UIManager implements JSIModule, PerformanceCounter
-
-
Method Summary
Modifier and Type Method Description abstract <T extends View> int
addRootView(T rootView, WritableMap initialProps, @Nullable() String initialUITemplate)
Registers a new root view. abstract <T extends View> int
startSurface(T rootView, String moduleName, WritableMap initialProps, int widthMeasureSpec, int heightMeasureSpec)
Registers a new root view with width and height. abstract void
stopSurface(int surfaceId)
Stop a surface from running in JS and clears up native memory usage. abstract void
updateRootLayoutSpecs(int rootTag, int widthMeasureSpec, int heightMeasureSpec, int offsetX, int offsetY)
Updates the layout specs of the RootShadowNode based on the Measure specs received byparameters. abstract void
dispatchCommand(int reactTag, int commandId, @Nullable() ReadableArray commandArgs)
Dispatches the commandId received by parameter to the view associated with the reactTag. abstract void
dispatchCommand(int reactTag, String commandId, @Nullable() ReadableArray commandArgs)
Dispatches the commandId received by parameter to the view associated with the reactTag. abstract <T> T
getEventDispatcher()
abstract void
synchronouslyUpdateViewOnUIThread(int reactTag, ReadableMap props)
Used by native animated module to bypass the process of updating the values through the shadowview hierarchy. abstract void
sendAccessibilityEvent(int reactTag, int eventType)
Dispatch an accessibility event to a view asynchronously. abstract void
addUIManagerEventListener(UIManagerListener listener)
Register a UIManagerListener with this UIManager to receive lifecycle callbacks. abstract void
removeUIManagerEventListener(UIManagerListener listener)
Unregister a UIManagerListener from this UIManager to stop receiving lifecyclecallbacks. abstract View
resolveView(int reactTag)
Resolves a view based on its reactTag. abstract void
receiveEvent(int reactTag, String eventName, @Nullable() WritableMap event)
This method dispatches events from RN Android code to JS. abstract void
receiveEvent(int surfaceId, int reactTag, String eventName, @Nullable() WritableMap event)
This method dispatches events from RN Android code to JS. abstract String
resolveCustomDirectEventName(@Nullable() String eventName)
Resolves Direct Event name exposed to JS from the one known to the Native side. abstract void
preInitializeViewManagers(List<String> viewManagerNames)
Helper method to pre-initialize view managers. -
Methods inherited from class com.facebook.react.bridge.JSIModule
initialize, onCatalystInstanceDestroy
-
Methods inherited from class com.facebook.react.bridge.PerformanceCounter
getPerformanceCounters, profileNextBatch
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
addRootView
@UiThread()@Deprecated() abstract <T extends View> int addRootView(T rootView, WritableMap initialProps, @Nullable() String initialUITemplate)
Registers a new root view. @Deprecated call startSurface instead
-
startSurface
@AnyThread() abstract <T extends View> int startSurface(T rootView, String moduleName, WritableMap initialProps, int widthMeasureSpec, int heightMeasureSpec)
Registers a new root view with width and height.
-
stopSurface
@AnyThread() abstract void stopSurface(int surfaceId)
Stop a surface from running in JS and clears up native memory usage. Assumes that the nativeView hierarchy has already been cleaned up. Fabric-only.
-
updateRootLayoutSpecs
@UiThread() abstract void updateRootLayoutSpecs(int rootTag, int widthMeasureSpec, int heightMeasureSpec, int offsetX, int offsetY)
Updates the layout specs of the RootShadowNode based on the Measure specs received byparameters. offsetX and offsetY are the position of the RootView within the screen.
-
dispatchCommand
abstract void dispatchCommand(int reactTag, int commandId, @Nullable() ReadableArray commandArgs)
Dispatches the commandId received by parameter to the view associated with the reactTag. Thecommand will be processed in the UIThread.
Receiving commands as ints is deprecated and will be removed in a future release.
Pre-Fabric, this is only called on the Native Module Thread.
- Parameters:
reactTag
- that identifies the view that will receive this commandcommandId
- command idcommandArgs
- ReadableArray parameters associated with the command
-
dispatchCommand
abstract void dispatchCommand(int reactTag, String commandId, @Nullable() ReadableArray commandArgs)
Dispatches the commandId received by parameter to the view associated with the reactTag. Thecommand will be processed in the UIThread.
Pre-Fabric, this is only called on the Native Module Thread.
- Parameters:
reactTag
- that identifies the view that will receive this commandcommandId
- String command idcommandArgs
- ReadableArray parameters associated with the command
-
getEventDispatcher
abstract <T> T getEventDispatcher()
-
synchronouslyUpdateViewOnUIThread
@UiThread() abstract void synchronouslyUpdateViewOnUIThread(int reactTag, ReadableMap props)
Used by native animated module to bypass the process of updating the values through the shadowview hierarchy. This method will directly update native views, which means that updates forlayout-related propertied won't be handled properly. Make sure you know what you're doingbefore calling this method :)
- Parameters:
reactTag
- that identifies the view that will be updatedprops
- ReadableMap props that should be immediately updated in view
-
sendAccessibilityEvent
abstract void sendAccessibilityEvent(int reactTag, int eventType)
Dispatch an accessibility event to a view asynchronously.
Pre-Fabric, this is only called on the Native Module Thread.
-
addUIManagerEventListener
abstract void addUIManagerEventListener(UIManagerListener listener)
Register a UIManagerListener with this UIManager to receive lifecycle callbacks.
-
removeUIManagerEventListener
abstract void removeUIManagerEventListener(UIManagerListener listener)
Unregister a UIManagerListener from this UIManager to stop receiving lifecyclecallbacks.
-
resolveView
abstract View resolveView(int reactTag)
Resolves a view based on its reactTag. Do not mutate properties on this view that are alreadymanaged by React, as there are no guarantees this changes will be preserved.
- Parameters:
reactTag
- tag
-
receiveEvent
@Deprecated() abstract void receiveEvent(int reactTag, String eventName, @Nullable() WritableMap event)
This method dispatches events from RN Android code to JS. The delivery of this event will notbe queued in EventDispatcher class.
- Parameters:
reactTag
- tageventName
- name of the eventevent
- parameters
-
receiveEvent
abstract void receiveEvent(int surfaceId, int reactTag, String eventName, @Nullable() WritableMap event)
This method dispatches events from RN Android code to JS. The delivery of this event will notbe queued in EventDispatcher class.
- Parameters:
reactTag
- tageventName
- name of the eventevent
- parameters
-
resolveCustomDirectEventName
@Deprecated()@Nullable() abstract String resolveCustomDirectEventName(@Nullable() String eventName)
Resolves Direct Event name exposed to JS from the one known to the Native side.
-
preInitializeViewManagers
@Deprecated() abstract void preInitializeViewManagers(List<String> viewManagerNames)
Helper method to pre-initialize view managers. When using Native ViewConfigs this method willalso pre-compute the constants for a view manager. The purpose is to ensure that we don't blockfor getting the constants for view managers during initial rendering of a surface.
-
-
-
-