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 |
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() |
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 |
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) |
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) |
void |
stopSurface(int surfaceID) |
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)
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)
public void onRequestEventBeat()
public void stopSurface(int surfaceID)
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 void synchronouslyUpdateViewOnUIThread(int reactTag, ReadableMap props)
UIManager
synchronouslyUpdateViewOnUIThread
in interface UIManager
props
- ReadableMap
props that should be immediately updated in viewpublic void setBinding(Binding binding)
public void updateRootLayoutSpecs(int rootTag, int widthMeasureSpec, int heightMeasureSpec)
updateRootLayoutSpecs
in interface UIManager
public void receiveEvent(int reactTag, java.lang.String eventName, WritableMap params)
public 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
public java.util.Map<java.lang.String,java.lang.Long> getPerformanceCounters()
getPerformanceCounters
in interface PerformanceCounter