public static class GridLayoutManager.LayoutParams extends RecyclerView.LayoutParams
Note that if the orientation is LinearLayoutManager.VERTICAL
, the width parameter is ignored and if the
orientation is LinearLayoutManager.HORIZONTAL
the height parameter is ignored because child view is
expected to fill all of the space given to it.
Modifier and Type | Field and Description |
---|---|
static int |
INVALID_SPAN_ID
Span Id for Views that are not laid out yet.
|
bottomMargin, DEFAULT_MARGIN_RELATIVE, leftMargin, rightMargin, topMargin
FILL_PARENT, height, layoutAnimationParameters, MATCH_PARENT, width, WRAP_CONTENT
Constructor and Description |
---|
LayoutParams(Context c,
AttributeSet attrs) |
LayoutParams(int width,
int height) |
LayoutParams(RecyclerView.LayoutParams source) |
LayoutParams(ViewGroup.LayoutParams source) |
LayoutParams(ViewGroup.MarginLayoutParams source) |
Modifier and Type | Method and Description |
---|---|
int |
getSpanIndex()
Returns the current span index of this View.
|
int |
getSpanSize()
Returns the number of spans occupied by this View.
|
getViewAdapterPosition, getViewLayoutPosition, getViewPosition, isItemChanged, isItemRemoved, isViewInvalid, viewNeedsUpdate
copyMarginsFrom, encodeProperties, getLayoutDirection, getMarginEnd, getMarginStart, isLayoutRtl, isMarginRelative, onDebugDraw, resolveLayoutDirection, setLayoutDirection, setMarginEnd, setMargins, setMarginsRelative, setMarginStart
debug, setBaseAttributes, sizeToString
public static final int INVALID_SPAN_ID
public LayoutParams(Context c, AttributeSet attrs)
public LayoutParams(int width, int height)
public LayoutParams(ViewGroup.MarginLayoutParams source)
public LayoutParams(ViewGroup.LayoutParams source)
public LayoutParams(RecyclerView.LayoutParams source)
public int getSpanIndex()
undefined
.
Starting with RecyclerView 24.2.0, span indices are always indexed from position 0
even if the layout is RTL. In a vertical GridLayoutManager, leftmost span is span
0 if the layout is LTR and rightmost span is span 0 if the layout is
RTL. Prior to 24.2.0, it was the opposite which was conflicting with
GridLayoutManager.SpanSizeLookup.getSpanIndex(int, int)
.
If the View occupies multiple spans, span with the minimum index is returned.
public int getSpanSize()
undefined
.