public static class RecyclerView.LayoutParams extends ViewGroup.MarginLayoutParams
LayoutParams
subclass for children of
RecyclerView
. Custom layout managers
are encouraged
to create their own subclass of this LayoutParams
class
to store any additional required per-child view metadata about the layout.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 |
getViewAdapterPosition()
Returns the up-to-date adapter position that the view this LayoutParams is attached to
corresponds to.
|
int |
getViewLayoutPosition()
Returns the adapter position that the view this LayoutParams is attached to corresponds
to as of latest layout calculation.
|
int |
getViewPosition()
Deprecated.
|
boolean |
isItemChanged()
Returns true if the adapter data item corresponding to the view this LayoutParams
is attached to has been changed in the data set.
|
boolean |
isItemRemoved()
Returns true if the adapter data item corresponding to the view this LayoutParams
is attached to has been removed from the data set.
|
boolean |
isViewInvalid()
Returns true if the view this LayoutParams is attached to is now representing
potentially invalid data.
|
boolean |
viewNeedsUpdate()
Returns true if the view this LayoutParams is attached to needs to have its content
updated from the corresponding adapter.
|
copyMarginsFrom, encodeProperties, getLayoutDirection, getMarginEnd, getMarginStart, isLayoutRtl, isMarginRelative, onDebugDraw, resolveLayoutDirection, setLayoutDirection, setMarginEnd, setMargins, setMarginsRelative, setMarginStart
debug, setBaseAttributes, sizeToString
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 boolean viewNeedsUpdate()
public boolean isViewInvalid()
public boolean isItemRemoved()
public boolean isItemChanged()
@Deprecated public int getViewPosition()
getViewLayoutPosition()
or getViewAdapterPosition()
public int getViewLayoutPosition()
public int getViewAdapterPosition()
RecyclerView.NO_POSITION
if item represented by this View has been removed or
its up-to-date position cannot be calculated.