Class Yoga

  • public class Yoga
    extends java.lang.Object
    Native bindings to Yoga.

    Yoga is an open-source, cross-platform layout library that implements Flexbox. Yoga’s focus is on creating an expressive layout library, not implementing all of CSS. Therefore, there are no plans to include support for tables, floats, or similar CSS concepts. Yoga also does not support styling properties that have no impact on layout, such as color or background properties.

    Yoga vs Flexbox

    Yoga aims to be compatible with Flexbox according to the w3 specification. However, Yoga was not developed to strictly adhere to the specification; thus, there are aspects where Yoga differs.

    Default values

    Yoga has chosen to change the default values of some properties to better fit mobile layout use cases. The following CSS block describes the differences in default values from the Flexbox w3 specification:

     div {
       box-sizing: border-box;
       position: relative;
       display: flex;
       flex-direction: column;
       align-items: stretch;
       flex-shrink: 0;
       align-content: flex-start;
       border-width: 0px;
       margin: 0px;
       padding: 0px;
       min-width: 0px;


    We believe that Right-to-Left (RTL) should be a first class citizen when it comes to layout. Therefore, Yoga implements non-standard RTL support for margin, padding, border, and position properties. This enables specifying these properties as start instead of left and end instead of right.

    Yoga-specific properties

    The goal of Yoga is to be a library which makes layout easy. Of course, implementing Flexbox, a common and well-liked system, helps meet this goal. However, there are areas where we think Yoga can evolve beyond Flexbox and provide developers with tools not included in the Flexbox w3 specification. Currently Yoga has added one such property, AspectRatio, to solve a common problem we saw in many UIs.

    • Method Detail

      • YGNodeNew

        public static long YGNodeNew()
      • nYGNodeNewWithConfig

        public static long nYGNodeNewWithConfig​(long config)
      • YGNodeNewWithConfig

        public static long YGNodeNewWithConfig​(long config)
      • nYGNodeClone

        public static long nYGNodeClone​(long node)
      • YGNodeClone

        public static long YGNodeClone​(long node)
      • nYGNodeFree

        public static void nYGNodeFree​(long node)
      • YGNodeFree

        public static void YGNodeFree​(long node)
      • nYGNodeFreeRecursiveWithCleanupFunc

        public static void nYGNodeFreeRecursiveWithCleanupFunc​(long node,
                                                               long cleanup)
      • YGNodeFreeRecursiveWithCleanupFunc

        public static void YGNodeFreeRecursiveWithCleanupFunc​(long node,
                                                              YGNodeCleanupFuncI cleanup)
      • nYGNodeFreeRecursive

        public static void nYGNodeFreeRecursive​(long node)
      • YGNodeFreeRecursive

        public static void YGNodeFreeRecursive​(long node)
      • nYGNodeReset

        public static void nYGNodeReset​(long node)
      • YGNodeReset

        public static void YGNodeReset​(long node)
      • nYGNodeInsertChild

        public static void nYGNodeInsertChild​(long node,
                                              long child,
                                              int index)
      • YGNodeInsertChild

        public static void YGNodeInsertChild​(long node,
                                             long child,
                                             int index)
      • nYGNodeRemoveChild

        public static void nYGNodeRemoveChild​(long node,
                                              long child)
      • YGNodeRemoveChild

        public static void YGNodeRemoveChild​(long node,
                                             long child)
      • nYGNodeRemoveAllChildren

        public static void nYGNodeRemoveAllChildren​(long node)
      • YGNodeRemoveAllChildren

        public static void YGNodeRemoveAllChildren​(long node)
      • nYGNodeGetChild

        public static long nYGNodeGetChild​(long node,
                                           int index)
      • YGNodeGetChild

        public static long YGNodeGetChild​(long node,
                                          int index)
      • nYGNodeGetOwner

        public static long nYGNodeGetOwner​(long node)
      • YGNodeGetOwner

        public static long YGNodeGetOwner​(long node)
      • nYGNodeGetParent

        public static long nYGNodeGetParent​(long node)
      • YGNodeGetParent

        public static long YGNodeGetParent​(long node)
      • nYGNodeGetChildCount

        public static int nYGNodeGetChildCount​(long node)
      • YGNodeGetChildCount

        public static int YGNodeGetChildCount​(long node)
      • nYGNodeSetChildren

        public static void nYGNodeSetChildren​(long owner,
                                              long children,
                                              int count)
      • YGNodeSetChildren

        public static void YGNodeSetChildren​(long owner,
                                             PointerBuffer children)
      • nYGNodeSetIsReferenceBaseline

        public static void nYGNodeSetIsReferenceBaseline​(long node,
                                                         boolean isReferenceBaseline)
      • YGNodeSetIsReferenceBaseline

        public static void YGNodeSetIsReferenceBaseline​(long node,
                                                        boolean isReferenceBaseline)
      • nYGNodeIsReferenceBaseline

        public static boolean nYGNodeIsReferenceBaseline​(long node)
      • YGNodeIsReferenceBaseline

        public static boolean YGNodeIsReferenceBaseline​(long node)
      • nYGNodeCalculateLayout

        public static void nYGNodeCalculateLayout​(long node,
                                                  float availableWidth,
                                                  float availableHeight,
                                                  int ownerDirection)
        Unsafe version of: NodeCalculateLayout
      • YGNodeCalculateLayout

        public static void YGNodeCalculateLayout​(long node,
                                                 float availableWidth,
                                                 float availableHeight,
                                                 int ownerDirection)
        ownerDirection - one of:
      • nYGNodeMarkDirty

        public static void nYGNodeMarkDirty​(long node)
        Unsafe version of: NodeMarkDirty
      • YGNodeMarkDirty

        public static void YGNodeMarkDirty​(long node)
        Marks a node as dirty.

        Only valid for nodes with a custom measure function set.

        Yoga knows when to mark all other nodes as dirty but because nodes with measure functions depend on information not known to Yoga they must perform this dirty marking manually.

      • YGNodeMarkDirtyAndPropogateToDescendants

        public static void YGNodeMarkDirtyAndPropogateToDescendants​(long node)
        Marks the current node and all its descendants as dirty.

        Intended to be used for Yoga benchmarks. Don't use in production, as calling NodeCalculateLayout will cause the recalculation of each and every node.

      • YGFloatIsUndefined

        public static boolean YGFloatIsUndefined​(float value)
      • nYGNodeCanUseCachedMeasurement

        public static boolean nYGNodeCanUseCachedMeasurement​(int widthMode,
                                                             float width,
                                                             int heightMode,
                                                             float height,
                                                             int lastWidthMode,
                                                             float lastWidth,
                                                             int lastHeightMode,
                                                             float lastHeight,
                                                             float lastComputedWidth,
                                                             float lastComputedHeight,
                                                             float marginRow,
                                                             float marginColumn,
                                                             long config)
        Unsafe version of: NodeCanUseCachedMeasurement
      • YGNodeCanUseCachedMeasurement

        public static boolean YGNodeCanUseCachedMeasurement​(int widthMode,
                                                            float width,
                                                            int heightMode,
                                                            float height,
                                                            int lastWidthMode,
                                                            float lastWidth,
                                                            int lastHeightMode,
                                                            float lastHeight,
                                                            float lastComputedWidth,
                                                            float lastComputedHeight,
                                                            float marginRow,
                                                            float marginColumn,
                                                            long config)
        widthMode - one of:
      • nYGNodeCopyStyle

        public static void nYGNodeCopyStyle​(long dstNode,
                                            long srcNode)
      • YGNodeCopyStyle

        public static void YGNodeCopyStyle​(long dstNode,
                                           long srcNode)
      • nYGNodeGetContext

        public static long nYGNodeGetContext​(long node)
      • YGNodeGetContext

        public static long YGNodeGetContext​(long node)
      • nYGNodeSetContext

        public static void nYGNodeSetContext​(long node,
                                             long context)
      • YGNodeSetContext

        public static void YGNodeSetContext​(long node,
                                            long context)
      • nYGConfigSetPrintTreeFlag

        public static void nYGConfigSetPrintTreeFlag​(long config,
                                                     boolean enabled)
      • YGConfigSetPrintTreeFlag

        public static void YGConfigSetPrintTreeFlag​(long config,
                                                    boolean enabled)
      • nYGNodeHasMeasureFunc

        public static boolean nYGNodeHasMeasureFunc​(long node)
      • YGNodeHasMeasureFunc

        public static boolean YGNodeHasMeasureFunc​(long node)
      • nYGNodeSetMeasureFunc

        public static void nYGNodeSetMeasureFunc​(long node,
                                                 long measureFunc)
      • YGNodeSetMeasureFunc

        public static void YGNodeSetMeasureFunc​(long node,
                                                YGMeasureFuncI measureFunc)
      • nYGNodeHasBaselineFunc

        public static boolean nYGNodeHasBaselineFunc​(long node)
      • YGNodeHasBaselineFunc

        public static boolean YGNodeHasBaselineFunc​(long node)
      • nYGNodeSetBaselineFunc

        public static void nYGNodeSetBaselineFunc​(long node,
                                                  long baselineFunc)
      • YGNodeSetBaselineFunc

        public static void YGNodeSetBaselineFunc​(long node,
                                                 YGBaselineFuncI baselineFunc)
      • nYGNodeGetDirtiedFunc

        public static long nYGNodeGetDirtiedFunc​(long node)
      • YGNodeGetDirtiedFunc

        public static YGDirtiedFunc YGNodeGetDirtiedFunc​(long node)
      • nYGNodeSetDirtiedFunc

        public static void nYGNodeSetDirtiedFunc​(long node,
                                                 long dirtiedFunc)
      • YGNodeSetDirtiedFunc

        public static void YGNodeSetDirtiedFunc​(long node,
                                                YGDirtiedFuncI dirtiedFunc)
      • nYGNodeSetPrintFunc

        public static void nYGNodeSetPrintFunc​(long node,
                                               long printFunc)
      • YGNodeSetPrintFunc

        public static void YGNodeSetPrintFunc​(long node,
                                              YGPrintFuncI printFunc)
      • nYGNodeGetHasNewLayout

        public static boolean nYGNodeGetHasNewLayout​(long node)
      • YGNodeGetHasNewLayout

        public static boolean YGNodeGetHasNewLayout​(long node)
      • nYGNodeSetHasNewLayout

        public static void nYGNodeSetHasNewLayout​(long node,
                                                  boolean hasNewLayout)
      • YGNodeSetHasNewLayout

        public static void YGNodeSetHasNewLayout​(long node,
                                                 boolean hasNewLayout)
      • nYGNodeGetNodeType

        public static int nYGNodeGetNodeType​(long node)
      • YGNodeGetNodeType

        public static int YGNodeGetNodeType​(long node)
      • nYGNodeSetNodeType

        public static void nYGNodeSetNodeType​(long node,
                                              int nodeType)
      • YGNodeSetNodeType

        public static void YGNodeSetNodeType​(long node,
                                             int nodeType)
      • nYGNodeIsDirty

        public static boolean nYGNodeIsDirty​(long node)
      • YGNodeIsDirty

        public static boolean YGNodeIsDirty​(long node)
      • nYGNodeLayoutGetDidUseLegacyFlag

        public static boolean nYGNodeLayoutGetDidUseLegacyFlag​(long node)
      • YGNodeLayoutGetDidUseLegacyFlag

        public static boolean YGNodeLayoutGetDidUseLegacyFlag​(long node)
      • nYGNodeStyleSetDirection

        public static void nYGNodeStyleSetDirection​(long node,
                                                    int direction)
        Unsafe version of: NodeStyleSetDirection
      • nYGNodeStyleGetDirection

        public static int nYGNodeStyleGetDirection​(long node)
      • YGNodeStyleGetDirection

        public static int YGNodeStyleGetDirection​(long node)
      • nYGNodeStyleSetFlexDirection

        public static void nYGNodeStyleSetFlexDirection​(long node,
                                                        int flexDirection)
        Unsafe version of: NodeStyleSetFlexDirection
      • nYGNodeStyleGetFlexDirection

        public static int nYGNodeStyleGetFlexDirection​(long node)
      • YGNodeStyleGetFlexDirection

        public static int YGNodeStyleGetFlexDirection​(long node)
      • nYGNodeStyleSetJustifyContent

        public static void nYGNodeStyleSetJustifyContent​(long node,
                                                         int justifyContent)
        Unsafe version of: NodeStyleSetJustifyContent
      • nYGNodeStyleGetJustifyContent

        public static int nYGNodeStyleGetJustifyContent​(long node)
      • YGNodeStyleGetJustifyContent

        public static int YGNodeStyleGetJustifyContent​(long node)
      • nYGNodeStyleSetAlignContent

        public static void nYGNodeStyleSetAlignContent​(long node,
                                                       int alignContent)
        Unsafe version of: NodeStyleSetAlignContent
      • nYGNodeStyleGetAlignContent

        public static int nYGNodeStyleGetAlignContent​(long node)
      • YGNodeStyleGetAlignContent

        public static int YGNodeStyleGetAlignContent​(long node)
      • nYGNodeStyleSetAlignItems

        public static void nYGNodeStyleSetAlignItems​(long node,
                                                     int alignItems)
        Unsafe version of: NodeStyleSetAlignItems
      • nYGNodeStyleGetAlignItems

        public static int nYGNodeStyleGetAlignItems​(long node)
      • YGNodeStyleGetAlignItems

        public static int YGNodeStyleGetAlignItems​(long node)
      • nYGNodeStyleSetAlignSelf

        public static void nYGNodeStyleSetAlignSelf​(long node,
                                                    int alignSelf)
        Unsafe version of: NodeStyleSetAlignSelf
      • nYGNodeStyleGetAlignSelf

        public static int nYGNodeStyleGetAlignSelf​(long node)
      • YGNodeStyleGetAlignSelf

        public static int YGNodeStyleGetAlignSelf​(long node)
      • nYGNodeStyleSetPositionType

        public static void nYGNodeStyleSetPositionType​(long node,
                                                       int positionType)
        Unsafe version of: NodeStyleSetPositionType
      • nYGNodeStyleGetPositionType

        public static int nYGNodeStyleGetPositionType​(long node)
      • YGNodeStyleGetPositionType

        public static int YGNodeStyleGetPositionType​(long node)
      • nYGNodeStyleSetFlexWrap

        public static void nYGNodeStyleSetFlexWrap​(long node,
                                                   int flexWrap)
        Unsafe version of: NodeStyleSetFlexWrap
      • YGNodeStyleSetFlexWrap

        public static void YGNodeStyleSetFlexWrap​(long node,
                                                  int flexWrap)
        flexWrap - one of:
      • nYGNodeStyleGetFlexWrap

        public static int nYGNodeStyleGetFlexWrap​(long node)
      • YGNodeStyleGetFlexWrap

        public static int YGNodeStyleGetFlexWrap​(long node)
      • nYGNodeStyleSetOverflow

        public static void nYGNodeStyleSetOverflow​(long node,
                                                   int overflow)
        Unsafe version of: NodeStyleSetOverflow
      • nYGNodeStyleGetOverflow

        public static int nYGNodeStyleGetOverflow​(long node)
      • YGNodeStyleGetOverflow

        public static int YGNodeStyleGetOverflow​(long node)
      • nYGNodeStyleSetDisplay

        public static void nYGNodeStyleSetDisplay​(long node,
                                                  int display)
        Unsafe version of: NodeStyleSetDisplay
      • YGNodeStyleSetDisplay

        public static void YGNodeStyleSetDisplay​(long node,
                                                 int display)
        display - one of:
      • nYGNodeStyleGetDisplay

        public static int nYGNodeStyleGetDisplay​(long node)
      • YGNodeStyleGetDisplay

        public static int YGNodeStyleGetDisplay​(long node)
      • nYGNodeStyleSetFlex

        public static void nYGNodeStyleSetFlex​(long node,
                                               float flex)
      • YGNodeStyleSetFlex

        public static void YGNodeStyleSetFlex​(long node,
                                              float flex)
      • nYGNodeStyleGetFlex

        public static float nYGNodeStyleGetFlex​(long node)
      • YGNodeStyleGetFlex

        public static float YGNodeStyleGetFlex​(long node)
      • nYGNodeStyleSetFlexGrow

        public static void nYGNodeStyleSetFlexGrow​(long node,
                                                   float flexGrow)
      • YGNodeStyleSetFlexGrow

        public static void YGNodeStyleSetFlexGrow​(long node,
                                                  float flexGrow)
      • nYGNodeStyleGetFlexGrow

        public static float nYGNodeStyleGetFlexGrow​(long node)
      • YGNodeStyleGetFlexGrow

        public static float YGNodeStyleGetFlexGrow​(long node)
      • nYGNodeStyleSetFlexShrink

        public static void nYGNodeStyleSetFlexShrink​(long node,
                                                     float flexShrink)
      • YGNodeStyleSetFlexShrink

        public static void YGNodeStyleSetFlexShrink​(long node,
                                                    float flexShrink)
      • nYGNodeStyleGetFlexShrink

        public static float nYGNodeStyleGetFlexShrink​(long node)
      • YGNodeStyleGetFlexShrink

        public static float YGNodeStyleGetFlexShrink​(long node)
      • nYGNodeStyleSetFlexBasis

        public static void nYGNodeStyleSetFlexBasis​(long node,
                                                    float flexBasis)
      • YGNodeStyleSetFlexBasis

        public static void YGNodeStyleSetFlexBasis​(long node,
                                                   float flexBasis)
      • nYGNodeStyleSetFlexBasisPercent

        public static void nYGNodeStyleSetFlexBasisPercent​(long node,
                                                           float flexBasis)
      • YGNodeStyleSetFlexBasisPercent

        public static void YGNodeStyleSetFlexBasisPercent​(long node,
                                                          float flexBasis)
      • nYGNodeStyleSetFlexBasisAuto

        public static void nYGNodeStyleSetFlexBasisAuto​(long node)
      • YGNodeStyleSetFlexBasisAuto

        public static void YGNodeStyleSetFlexBasisAuto​(long node)
      • nYGNodeStyleGetFlexBasis

        public static void nYGNodeStyleGetFlexBasis​(long node,
                                                    long __result)
      • YGNodeStyleGetFlexBasis

        public static YGValue YGNodeStyleGetFlexBasis​(long node,
                                                      YGValue __result)
      • nYGNodeStyleSetPosition

        public static void nYGNodeStyleSetPosition​(long node,
                                                   int edge,
                                                   float position)
        Unsafe version of: NodeStyleSetPosition
      • nYGNodeStyleSetPositionPercent

        public static void nYGNodeStyleSetPositionPercent​(long node,
                                                          int edge,
                                                          float position)
        Unsafe version of: NodeStyleSetPositionPercent
      • nYGNodeStyleGetPosition

        public static void nYGNodeStyleGetPosition​(long node,
                                                   int edge,
                                                   long __result)
        Unsafe version of: NodeStyleGetPosition
      • nYGNodeStyleSetMargin

        public static void nYGNodeStyleSetMargin​(long node,
                                                 int edge,
                                                 float margin)
        Unsafe version of: NodeStyleSetMargin
      • nYGNodeStyleSetMarginPercent

        public static void nYGNodeStyleSetMarginPercent​(long node,
                                                        int edge,
                                                        float margin)
        Unsafe version of: NodeStyleSetMarginPercent
      • nYGNodeStyleSetMarginAuto

        public static void nYGNodeStyleSetMarginAuto​(long node,
                                                     int edge)
        Unsafe version of: NodeStyleSetMarginAuto
      • nYGNodeStyleGetMargin

        public static void nYGNodeStyleGetMargin​(long node,
                                                 int edge,
                                                 long __result)
        Unsafe version of: NodeStyleGetMargin
      • nYGNodeStyleSetPadding

        public static void nYGNodeStyleSetPadding​(long node,
                                                  int edge,
                                                  float padding)
        Unsafe version of: NodeStyleSetPadding
      • nYGNodeStyleSetPaddingPercent

        public static void nYGNodeStyleSetPaddingPercent​(long node,
                                                         int edge,
                                                         float padding)
        Unsafe version of: NodeStyleSetPaddingPercent
      • nYGNodeStyleGetPadding

        public static void nYGNodeStyleGetPadding​(long node,
                                                  int edge,
                                                  long __result)
        Unsafe version of: NodeStyleGetPadding
      • nYGNodeStyleSetBorder

        public static void nYGNodeStyleSetBorder​(long node,
                                                 int edge,
                                                 float border)
        Unsafe version of: NodeStyleSetBorder
      • nYGNodeStyleGetBorder

        public static float nYGNodeStyleGetBorder​(long node,
                                                  int edge)
        Unsafe version of: NodeStyleGetBorder
      • nYGNodeStyleSetWidth

        public static void nYGNodeStyleSetWidth​(long node,
                                                float width)
      • YGNodeStyleSetWidth

        public static void YGNodeStyleSetWidth​(long node,
                                               float width)
      • nYGNodeStyleSetWidthPercent

        public static void nYGNodeStyleSetWidthPercent​(long node,
                                                       float width)
      • YGNodeStyleSetWidthPercent

        public static void YGNodeStyleSetWidthPercent​(long node,
                                                      float width)
      • nYGNodeStyleSetWidthAuto

        public static void nYGNodeStyleSetWidthAuto​(long node)
      • YGNodeStyleSetWidthAuto

        public static void YGNodeStyleSetWidthAuto​(long node)
      • nYGNodeStyleGetWidth

        public static void nYGNodeStyleGetWidth​(long node,
                                                long __result)
      • YGNodeStyleGetWidth

        public static YGValue YGNodeStyleGetWidth​(long node,
                                                  YGValue __result)
      • nYGNodeStyleSetHeight

        public static void nYGNodeStyleSetHeight​(long node,
                                                 float height)
      • YGNodeStyleSetHeight

        public static void YGNodeStyleSetHeight​(long node,
                                                float height)
      • nYGNodeStyleSetHeightPercent

        public static void nYGNodeStyleSetHeightPercent​(long node,
                                                        float height)
      • YGNodeStyleSetHeightPercent

        public static void YGNodeStyleSetHeightPercent​(long node,
                                                       float height)
      • nYGNodeStyleSetHeightAuto

        public static void nYGNodeStyleSetHeightAuto​(long node)
      • YGNodeStyleSetHeightAuto

        public static void YGNodeStyleSetHeightAuto​(long node)
      • nYGNodeStyleGetHeight

        public static void nYGNodeStyleGetHeight​(long node,
                                                 long __result)
      • YGNodeStyleGetHeight

        public static YGValue YGNodeStyleGetHeight​(long node,
                                                   YGValue __result)
      • nYGNodeStyleSetMinWidth

        public static void nYGNodeStyleSetMinWidth​(long node,
                                                   float minWidth)
      • YGNodeStyleSetMinWidth

        public static void YGNodeStyleSetMinWidth​(long node,
                                                  float minWidth)
      • nYGNodeStyleSetMinWidthPercent

        public static void nYGNodeStyleSetMinWidthPercent​(long node,
                                                          float minWidth)
      • YGNodeStyleSetMinWidthPercent

        public static void YGNodeStyleSetMinWidthPercent​(long node,
                                                         float minWidth)
      • nYGNodeStyleGetMinWidth

        public static void nYGNodeStyleGetMinWidth​(long node,
                                                   long __result)
      • YGNodeStyleGetMinWidth

        public static YGValue YGNodeStyleGetMinWidth​(long node,
                                                     YGValue __result)
      • nYGNodeStyleSetMinHeight

        public static void nYGNodeStyleSetMinHeight​(long node,
                                                    float minHeight)
      • YGNodeStyleSetMinHeight

        public static void YGNodeStyleSetMinHeight​(long node,
                                                   float minHeight)
      • nYGNodeStyleSetMinHeightPercent

        public static void nYGNodeStyleSetMinHeightPercent​(long node,
                                                           float minHeight)
      • YGNodeStyleSetMinHeightPercent

        public static void YGNodeStyleSetMinHeightPercent​(long node,
                                                          float minHeight)
      • nYGNodeStyleGetMinHeight

        public static void nYGNodeStyleGetMinHeight​(long node,
                                                    long __result)
      • YGNodeStyleGetMinHeight

        public static YGValue YGNodeStyleGetMinHeight​(long node,
                                                      YGValue __result)
      • nYGNodeStyleSetMaxWidth

        public static void nYGNodeStyleSetMaxWidth​(long node,
                                                   float maxWidth)
      • YGNodeStyleSetMaxWidth

        public static void YGNodeStyleSetMaxWidth​(long node,
                                                  float maxWidth)
      • nYGNodeStyleSetMaxWidthPercent

        public static void nYGNodeStyleSetMaxWidthPercent​(long node,
                                                          float maxWidth)
      • YGNodeStyleSetMaxWidthPercent

        public static void YGNodeStyleSetMaxWidthPercent​(long node,
                                                         float maxWidth)
      • nYGNodeStyleGetMaxWidth

        public static void nYGNodeStyleGetMaxWidth​(long node,
                                                   long __result)
      • YGNodeStyleGetMaxWidth

        public static YGValue YGNodeStyleGetMaxWidth​(long node,
                                                     YGValue __result)
      • nYGNodeStyleSetMaxHeight

        public static void nYGNodeStyleSetMaxHeight​(long node,
                                                    float maxHeight)
      • YGNodeStyleSetMaxHeight

        public static void YGNodeStyleSetMaxHeight​(long node,
                                                   float maxHeight)
      • nYGNodeStyleSetMaxHeightPercent

        public static void nYGNodeStyleSetMaxHeightPercent​(long node,
                                                           float maxHeight)
      • YGNodeStyleSetMaxHeightPercent

        public static void YGNodeStyleSetMaxHeightPercent​(long node,
                                                          float maxHeight)
      • nYGNodeStyleGetMaxHeight

        public static void nYGNodeStyleGetMaxHeight​(long node,
                                                    long __result)
      • YGNodeStyleGetMaxHeight

        public static YGValue YGNodeStyleGetMaxHeight​(long node,
                                                      YGValue __result)
      • nYGNodeStyleSetAspectRatio

        public static void nYGNodeStyleSetAspectRatio​(long node,
                                                      float aspectRatio)
        Unsafe version of: NodeStyleSetAspectRatio
      • YGNodeStyleSetAspectRatio

        public static void YGNodeStyleSetAspectRatio​(long node,
                                                     float aspectRatio)
        Aspect ratio controls the size of the undefined dimension of a node.

        Aspect ratio is encoded as a floating point value width/height. e.g. A value of 2 leads to a node with a width twice the size of its height while a value of 0.5 gives the opposite effect.

        • On a node with a set width/height aspect ratio controls the size of the unset dimension
        • On a node with a set flex basis aspect ratio controls the size of the node in the cross axis if unset
        • On a node with a measure function aspect ratio works as though the measure function measures the flex basis
        • On a node with flex grow/shrink aspect ratio controls the size of the node in the cross axis if unset
        • Aspect ratio takes min/max dimensions into account
      • nYGNodeStyleGetAspectRatio

        public static float nYGNodeStyleGetAspectRatio​(long node)
      • YGNodeStyleGetAspectRatio

        public static float YGNodeStyleGetAspectRatio​(long node)
      • nYGNodeLayoutGetLeft

        public static float nYGNodeLayoutGetLeft​(long node)
      • YGNodeLayoutGetLeft

        public static float YGNodeLayoutGetLeft​(long node)
      • nYGNodeLayoutGetTop

        public static float nYGNodeLayoutGetTop​(long node)
      • YGNodeLayoutGetTop

        public static float YGNodeLayoutGetTop​(long node)
      • nYGNodeLayoutGetRight

        public static float nYGNodeLayoutGetRight​(long node)
      • YGNodeLayoutGetRight

        public static float YGNodeLayoutGetRight​(long node)
      • nYGNodeLayoutGetBottom

        public static float nYGNodeLayoutGetBottom​(long node)
      • YGNodeLayoutGetBottom

        public static float YGNodeLayoutGetBottom​(long node)
      • nYGNodeLayoutGetWidth

        public static float nYGNodeLayoutGetWidth​(long node)
      • YGNodeLayoutGetWidth

        public static float YGNodeLayoutGetWidth​(long node)
      • nYGNodeLayoutGetHeight

        public static float nYGNodeLayoutGetHeight​(long node)
      • YGNodeLayoutGetHeight

        public static float YGNodeLayoutGetHeight​(long node)
      • nYGNodeLayoutGetDirection

        public static int nYGNodeLayoutGetDirection​(long node)
      • YGNodeLayoutGetDirection

        public static int YGNodeLayoutGetDirection​(long node)
      • nYGNodeLayoutGetHadOverflow

        public static boolean nYGNodeLayoutGetHadOverflow​(long node)
      • YGNodeLayoutGetHadOverflow

        public static boolean YGNodeLayoutGetHadOverflow​(long node)
      • nYGNodeLayoutGetDidLegacyStretchFlagAffectLayout

        public static boolean nYGNodeLayoutGetDidLegacyStretchFlagAffectLayout​(long node)
      • YGNodeLayoutGetDidLegacyStretchFlagAffectLayout

        public static boolean YGNodeLayoutGetDidLegacyStretchFlagAffectLayout​(long node)
      • nYGNodeLayoutGetMargin

        public static float nYGNodeLayoutGetMargin​(long node,
                                                   int edge)
        Unsafe version of: NodeLayoutGetMargin
      • YGNodeLayoutGetMargin

        public static float YGNodeLayoutGetMargin​(long node,
                                                  int edge)
        Gets the computed value for this nodes after performing layout. If they were set using point values then the returned value will be the same as YGNodeStyleGetMargin. However if they were set using a percentage value then the returned value is the computed value used during layout.
        edge - one of:
      • nYGNodeLayoutGetBorder

        public static float nYGNodeLayoutGetBorder​(long node,
                                                   int edge)
        Unsafe version of: NodeLayoutGetBorder
      • YGNodeLayoutGetBorder

        public static float YGNodeLayoutGetBorder​(long node,
                                                  int edge)
        Gets the computed value for this nodes after performing layout. If they were set using point values then the returned value will be the same as YGNodeStyleGetBorder. However if they were set using a percentage value then the returned value is the computed value used during layout.
        edge - one of:
      • nYGNodeLayoutGetPadding

        public static float nYGNodeLayoutGetPadding​(long node,
                                                    int edge)
        Unsafe version of: NodeLayoutGetPadding
      • YGNodeLayoutGetPadding

        public static float YGNodeLayoutGetPadding​(long node,
                                                   int edge)
        Gets the computed value for this nodes after performing layout. If they were set using point values then the returned value will be the same as YGNodeStyleGetPadding. However if they were set using a percentage value then the returned value is the computed value used during layout.
        edge - one of:
      • nYGConfigSetLogger

        public static void nYGConfigSetLogger​(long config,
                                              long logger)
      • YGConfigSetLogger

        public static void YGConfigSetLogger​(long config,
                                             YGLoggerI logger)
      • nYGAssert

        public static void nYGAssert​(boolean condition,
                                     long message)
      • YGAssert

        public static void YGAssert​(boolean condition,
                                    java.nio.ByteBuffer message)
      • YGAssert

        public static void YGAssert​(boolean condition,
                                    java.lang.CharSequence message)
      • nYGAssertWithNode

        public static void nYGAssertWithNode​(long node,
                                             boolean condition,
                                             long message)
      • YGAssertWithNode

        public static void YGAssertWithNode​(long node,
                                            boolean condition,
                                            java.nio.ByteBuffer message)
      • YGAssertWithNode

        public static void YGAssertWithNode​(long node,
                                            boolean condition,
                                            java.lang.CharSequence message)
      • nYGAssertWithConfig

        public static void nYGAssertWithConfig​(long config,
                                               boolean condition,
                                               long message)
      • YGAssertWithConfig

        public static void YGAssertWithConfig​(long config,
                                              boolean condition,
                                              java.nio.ByteBuffer message)
      • YGAssertWithConfig

        public static void YGAssertWithConfig​(long config,
                                              boolean condition,
                                              java.lang.CharSequence message)
      • nYGConfigSetPointScaleFactor

        public static void nYGConfigSetPointScaleFactor​(long config,
                                                        float pixelsInPoint)
        Unsafe version of: ConfigSetPointScaleFactor
      • YGConfigSetPointScaleFactor

        public static void YGConfigSetPointScaleFactor​(long config,
                                                       float pixelsInPoint)
        Set this to number of pixels in 1 point to round calculation results. If you want to avoid rounding set PointScaleFactor to 0.
      • nYGConfigSetShouldDiffLayoutWithoutLegacyStretchBehaviour

        public static void nYGConfigSetShouldDiffLayoutWithoutLegacyStretchBehaviour​(long config,
                                                                                     boolean shouldDiffLayout)
      • YGConfigSetShouldDiffLayoutWithoutLegacyStretchBehaviour

        public static void YGConfigSetShouldDiffLayoutWithoutLegacyStretchBehaviour​(long config,
                                                                                    boolean shouldDiffLayout)
      • nYGConfigSetUseLegacyStretchBehaviour

        public static void nYGConfigSetUseLegacyStretchBehaviour​(long config,
                                                                 boolean useLegacyStretchBehaviour)
      • YGConfigSetUseLegacyStretchBehaviour

        public static void YGConfigSetUseLegacyStretchBehaviour​(long config,
                                                                boolean useLegacyStretchBehaviour)
        Yoga previously had an error where containers would take the maximum space possible instead of the minimum like they are supposed to. In practice this resulted in implicit behaviour similar to align-self: stretch; Because this was such a long-standing bug we must allow legacy users to switch back to this behaviour.
      • YGConfigNew

        public static long YGConfigNew()
      • nYGConfigFree

        public static void nYGConfigFree​(long config)
      • YGConfigFree

        public static void YGConfigFree​(long config)
      • nYGConfigCopy

        public static void nYGConfigCopy​(long dest,
                                         long src)
      • YGConfigCopy

        public static void YGConfigCopy​(long dest,
                                        long src)
      • YGConfigGetInstanceCount

        public static int YGConfigGetInstanceCount()
      • nYGConfigSetExperimentalFeatureEnabled

        public static void nYGConfigSetExperimentalFeatureEnabled​(long config,
                                                                  int feature,
                                                                  boolean enabled)
      • YGConfigSetExperimentalFeatureEnabled

        public static void YGConfigSetExperimentalFeatureEnabled​(long config,
                                                                 int feature,
                                                                 boolean enabled)
        feature - must be:
      • nYGConfigIsExperimentalFeatureEnabled

        public static boolean nYGConfigIsExperimentalFeatureEnabled​(long config,
                                                                    int feature)
      • YGConfigIsExperimentalFeatureEnabled

        public static boolean YGConfigIsExperimentalFeatureEnabled​(long config,
                                                                   int feature)
        feature - must be:
      • nYGConfigSetUseWebDefaults

        public static void nYGConfigSetUseWebDefaults​(long config,
                                                      boolean enabled)
        Unsafe version of: ConfigSetUseWebDefaults
      • YGConfigSetUseWebDefaults

        public static void YGConfigSetUseWebDefaults​(long config,
                                                     boolean enabled)
        Using the web defaults is the preferred configuration for new projects. Usage of non web defaults should be considered as legacy.
      • nYGConfigGetUseWebDefaults

        public static boolean nYGConfigGetUseWebDefaults​(long config)
      • YGConfigGetUseWebDefaults

        public static boolean YGConfigGetUseWebDefaults​(long config)
      • nYGConfigSetCloneNodeFunc

        public static void nYGConfigSetCloneNodeFunc​(long config,
                                                     long callback)
      • YGConfigSetCloneNodeFunc

        public static void YGConfigSetCloneNodeFunc​(long config,
                                                    YGCloneNodeFuncI callback)
      • YGConfigGetDefault

        public static long YGConfigGetDefault()
      • nYGConfigSetContext

        public static void nYGConfigSetContext​(long config,
                                               long context)
      • YGConfigSetContext

        public static void YGConfigSetContext​(long config,
                                              long context)
      • nYGConfigGetContext

        public static long nYGConfigGetContext​(long config)
      • YGConfigGetContext

        public static long YGConfigGetContext​(long config)
      • YGRoundValueToPixelGrid

        public static float YGRoundValueToPixelGrid​(float value,
                                                    float pointScaleFactor,
                                                    boolean forceCeil,
                                                    boolean forceFloor)
      • nYGAlignToString

        public static long nYGAlignToString​(int value)
        Unsafe version of: AlignToString
      • nYGDimensionToString

        public static long nYGDimensionToString​(int value)
        Unsafe version of: DimensionToString
      • YGDimensionToString

        public static java.lang.String YGDimensionToString​(int value)
        value - one of:
      • nYGDirectionToString

        public static long nYGDirectionToString​(int value)
        Unsafe version of: DirectionToString
      • nYGDisplayToString

        public static long nYGDisplayToString​(int value)
        Unsafe version of: DisplayToString
      • YGDisplayToString

        public static java.lang.String YGDisplayToString​(int value)
        value - one of:
      • nYGEdgeToString

        public static long nYGEdgeToString​(int value)
        Unsafe version of: EdgeToString
      • nYGExperimentalFeatureToString

        public static long nYGExperimentalFeatureToString​(int value)
        Unsafe version of: ExperimentalFeatureToString
      • YGExperimentalFeatureToString

        public static java.lang.String YGExperimentalFeatureToString​(int value)
        value - must be:
      • nYGFlexDirectionToString

        public static long nYGFlexDirectionToString​(int value)
        Unsafe version of: FlexDirectionToString
      • nYGJustifyToString

        public static long nYGJustifyToString​(int value)
        Unsafe version of: JustifyToString
      • nYGLogLevelToString

        public static long nYGLogLevelToString​(int value)
        Unsafe version of: LogLevelToString
      • nYGMeasureModeToString

        public static long nYGMeasureModeToString​(int value)
        Unsafe version of: MeasureModeToString
      • nYGNodeTypeToString

        public static long nYGNodeTypeToString​(int value)
        Unsafe version of: NodeTypeToString
      • YGNodeTypeToString

        public static java.lang.String YGNodeTypeToString​(int value)
        value - one of:
      • nYGOverflowToString

        public static long nYGOverflowToString​(int value)
        Unsafe version of: OverflowToString
      • nYGPositionTypeToString

        public static long nYGPositionTypeToString​(int value)
        Unsafe version of: PositionTypeToString
      • nYGUnitToString

        public static long nYGUnitToString​(int value)
        Unsafe version of: UnitToString
      • nYGWrapToString

        public static long nYGWrapToString​(int value)
        Unsafe version of: WrapToString