Class FlexboxLayout.LayoutParams

  • Enclosing class:
    FlexboxLayout

    public static class FlexboxLayout.LayoutParams
    extends android.view.ViewGroup.MarginLayoutParams
    Per child parameters for children views of the FlexboxLayout.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int ALIGN_SELF_AUTO  
      static int ALIGN_SELF_BASELINE  
      static int ALIGN_SELF_CENTER  
      static int ALIGN_SELF_FLEX_END  
      static int ALIGN_SELF_FLEX_START  
      static int ALIGN_SELF_STRETCH  
      int alignSelf
      This attributes determines the alignment along the cross axis (perpendicular to the main axis).
      static float FLEX_BASIS_PERCENT_DEFAULT  
      float flexBasisPercent
      The initial flex item length in a fraction format relative to its parent.
      float flexGrow
      This attribute determines how much this child will grow if positive free space is distributed relative to the rest of other flex items included in the same flex line.
      float flexShrink
      This attributes determines how much this child will shrink is negative free space is distributed relative to the rest of other flex items included in the same flex line.
      int maxHeight
      This attribute determines the maximum height the child can expand to.
      int maxWidth
      This attribute determines the maximum width the child can expand to.
      int minHeight
      This attribute determines the minimum height the child can shrink to.
      int minWidth
      This attribute determines the minimum width the child can shrink to.
      int order
      This attribute can change the ordering of the children views are laid out.
      boolean wrapBefore
      This attribute forces a flex line wrapping.
      • Fields inherited from class android.view.ViewGroup.MarginLayoutParams

        bottomMargin, leftMargin, rightMargin, topMargin
      • Fields inherited from class android.view.ViewGroup.LayoutParams

        FILL_PARENT, height, layoutAnimationParameters, MATCH_PARENT, width, WRAP_CONTENT
    • Method Summary

      • Methods inherited from class android.view.ViewGroup.MarginLayoutParams

        getLayoutDirection, getMarginEnd, getMarginStart, isMarginRelative, resolveLayoutDirection, setLayoutDirection, setMarginEnd, setMargins, setMarginStart
      • Methods inherited from class android.view.ViewGroup.LayoutParams

        setBaseAttributes
      • Methods inherited from class java.lang.Object

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

      • FLEX_BASIS_PERCENT_DEFAULT

        public static final float FLEX_BASIS_PERCENT_DEFAULT
        See Also:
        Constant Field Values
      • order

        public int order
        This attribute can change the ordering of the children views are laid out. By default, children are displayed and laid out in the same order as they appear in the layout XML. If not specified, ORDER_DEFAULT is set as a default value.
      • flexGrow

        public float flexGrow
        This attribute determines how much this child will grow if positive free space is distributed relative to the rest of other flex items included in the same flex line. If not specified, FLEX_GROW_DEFAULT is set as a default value.
      • flexShrink

        public float flexShrink
        This attributes determines how much this child will shrink is negative free space is distributed relative to the rest of other flex items included in the same flex line. If not specified, FLEX_SHRINK_DEFAULT is set as a default value.
      • flexBasisPercent

        public float flexBasisPercent
        The initial flex item length in a fraction format relative to its parent. The initial main size of this child View is trying to be expanded as the specified fraction against the parent main size. If this value is set, the length specified from layout_width (or layout_height) is overridden by the calculated value from this attribute. This attribute is only effective when the parent's MeasureSpec mode is MeasureSpec.EXACTLY. The default value is FLEX_BASIS_PERCENT_DEFAULT, which means not set.
      • minWidth

        public int minWidth
        This attribute determines the minimum width the child can shrink to.
      • minHeight

        public int minHeight
        This attribute determines the minimum height the child can shrink to.
      • maxWidth

        public int maxWidth
        This attribute determines the maximum width the child can expand to.
      • maxHeight

        public int maxHeight
        This attribute determines the maximum height the child can expand to.
      • wrapBefore

        public boolean wrapBefore
        This attribute forces a flex line wrapping. i.e. if this is set to true for a flex item, the item will become the first item of the new flex line. (A wrapping happens regardless of the flex items being processed in the the previous flex line) This attribute is ignored if the flex_wrap attribute is set as nowrap. The equivalent attribute isn't defined in the original CSS Flexible Box Module specification, but having this attribute is useful for Android developers to flatten the layouts when building a grid like layout or for a situation where developers want to put a new flex line to make a semantic difference from the previous one, etc.
    • Constructor Detail

      • LayoutParams

        public LayoutParams​(android.content.Context context,
                            android.util.AttributeSet attrs)
      • LayoutParams

        public LayoutParams​(android.view.ViewGroup.LayoutParams source)
      • LayoutParams

        public LayoutParams​(int width,
                            int height)