public class FabricUIManager extends java.lang.Object implements UIManager, LifecycleEventListener
Modifier and Type | Field and Description |
---|---|
static boolean |
ENABLE_FABRIC_LOGS |
static boolean |
IS_DEVELOPMENT_ENVIRONMENT |
static java.lang.String |
TAG |
Constructor and Description |
---|
FabricUIManager(ReactApplicationContext reactContext,
ViewManagerRegistry viewManagerRegistry,
EventDispatcher eventDispatcher,
EventBeatManager eventBeatManager) |
Modifier and Type | Method and Description |
---|---|
<T extends android.view.View> |
addRootView(T rootView,
WritableMap initialProps,
java.lang.String initialUITemplate)
Registers a new root view.
|
void |
addUIManagerEventListener(UIManagerListener listener)
Register a
UIManagerListener with this UIManager to receive lifecycle callbacks. |
void |
clearJSResponder()
Clears the JS Responder specified by
setJSResponder(int, int, boolean) . |
void |
dispatchCommand(int reactTag,
int commandId,
ReadableArray commandArgs)
Deprecated.
|
void |
dispatchCommand(int reactTag,
java.lang.String commandId,
ReadableArray commandArgs)
Dispatches the commandId received by parameter to the view associated with the reactTag.
|
EventDispatcher |
getEventDispatcher() |
java.util.Map<java.lang.String,java.lang.Long> |
getPerformanceCounters() |
boolean |
getThemeData(int surfaceID,
float[] defaultTextInputPadding) |
void |
initialize()
This is called at the end of
CatalystApplicationFragment#createCatalystInstance() after
the CatalystInstance has been created, in order to initialize NativeModules that require the
CatalystInstance or JS modules. |
void |
onAllAnimationsComplete() |
void |
onAnimationStarted() |
void |
onCatalystInstanceDestroy()
Called before {CatalystInstance#onHostDestroy}
|
void |
onHostDestroy()
Called when host activity receives destroy event (e.g.
|
void |
onHostPause()
Called when host activity receives pause event (e.g.
|
void |
onHostResume()
Called either when the host activity receives a resume event (e.g.
|
void |
onRequestEventBeat()
Method called when an event has been dispatched on the C++ side.
|
void |
profileNextBatch() |
void |
receiveEvent(int reactTag,
java.lang.String eventName,
WritableMap params)
This method dispatches events from RN Android code to JS.
|
void |
removeUIManagerEventListener(UIManagerListener listener)
Unregister a
UIManagerListener from this UIManager to stop receiving lifecycle
callbacks. |
java.lang.String |
resolveCustomDirectEventName(java.lang.String eventName)
Deprecated.
|
void |
sendAccessibilityEvent(int reactTag,
int eventType)
Dispatch an accessibility event to a view asynchronously.
|
void |
setBinding(Binding binding) |
void |
setJSResponder(int reactTag,
int initialReactTag,
boolean blockNativeResponder)
Set the JS responder for the view associated with the tags received as a parameter.
|
<T extends android.view.View> |
startSurface(T rootView,
java.lang.String moduleName,
WritableMap initialProps,
int widthMeasureSpec,
int heightMeasureSpec)
Registers a new root view with width and height.
|
void |
stopSurface(int surfaceID)
Stop a surface from running in JS and clears up native memory usage.
|
void |
synchronouslyUpdateViewOnUIThread(int reactTag,
ReadableMap props)
Used by native animated module to bypass the process of updating the values through the shadow
view hierarchy.
|
void |
updateRootLayoutSpecs(int rootTag,
int widthMeasureSpec,
int heightMeasureSpec,
int offsetX,
int offsetY)
Updates the layout metrics of the root view based on the Measure specs received by parameters.
|
public static final java.lang.String TAG
public static final boolean IS_DEVELOPMENT_ENVIRONMENT
public static final boolean ENABLE_FABRIC_LOGS
public FabricUIManager(ReactApplicationContext reactContext, ViewManagerRegistry viewManagerRegistry, EventDispatcher eventDispatcher, EventBeatManager eventBeatManager)
public <T extends android.view.View> int addRootView(T rootView, WritableMap initialProps, java.lang.String initialUITemplate)
UIManager
addRootView
in interface UIManager
public <T extends android.view.View> int startSurface(T rootView, java.lang.String moduleName, WritableMap initialProps, int widthMeasureSpec, int heightMeasureSpec)
UIManager
startSurface
in interface UIManager
public void onRequestEventBeat()
public void stopSurface(int surfaceID)
UIManager
stopSurface
in interface UIManager
public void initialize()
JSIModule
CatalystApplicationFragment#createCatalystInstance()
after
the CatalystInstance has been created, in order to initialize NativeModules that require the
CatalystInstance or JS modules.initialize
in interface JSIModule
public void onCatalystInstanceDestroy()
JSIModule
onCatalystInstanceDestroy
in interface JSIModule
public boolean getThemeData(int surfaceID, float[] defaultTextInputPadding)
surfaceID
- int
surface IDdefaultTextInputPadding
- float[]
output parameter will contain the default theme
padding used by RN Android TextInput.public void synchronouslyUpdateViewOnUIThread(int reactTag, ReadableMap props)
UIManager
synchronouslyUpdateViewOnUIThread
in interface UIManager
props
- ReadableMap
props that should be immediately updated in viewpublic void addUIManagerEventListener(UIManagerListener listener)
UIManager
UIManagerListener
with this UIManager to receive lifecycle callbacks.addUIManagerEventListener
in interface UIManager
public void removeUIManagerEventListener(UIManagerListener listener)
UIManager
UIManagerListener
from this UIManager to stop receiving lifecycle
callbacks.removeUIManagerEventListener
in interface UIManager
public void setBinding(Binding binding)
public void updateRootLayoutSpecs(int rootTag, int widthMeasureSpec, int heightMeasureSpec, int offsetX, int offsetY)
updateRootLayoutSpecs
in interface UIManager
public void receiveEvent(int reactTag, java.lang.String eventName, WritableMap params)
UIManager
receiveEvent
in interface UIManager
reactTag
- tageventName
- name of the eventparams
- parameterspublic void onHostResume()
LifecycleEventListener
Activity#onResume
or
if the native module that implements this is initialized while the host activity is already
resumed. Always called for the most current activity.onHostResume
in interface LifecycleEventListener
public EventDispatcher getEventDispatcher()
getEventDispatcher
in interface UIManager
EventDispatcher
object that is used by this class.public void onHostPause()
LifecycleEventListener
Activity#onPause
. Always called
for the most current activity.onHostPause
in interface LifecycleEventListener
public void onHostDestroy()
LifecycleEventListener
Activity#onDestroy
. Only called
for the last React activity to be destroyed.onHostDestroy
in interface LifecycleEventListener
@Deprecated public void dispatchCommand(int reactTag, int commandId, ReadableArray commandArgs)
UIManager
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.
dispatchCommand
in interface UIManager
reactTag
- int
that identifies the view that will receive this commandcommandId
- int
command idcommandArgs
- ReadableArray
parameters associated with the commandpublic void dispatchCommand(int reactTag, java.lang.String commandId, ReadableArray commandArgs)
UIManager
Pre-Fabric, this is only called on the Native Module Thread.
dispatchCommand
in interface UIManager
reactTag
- int
that identifies the view that will receive this commandcommandId
- String
command idcommandArgs
- ReadableArray
parameters associated with the commandpublic void sendAccessibilityEvent(int reactTag, int eventType)
UIManager
Pre-Fabric, this is only called on the Native Module Thread.
sendAccessibilityEvent
in interface UIManager
public void setJSResponder(int reactTag, int initialReactTag, boolean blockNativeResponder)
reactTag
- React tag of the first parent of the view that is NOT virtualinitialReactTag
- React tag of the JS view that initiated the touch operationblockNativeResponder
- If native responder should be blocked or notpublic void clearJSResponder()
setJSResponder(int, int, boolean)
. After this
method is called, all the touch events are going to be handled by JS.public void profileNextBatch()
profileNextBatch
in interface PerformanceCounter
@Deprecated public java.lang.String resolveCustomDirectEventName(java.lang.String eventName)
UIManager
resolveCustomDirectEventName
in interface UIManager
public void onAnimationStarted()
public void onAllAnimationsComplete()
public java.util.Map<java.lang.String,java.lang.Long> getPerformanceCounters()
getPerformanceCounters
in interface PerformanceCounter