Class FlexboxLayoutManager.LayoutParams

  • All Implemented Interfaces:
    android.os.Parcelable , com.pointrlabs.core.util.flexbox.FlexItem

    
    public class FlexboxLayoutManager.LayoutParams
    extends RecyclerView.LayoutParams implements FlexItem
                        

    LayoutParams used by the FlexboxLayoutManager, which stores per-child information required for the Flexbox. Note that some parent fields (which are not primitive nor a class implements Parcelable) are not included as the stored/restored fields after this class is serialized/de-serialized as an Parcelable.

    • Method Detail

      • getWidth

         int getWidth()
        Returns:

        the width attribute of the flex item. The attribute is about how wide the view wants to be. Can be one of the constants MATCH_PARENT(-1) or WRAP_CONTENT(-2), or an exact size.

      • setWidth

         void setWidth(int width)

        Sets the width attribute of the flex item.

        Parameters:
        width - the width attribute.
      • getHeight

         int getHeight()
        Returns:

        the height attribute of the flex item. The attribute is about how wide the view wants to be. Can be one of the constants MATCH_PARENT(-1) or WRAP_CONTENT(-2), or an exact size.

      • setHeight

         void setHeight(int height)

        Sets the height attribute of the flex item.

        Parameters:
        height - the height attribute.
      • getFlexGrow

         float getFlexGrow()
        Returns:

        the flex grow attribute of the flex item The 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.

      • setFlexGrow

         void setFlexGrow(float flexGrow)

        Sets the flex grow attribute to the flex item

        Parameters:
        flexGrow - the flex grow attribute
      • getFlexShrink

         float getFlexShrink()
        Returns:

        the flex shrink attribute of the flex item The attribute determines how much this child will shrink if 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.

      • setFlexShrink

         void setFlexShrink(float flexShrink)

        Sets the flex shrink attribute to the flex item

        Parameters:
        flexShrink - the flex shrink attribute
      • setAlignSelf

         void setAlignSelf(int alignSelf)

        Sets the align self attribute to the flex item

        Parameters:
        alignSelf - the order attribute
      • getMinWidth

         int getMinWidth()
        Returns:

        the minimum width attribute of the flex item The attribute determines the minimum width the child can shrink to.

      • setMinWidth

         void setMinWidth(int minWidth)

        Sets the minimum width attribute to the flex item

        Parameters:
        minWidth - the order attribute
      • getMinHeight

         int getMinHeight()
        Returns:

        the minimum height attribute of the flex item The attribute determines the minimum height the child can shrink to.

      • setMinHeight

         void setMinHeight(int minHeight)

        Sets the minimum height attribute to the flex item

        Parameters:
        minHeight - the order attribute
      • getMaxWidth

         int getMaxWidth()
        Returns:

        the maximum width attribute of the flex item The attribute determines the maximum width the child can expand to.

      • setMaxWidth

         void setMaxWidth(int maxWidth)

        Sets the maximum width attribute to the flex item

        Parameters:
        maxWidth - the order attribute
      • getMaxHeight

         int getMaxHeight()
        Returns:

        the maximum height attribute of the flex item

      • setMaxHeight

         void setMaxHeight(int maxHeight)

        Sets the maximum height attribute to the flex item

        Parameters:
        maxHeight - the order attribute
      • isWrapBefore

         boolean isWrapBefore()
        Returns:

        the wrapBefore attribute of the flex item The 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.

      • setWrapBefore

         void setWrapBefore(boolean wrapBefore)

        Sets the wrapBefore attribute to the flex item

        Parameters:
        wrapBefore - the order attribute
      • getFlexBasisPercent

         float getFlexBasisPercent()
        Returns:

        the flexBasisPercent attribute of the flex item The attribute determines 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 de

      • setFlexBasisPercent

         void setFlexBasisPercent(float flexBasisPercent)

        Sets the flex basis percent attribute to the flex item

        Parameters:
        flexBasisPercent - the order attribute
      • getMarginLeft

         int getMarginLeft()
        Returns:

        the left margin of the flex item.

      • getMarginTop

         int getMarginTop()
        Returns:

        the top margin of the flex item.

      • getMarginRight

         int getMarginRight()
        Returns:

        the right margin of the flex item.

      • getMarginBottom

         int getMarginBottom()
        Returns:

        the bottom margin of the flex item.

      • getOrder

         int getOrder()
        Returns:

        the order attribute of the flex item. The 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.

      • setOrder

         void setOrder(int order)

        Sets the order attribute to the flex item

        Parameters:
        order - the order attribute