Package 

Class FabricUIManager

  • All Implemented Interfaces:
    com.facebook.react.bridge.JSIModule , com.facebook.react.bridge.LifecycleEventListener , com.facebook.react.bridge.PerformanceCounter , com.facebook.react.bridge.UIManager

    
    public class FabricUIManager
     implements UIManager, LifecycleEventListener
                        

    We instruct ProGuard not to strip out any fields or methods, because many of these methods are only called through the JNI from Cxx so it appears that most of this class is "unused".

    • Method Detail

      • getInspectorDataForInstance

        @UiThread() ReadableMap getInspectorDataForInstance(int surfaceId, View view)

        This API returns metadata associated to the React Component that rendered the Android Viewreceived as a parameter.

        Parameters:
        surfaceId - that represents the surfaceId for the View received as aparameter.
        view - View view that will be used to retrieve the React view hierarchy metadata.
      • preInitializeViewManagers

         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.

        Parameters:
        viewManagerNames - names of ViewManagers
      • startSurface

        @AnyThread() <T extends View> int startSurface(T rootView, String moduleName, WritableMap initialProps, int widthMeasureSpec, int heightMeasureSpec)

        Registers a new root view with width and height.

      • onRequestEventBeat

         void onRequestEventBeat()

        Method called when an event has been dispatched on the C++ side.

      • stopSurface

        @AnyThread() 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.

      • initialize

         void initialize()

        This is called at the end of createCatalystInstance afterthe CatalystInstance has been created, in order to initialize NativeModules that require theCatalystInstance or JS modules.

      • getThemeData

         boolean getThemeData(int surfaceId, Array<float> defaultTextInputPadding)
        Parameters:
        surfaceId - surface ID
        defaultTextInputPadding - output parameter will contain the default themepadding used by RN Android TextInput.
      • synchronouslyUpdateViewOnUIThread

        @UiThread() void synchronouslyUpdateViewOnUIThread(int reactTag, @NonNull() 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 updated
        props - ReadableMap props that should be immediately updated in view
      • updateRootLayoutSpecs

        @UiThread() void updateRootLayoutSpecs(int surfaceId, int widthMeasureSpec, int heightMeasureSpec, int offsetX, int offsetY)

        Updates the layout metrics of the root view based on the Measure specs received by parameters.

      • resolveView

         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

         void receiveEvent(int reactTag, String eventName, @Nullable() WritableMap params)

        This method dispatches events from RN Android code to JS. The delivery of this event will notbe queued in EventDispatcher class.

        Parameters:
        reactTag - tag
        eventName - name of the event
      • receiveEvent

         void receiveEvent(int surfaceId, int reactTag, String eventName, @Nullable() WritableMap params)

        This method dispatches events from RN Android code to JS. The delivery of this event will notbe queued in EventDispatcher class.

        Parameters:
        reactTag - tag
        eventName - name of the event
      • receiveEvent

         void receiveEvent(int surfaceId, int reactTag, String eventName, boolean canCoalesceEvent, int customCoalesceKey, @Nullable() WritableMap params, int eventCategory)

        receiveEvent API that emits an event to C++. If `canCoalesceEvent` is true, that signals thatC++ may coalesce the event optionally. Otherwise, coalescing can happen in Java beforeemitting.

        `customCoalesceKey` is currently unused.

      • onHostResume

         void onHostResume()

        Called either when the host activity receives a resume event (e.g. onResume orif the native module that implements this is initialized while the host activity is alreadyresumed. Always called for the most current activity.

      • onHostPause

         void onHostPause()

        Called when host activity receives pause event (e.g. onPause. Always calledfor the most current activity.

      • onHostDestroy

         void onHostDestroy()

        Called when host activity receives destroy event (e.g. onDestroy. Only calledfor the last React activity to be destroyed.

      • dispatchCommand

        @Deprecated()@AnyThread() 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 command
        commandId - command id
        commandArgs - ReadableArray parameters associated with the command
      • dispatchCommand

        @Deprecated()@AnyThread() 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 command
        commandId - String command id
        commandArgs - ReadableArray parameters associated with the command
      • sendAccessibilityEvent

        @AnyThread() 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.

      • setJSResponder

         void setJSResponder(int surfaceId, int reactTag, int initialReactTag, boolean blockNativeResponder)

        Set the JS responder for the view associated with the tags received as a parameter.

        Parameters:
        reactTag - React tag of the first parent of the view that is NOT virtual
        initialReactTag - React tag of the JS view that initiated the touch operation
        blockNativeResponder - If native responder should be blocked or not
      • clearJSResponder

         void clearJSResponder()

        Clears the JS Responder specified by setJSResponder. After this method is called, allthe touch events are going to be handled by JS.