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.
-
-
Field Summary
Fields Modifier and Type Field Description public final static Parcelable.Creator<FlexboxLayoutManager.LayoutParams>
CREATOR
public final static int
ORDER_DEFAULT
public final static float
FLEX_GROW_DEFAULT
public final static float
FLEX_SHRINK_DEFAULT
public final static float
FLEX_BASIS_PERCENT_DEFAULT
public final static int
MAX_SIZE
public int
bottomMargin
public int
leftMargin
public int
rightMargin
public int
topMargin
public final static int
FILL_PARENT
public final static int
MATCH_PARENT
public final static int
WRAP_CONTENT
public int
height
public LayoutAnimationController.AnimationParameters
layoutAnimationParameters
public int
width
public final static int
CONTENTS_FILE_DESCRIPTOR
public final static int
PARCELABLE_WRITE_RETURN_VALUE
-
Constructor Summary
Constructors Constructor Description FlexboxLayoutManager.LayoutParams(Context c, AttributeSet attrs)
FlexboxLayoutManager.LayoutParams(int width, int height)
FlexboxLayoutManager.LayoutParams(ViewGroup.MarginLayoutParams source)
FlexboxLayoutManager.LayoutParams(ViewGroup.LayoutParams source)
FlexboxLayoutManager.LayoutParams(RecyclerView.LayoutParams source)
FlexboxLayoutManager.LayoutParams(FlexboxLayoutManager.LayoutParams source)
-
Method Summary
Modifier and Type Method Description int
getWidth()
void
setWidth(int width)
Sets the width attribute of the flex item. int
getHeight()
void
setHeight(int height)
Sets the height attribute of the flex item. float
getFlexGrow()
void
setFlexGrow(float flexGrow)
Sets the flex grow attribute to the flex item float
getFlexShrink()
void
setFlexShrink(float flexShrink)
Sets the flex shrink attribute to the flex item int
getAlignSelf()
void
setAlignSelf(int alignSelf)
Sets the align self attribute to the flex item int
getMinWidth()
void
setMinWidth(int minWidth)
Sets the minimum width attribute to the flex item int
getMinHeight()
void
setMinHeight(int minHeight)
Sets the minimum height attribute to the flex item int
getMaxWidth()
void
setMaxWidth(int maxWidth)
Sets the maximum width attribute to the flex item int
getMaxHeight()
void
setMaxHeight(int maxHeight)
Sets the maximum height attribute to the flex item boolean
isWrapBefore()
void
setWrapBefore(boolean wrapBefore)
Sets the wrapBefore attribute to the flex item float
getFlexBasisPercent()
void
setFlexBasisPercent(float flexBasisPercent)
Sets the flex basis percent attribute to the flex item int
getMarginLeft()
int
getMarginTop()
int
getMarginRight()
int
getMarginBottom()
int
getOrder()
void
setOrder(int order)
Sets the order attribute to the flex item int
describeContents()
void
writeToParcel(Parcel dest, int flags)
-
Methods inherited from class androidx.recyclerview.widget.RecyclerView.LayoutParams
getViewAdapterPosition, getViewLayoutPosition, getViewPosition, isItemChanged, isItemRemoved, isViewInvalid, viewNeedsUpdate
-
Methods inherited from class com.pointrlabs.core.util.flexbox.FlexItem
getMarginEnd, getMarginStart
-
Methods inherited from class android.view.ViewGroup.MarginLayoutParams
getLayoutDirection, getMarginEnd, getMarginStart, isMarginRelative, resolveLayoutDirection, setLayoutDirection, setMarginEnd, setMarginStart, setMargins
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
FlexboxLayoutManager.LayoutParams
FlexboxLayoutManager.LayoutParams(Context c, AttributeSet attrs)
-
FlexboxLayoutManager.LayoutParams
FlexboxLayoutManager.LayoutParams(int width, int height)
-
FlexboxLayoutManager.LayoutParams
FlexboxLayoutManager.LayoutParams(ViewGroup.MarginLayoutParams source)
-
FlexboxLayoutManager.LayoutParams
FlexboxLayoutManager.LayoutParams(ViewGroup.LayoutParams source)
-
FlexboxLayoutManager.LayoutParams
FlexboxLayoutManager.LayoutParams(RecyclerView.LayoutParams source)
-
FlexboxLayoutManager.LayoutParams
FlexboxLayoutManager.LayoutParams(FlexboxLayoutManager.LayoutParams source)
-
-
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
-
getAlignSelf
int getAlignSelf()
-
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
-
describeContents
int describeContents()
-
writeToParcel
void writeToParcel(Parcel dest, int flags)
-
-
-
-