ReactShadowNodeImpl

Base node class for representing virtual tree of React nodes. Shadow nodes are used primarily for layouting therefore it extends YogaNode to allow that. They also help with handling Common base subclass of YogaNode for all layout nodes for react-based view. It extends YogaNode by adding additional capabilities.

Instances of this class receive property updates from JS via @{link UIManagerModule}. Subclasses may use updateShadowNode to persist some of the updated fields in the node instance that corresponds to a particular view type.

Subclasses of ReactShadowNodeImpl should be created only from ViewManager that corresponds to a certain type of native view. They will be updated and accessed only from JS thread. Subclasses of ViewManager may choose to use base class or custom subclass of it if necessary.

The primary use-case for ReactShadowNodeImpl nodes is to calculate layouting. Although this might be extended. For some examples please refer to ARTGroupYogaNode or ReactTextYogaNode.

This class allows for the native view hierarchy to not be an exact copy of the hierarchy received from JS by keeping track of both JS children (e.g. getChildCount and separately native children (e.g. getNativeChildCount). See for more information.

Inheritors

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open fun addChildAt(child: ReactShadowNodeImpl, i: Int)
Link copied to clipboard
fun addNativeChildAt(child: ReactShadowNodeImpl, nativeIndex: Int)
Adds a child that the native view hierarchy will have at this index in the native view corresponding to this node.
Link copied to clipboard
open fun calculateLayout()
open fun calculateLayout(width: Float, height: Float)
Link copied to clipboard
open fun dirty()
Link copied to clipboard
open fun dispatchUpdates(absoluteX: Float, absoluteY: Float, uiViewOperationQueue: UIViewOperationQueue, @Nullable nativeViewHierarchyOptimizer: NativeViewHierarchyOptimizer)
Link copied to clipboard
open fun dispatchUpdatesWillChangeLayout(absoluteX: Float, absoluteY: Float): Boolean
Link copied to clipboard
open fun dispose()
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun getFlex(): Float
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun getNativeKind(): NativeKind
Link copied to clipboard
Returns the offset within the native children owned by all layout-only nodes in the subtree rooted at this node for the given child.
Link copied to clipboard
fun getPadding(spacingType: Int): Float
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun getScreenHeight(): Int
Link copied to clipboard
open fun getScreenWidth(): Int
Link copied to clipboard
open fun getScreenX(): Int
Link copied to clipboard
open fun getScreenY(): Int
Link copied to clipboard
Link copied to clipboard
fun getStylePadding(spacingType: Int): YogaValue
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
When constructing the native tree, nodes that return true will be treated as leaves.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun isDescendantOf(ancestorNode: ReactShadowNodeImpl): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun isVirtual(): Boolean
Nodes that return true will be treated as "virtual" nodes.
Link copied to clipboard
Nodes that return true will be treated as a root view for the virtual nodes tree.
Link copied to clipboard
Nodes that return true will not manage (and and remove) child Yoga nodes.
Link copied to clipboard
Link copied to clipboard
open fun markUpdated()
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun onBeforeLayout(nativeViewHierarchyOptimizer: NativeViewHierarchyOptimizer)
This method will be called by UIManagerModule once per batch, before calculating layout.
Link copied to clipboard
open fun onCollectExtraUpdates(uiViewOperationQueue: UIViewOperationQueue)
Called after layout step at the end of the UI batch from UIManagerModule.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun setAlignContent(alignContent: YogaAlign)
Link copied to clipboard
open fun setAlignItems(alignItems: YogaAlign)
Link copied to clipboard
open fun setAlignSelf(alignSelf: YogaAlign)
Link copied to clipboard
open fun setBaselineFunction(baselineFunction: YogaBaselineFunction)
Link copied to clipboard
open fun setBorder(spacingType: Int, borderWidth: Float)
Link copied to clipboard
open fun setColumnGap(columnGap: Float)
Link copied to clipboard
open fun setColumnGapPercent(percent: Float)
Link copied to clipboard
open fun setDefaultPadding(spacingType: Int, padding: Float)
Link copied to clipboard
open fun setDisplay(display: YogaDisplay)
Link copied to clipboard
open fun setFlex(flex: Float)
Link copied to clipboard
open fun setFlexBasis(flexBasis: Float)
Link copied to clipboard
open fun setFlexBasisAuto()
Link copied to clipboard
open fun setFlexBasisPercent(percent: Float)
Link copied to clipboard
open fun setFlexDirection(flexDirection: YogaFlexDirection)
Link copied to clipboard
open fun setFlexGrow(flexGrow: Float)
Link copied to clipboard
open fun setFlexShrink(flexShrink: Float)
Link copied to clipboard
open fun setFlexWrap(wrap: YogaWrap)
Link copied to clipboard
open fun setGap(gap: Float)
Link copied to clipboard
open fun setGapPercent(percent: Float)
Link copied to clipboard
fun setIsLayoutOnly(isLayoutOnly: Boolean)
Sets whether this node only contributes to the layout of its children without doing any drawing or functionality itself.
Link copied to clipboard
open fun setJustifyContent(justifyContent: YogaJustify)
Link copied to clipboard
open fun setLayoutDirection(direction: YogaDirection)
Link copied to clipboard
Link copied to clipboard
open fun setLocalData(data: Any)
Link copied to clipboard
open fun setMargin(spacingType: Int, margin: Float)
Link copied to clipboard
open fun setMarginAuto(spacingType: Int)
Link copied to clipboard
open fun setMarginPercent(spacingType: Int, percent: Float)
Link copied to clipboard
open fun setMeasureFunction(measureFunction: YogaMeasureFunction)
Link copied to clipboard
open fun setMeasureSpecs(widthMeasureSpec: Int, heightMeasureSpec: Int)
Link copied to clipboard
open fun setOverflow(overflow: YogaOverflow)
Link copied to clipboard
open fun setPadding(spacingType: Int, padding: Float)
Link copied to clipboard
open fun setPaddingPercent(spacingType: Int, percent: Float)
Link copied to clipboard
open fun setPosition(spacingType: Int, position: Float)
Link copied to clipboard
open fun setPositionPercent(spacingType: Int, percent: Float)
Link copied to clipboard
open fun setPositionType(positionType: YogaPositionType)
Link copied to clipboard
open fun setReactTag(reactTag: Int)
Link copied to clipboard
fun setRootTag(rootTag: Int)
Link copied to clipboard
open fun setRowGap(rowGap: Float)
Link copied to clipboard
open fun setRowGapPercent(percent: Float)
Link copied to clipboard
open fun setShouldNotifyOnLayout(shouldNotifyOnLayout: Boolean)
Link copied to clipboard
open fun setStyleAspectRatio(aspectRatio: Float)
Link copied to clipboard
open fun setStyleHeight(heightPx: Float)
Link copied to clipboard
Link copied to clipboard
open fun setStyleHeightPercent(percent: Float)
Link copied to clipboard
open fun setStyleMaxHeight(widthPx: Float)
Link copied to clipboard
open fun setStyleMaxHeightPercent(percent: Float)
Link copied to clipboard
open fun setStyleMaxWidth(widthPx: Float)
Link copied to clipboard
open fun setStyleMaxWidthPercent(percent: Float)
Link copied to clipboard
open fun setStyleMinHeight(widthPx: Float)
Link copied to clipboard
open fun setStyleMinHeightPercent(percent: Float)
Link copied to clipboard
open fun setStyleMinWidth(widthPx: Float)
Link copied to clipboard
open fun setStyleMinWidthPercent(percent: Float)
Link copied to clipboard
open fun setStyleWidth(widthPx: Float)
Link copied to clipboard
Link copied to clipboard
open fun setStyleWidthPercent(percent: Float)
Link copied to clipboard
open fun setThemedContext(themedContext: ThemedReactContext)
Link copied to clipboard
fun setViewClassName(viewClassName: String)
Link copied to clipboard
Link copied to clipboard
open fun toString(): String
Link copied to clipboard