Package 

Class ReactTextViewManager

    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final static String REACT_CLASS
    • Method Summary

      Modifier and Type Method Description
      String getName()
      ReactTextView createViewInstance(ThemedReactContext context) Subclasses should return a new View instance of the proper type.
      void updateExtraData(ReactTextView view, Object extraData) Subclasses can implement this method to receive an optional extra data enqueued from thecorresponding instance of ReactShadowNode in .
      ReactTextShadowNode createShadowNodeInstance() This method should return a subclass of ReactShadowNode which will be then used formeasuring position and size of the view.
      ReactTextShadowNode createShadowNodeInstance(@Nullable() ReactTextViewManagerCallback reactTextViewManagerCallback)
      Class<ReactTextShadowNode> getShadowNodeClass() This method should return Class instance that represent type of shadow node that thismanager will return from createShadowNodeInstance.
      boolean needsCustomLayoutForChildren() Returns whether this View type needs to handle laying out its own children instead of deferringto the standard css-layout algorithm.
      Object updateState(ReactTextView view, ReactStylesDiffMap props, @Nullable() StateWrapper stateWrapper) Subclasses can implement this method to receive state updates shared between all instances ofthis component type.
      Map getExportedCustomDirectEventTypeConstants() Returns a map of config data passed to JS that defines eligible events that can be placed onnative views.
      long measure(Context context, ReadableMap localData, ReadableMap props, ReadableMap state, float width, YogaMeasureMode widthMode, float height, YogaMeasureMode heightMode, @Nullable() Array<float> attachmentsPositions) Subclasses can override this method to implement custom measure functions for the ViewManager
      long measure(Context context, MapBuffer localData, MapBuffer props, @Nullable() MapBuffer state, float width, YogaMeasureMode widthMode, float height, YogaMeasureMode heightMode, @Nullable() Array<float> attachmentsPositions) THIS MEASURE METHOD IS EXPERIMENTAL, MOST LIKELY YOU ARE LOOKING TO USE THE OTHER OVERLOADINSTEAD: measureSubclasses can override this method to implement custom measure functions for theViewManager
      void setPadding(ReactTextView view, int left, int top, int right, int bottom) Subclasses can override this method to set padding for the given View in Fabric.
      • Methods inherited from class com.facebook.react.views.text.ReactTextAnchorViewManager

        setAccessible, setAdjustFontSizeToFit, setAndroidHyphenationFrequency, setBorderColor, setBorderRadius, setBorderStyle, setBorderWidth, setDataDetectorType, setDisabled, setEllipsizeMode, setIncludeFontPadding, setNotifyOnInlineViewLayout, setNumberOfLines, setSelectable, setSelectionColor, setTextAlignVertical
      • Methods inherited from class com.facebook.react.uimanager.BaseViewManager

        getExportedCustomBubblingEventTypeConstants, getExportedCustomDirectEventTypeConstants, setAccessibilityActions, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLabelledBy, setAccessibilityLiveRegion, setAccessibilityRole, setAccessibilityValue, setBackgroundColor, setBorderBottomLeftRadius, setBorderBottomRightRadius, setBorderRadius, setBorderTopLeftRadius, setBorderTopRightRadius, setElevation, setImportantForAccessibility, setMoveShouldSetResponder, setMoveShouldSetResponderCapture, setNativeId, setOpacity, setPointerEnter, setPointerLeave, setPointerMove, setRenderToHardwareTexture, setResponderEnd, setResponderGrant, setResponderMove, setResponderReject, setResponderRelease, setResponderStart, setResponderTerminate, setResponderTerminationRequest, setRotation, setScaleX, setScaleY, setShadowColor, setShouldBlockNativeResponder, setStartShouldSetResponder, setStartShouldSetResponderCapture, setTestId, setTouchCancel, setTouchEnd, setTouchMove, setTouchStart, setTransform, setTranslateX, setTranslateY, setViewState, setZIndex
      • Methods inherited from class com.facebook.react.uimanager.ViewManager

        createShadowNodeInstance, createShadowNodeInstance, createView, getCommandsMap, getExportedViewConstants, getNativeProps, getShadowNodeClass, measure, onDropViewInstance, receiveCommand, receiveCommand, setPadding, updateExtraData, updateProperties, updateState
      • Methods inherited from class com.facebook.react.bridge.BaseJavaModule

        canOverrideExistingModule, getConstants, hasConstants, initialize, invalidate, onCatalystInstanceDestroy
      • Methods inherited from class com.facebook.react.uimanager.BaseViewManagerInterface

        setAccessibilityActions, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLabelledBy, setAccessibilityLiveRegion, setAccessibilityRole, setBackgroundColor, setElevation, setImportantForAccessibility, setNativeId, setOpacity, setRenderToHardwareTexture, setRotation, setScaleX, setScaleY, setShadowColor, setTestId, setTransform, setTranslateX, setTranslateY, setViewState, setZIndex
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • updateExtraData

         void updateExtraData(ReactTextView view, Object extraData)

        Subclasses can implement this method to receive an optional extra data enqueued from thecorresponding instance of ReactShadowNode in .

        Since css layout step and ui updates can be executed in separate thread apart of settingx/y/width/height this is the recommended and thread-safe way of passing extra data from cssnode to the native view counterpart.

        TODO T7247021: Replace updateExtraData with generic update props mechanism after D2086999

      • needsCustomLayoutForChildren

         boolean needsCustomLayoutForChildren()

        Returns whether this View type needs to handle laying out its own children instead of deferringto the standard css-layout algorithm. Returns true for the layout to *not* be automaticallyinvoked. Instead onLayout will be invoked as normal and it is the View instance'sresponsibility to properly call layout on its children. Returns false for the default behaviorof automatically laying out children without going through the ViewGroup's onLayout method. Inthat case, onLayout for this View type must *not* call layout on its children.

      • getExportedCustomDirectEventTypeConstants

        @Nullable() Map getExportedCustomDirectEventTypeConstants()

        Returns a map of config data passed to JS that defines eligible events that can be placed onnative views. This should return non-bubbling directly-dispatched event types.

        Returned map should be of the form:

        {
          "onTwirl": {
            "registrationName": "onTwirl"
          }
        }
        
      • measure

         long measure(Context context, ReadableMap localData, ReadableMap props, ReadableMap state, float width, YogaMeasureMode widthMode, float height, YogaMeasureMode heightMode, @Nullable() Array<float> attachmentsPositions)

        Subclasses can override this method to implement custom measure functions for the ViewManager

        Parameters:
        context - com.facebook.react.bridge.ReactContext used for the view.
        localData - ReadableMap containing "local data" defined in C++
        props - ReadableMap containing JS props
        state - ReadableMap containing state defined in C++
        width - width of the view (usually zero)
        widthMode - widthMode used during calculation of layout
        height - height of the view (usually zero)
        heightMode - widthMode used during calculation of layout
        attachmentsPositions - array containing 2x times the amount of attachmentsof the view.
      • measure

         long measure(Context context, MapBuffer localData, MapBuffer props, @Nullable() MapBuffer state, float width, YogaMeasureMode widthMode, float height, YogaMeasureMode heightMode, @Nullable() Array<float> attachmentsPositions)

        THIS MEASURE METHOD IS EXPERIMENTAL, MOST LIKELY YOU ARE LOOKING TO USE THE OTHER OVERLOADINSTEAD: measure

        Subclasses can override this method to implement custom measure functions for theViewManager

        Parameters:
        context - com.facebook.react.bridge.ReactContext used for the view.
        localData - MapBuffer containing "local data" defined in C++
        props - MapBuffer containing JS props
        state - MapBuffer containing state defined in C++
        width - width of the view (usually zero)
        widthMode - widthMode used during calculation of layout
        height - height of the view (usually zero)
        heightMode - widthMode used during calculation of layout
        attachmentsPositions - array containing 2x times the amount of attachmentsof the view.
      • setPadding

         void setPadding(ReactTextView view, int left, int top, int right, int bottom)

        Subclasses can override this method to set padding for the given View in Fabric. Since not allcomponents support setting padding, the default implementation of this method does nothing.