ReactShadowNode

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 ReactShadowNode 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 ReactShadowNode or custom subclass of it if necessary.

The primary use-case for ReactShadowNode 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

Functions

Link copied to clipboard
abstract fun addChildAt(child: T, i: Int)
Link copied to clipboard
abstract fun addNativeChildAt(child: T, 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
abstract fun calculateLayout()
abstract fun calculateLayout(width: Float, height: Float)
Link copied to clipboard
Link copied to clipboard
abstract fun dirty()
Link copied to clipboard
abstract fun dispatchUpdates(absoluteX: Float, absoluteY: Float, uiViewOperationQueue: UIViewOperationQueue, nativeViewHierarchyOptimizer: NativeViewHierarchyOptimizer)
Link copied to clipboard
abstract fun dispatchUpdatesWillChangeLayout(absoluteX: Float, absoluteY: Float): Boolean
Link copied to clipboard
abstract fun dispose()
Link copied to clipboard
abstract fun getChildAt(i: Int): T
Link copied to clipboard
abstract fun getChildCount(): Int
Link copied to clipboard
abstract fun getFlex(): Float
Link copied to clipboard
Link copied to clipboard
abstract fun getHierarchyInfo(): String
Link copied to clipboard
Link copied to clipboard
abstract fun getLayoutHeight(): Float
Link copied to clipboard
abstract fun getLayoutParent(): T
Link copied to clipboard
abstract fun getLayoutWidth(): Float
Link copied to clipboard
abstract fun getLayoutX(): Float
Link copied to clipboard
abstract fun getLayoutY(): Float
Link copied to clipboard
abstract fun getNativeChildCount(): Int
Link copied to clipboard
abstract fun getNativeKind(): NativeKind
Link copied to clipboard
abstract fun getNativeOffsetForChild(child: T): Int
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
abstract fun getNativeParent(): T
Link copied to clipboard
abstract fun getPadding(spacingType: Int): Float
Link copied to clipboard
abstract fun getParent(): T
Link copied to clipboard
abstract fun getReactTag(): Int
Link copied to clipboard
abstract fun getRootTag(): Int
Link copied to clipboard
abstract fun getScreenHeight(): Int
Link copied to clipboard
abstract fun getScreenWidth(): Int
Link copied to clipboard
abstract fun getScreenX(): Int
Link copied to clipboard
abstract fun getScreenY(): Int
Link copied to clipboard
abstract fun getStyleHeight(): YogaValue
Link copied to clipboard
abstract fun getStylePadding(spacingType: Int): YogaValue
Link copied to clipboard
abstract fun getStyleWidth(): YogaValue
Link copied to clipboard
Get the ThemedReactContext associated with this ReactShadowNode.
Link copied to clipboard
abstract fun getTotalNativeChildren(): Int
Link copied to clipboard
abstract fun getViewClass(): String
Link copied to clipboard
Link copied to clipboard
abstract fun hasNewLayout(): Boolean
Link copied to clipboard
abstract fun hasUnseenUpdates(): Boolean
Link copied to clipboard
abstract fun hasUpdates(): Boolean
Link copied to clipboard
When constructing the native tree, nodes that return true will be treated as leaves.
Link copied to clipboard
abstract fun indexOf(child: T): Int
Link copied to clipboard
abstract fun indexOfNativeChild(nativeChild: T): Int
Link copied to clipboard
abstract fun isDescendantOf(ancestorNode: T): Boolean
Link copied to clipboard
abstract fun isDirty(): Boolean
Link copied to clipboard
abstract fun isLayoutOnly(): Boolean
Link copied to clipboard
abstract fun isMeasureDefined(): Boolean
Link copied to clipboard
abstract fun isVirtual(): Boolean
Nodes that return true will be treated as "virtual" nodes.
Link copied to clipboard
abstract fun isVirtualAnchor(): Boolean
Nodes that return true will be treated as a root view for the virtual nodes tree.
Link copied to clipboard
abstract fun isYogaLeafNode(): Boolean
Nodes that return true will not manage (and and remove) child Yoga nodes.
Link copied to clipboard
abstract fun markLayoutSeen()
Link copied to clipboard
abstract fun markUpdated()
Link copied to clipboard
abstract fun markUpdateSeen()
Link copied to clipboard
Link copied to clipboard
abstract fun onBeforeLayout(nativeViewHierarchyOptimizer: NativeViewHierarchyOptimizer)
This method will be called by UIManagerModule once per batch, before calculating layout.
Link copied to clipboard
abstract 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
abstract fun removeChildAt(i: Int): T
Link copied to clipboard
abstract fun removeNativeChildAt(i: Int): T
Link copied to clipboard
abstract fun setAlignContent(alignContent: YogaAlign)
Link copied to clipboard
abstract fun setAlignItems(alignItems: YogaAlign)
Link copied to clipboard
abstract fun setAlignSelf(alignSelf: YogaAlign)
Link copied to clipboard
abstract fun setBaselineFunction(baselineFunction: YogaBaselineFunction)
Link copied to clipboard
abstract fun setBorder(spacingType: Int, borderWidth: Float)
Link copied to clipboard
abstract fun setColumnGap(columnGap: Float)
Link copied to clipboard
abstract fun setColumnGapPercent(percent: Float)
Link copied to clipboard
abstract fun setDefaultPadding(spacingType: Int, padding: Float)
Link copied to clipboard
abstract fun setDisplay(display: YogaDisplay)
Link copied to clipboard
abstract fun setFlex(flex: Float)
Link copied to clipboard
abstract fun setFlexBasis(flexBasis: Float)
Link copied to clipboard
abstract fun setFlexBasisAuto()
Link copied to clipboard
abstract fun setFlexBasisPercent(percent: Float)
Link copied to clipboard
abstract fun setFlexDirection(flexDirection: YogaFlexDirection)
Link copied to clipboard
abstract fun setFlexGrow(flexGrow: Float)
Link copied to clipboard
abstract fun setFlexShrink(flexShrink: Float)
Link copied to clipboard
abstract fun setFlexWrap(wrap: YogaWrap)
Link copied to clipboard
abstract fun setGap(gap: Float)
Link copied to clipboard
abstract fun setGapPercent(percent: Float)
Link copied to clipboard
abstract 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
abstract fun setJustifyContent(justifyContent: YogaJustify)
Link copied to clipboard
abstract fun setLayoutDirection(direction: YogaDirection)
Link copied to clipboard
abstract fun setLayoutParent(@Nullable layoutParent: T)
Link copied to clipboard
abstract fun setLocalData(data: Any)
Link copied to clipboard
abstract fun setMargin(spacingType: Int, margin: Float)
Link copied to clipboard
abstract fun setMarginAuto(spacingType: Int)
Link copied to clipboard
abstract fun setMarginPercent(spacingType: Int, percent: Float)
Link copied to clipboard
abstract fun setMeasureFunction(measureFunction: YogaMeasureFunction)
Link copied to clipboard
abstract fun setMeasureSpecs(widthMeasureSpec: Int, heightMeasureSpec: Int)
Link copied to clipboard
abstract fun setOverflow(overflow: YogaOverflow)
Link copied to clipboard
abstract fun setPadding(spacingType: Int, padding: Float)
Link copied to clipboard
abstract fun setPaddingPercent(spacingType: Int, percent: Float)
Link copied to clipboard
abstract fun setPosition(spacingType: Int, position: Float)
Link copied to clipboard
abstract fun setPositionPercent(spacingType: Int, percent: Float)
Link copied to clipboard
abstract fun setPositionType(positionType: YogaPositionType)
Link copied to clipboard
abstract fun setReactTag(reactTag: Int)
Link copied to clipboard
abstract fun setRootTag(rootTag: Int)
Link copied to clipboard
abstract fun setRowGap(rowGap: Float)
Link copied to clipboard
abstract fun setRowGapPercent(percent: Float)
Link copied to clipboard
abstract fun setShouldNotifyOnLayout(shouldNotifyOnLayout: Boolean)
Link copied to clipboard
abstract fun setStyleAspectRatio(aspectRatio: Float)
Link copied to clipboard
abstract fun setStyleHeight(heightPx: Float)
Link copied to clipboard
abstract fun setStyleHeightAuto()
Link copied to clipboard
abstract fun setStyleHeightPercent(percent: Float)
Link copied to clipboard
abstract fun setStyleMaxHeight(widthPx: Float)
Link copied to clipboard
abstract fun setStyleMaxHeightPercent(percent: Float)
Link copied to clipboard
abstract fun setStyleMaxWidth(widthPx: Float)
Link copied to clipboard
abstract fun setStyleMaxWidthPercent(percent: Float)
Link copied to clipboard
abstract fun setStyleMinHeight(widthPx: Float)
Link copied to clipboard
abstract fun setStyleMinHeightPercent(percent: Float)
Link copied to clipboard
abstract fun setStyleMinWidth(widthPx: Float)
Link copied to clipboard
abstract fun setStyleMinWidthPercent(percent: Float)
Link copied to clipboard
abstract fun setStyleWidth(widthPx: Float)
Link copied to clipboard
abstract fun setStyleWidthAuto()
Link copied to clipboard
abstract fun setStyleWidthPercent(percent: Float)
Link copied to clipboard
abstract fun setThemedContext(themedContext: ThemedReactContext)
Link copied to clipboard
abstract fun setViewClassName(viewClassName: String)
Link copied to clipboard
Link copied to clipboard