-
public class RecyclerView.LayoutParams extends ViewGroup.MarginLayoutParams
LayoutParams subclass for children of RecyclerView. Custom layout managers are encouragedto create their own subclass of this
LayoutParams
classto store any additional required per-child view metadata about the layout.
-
-
Constructor Summary
Constructors Constructor Description RecyclerView.LayoutParams(Context c, AttributeSet attrs)
RecyclerView.LayoutParams(int width, int height)
RecyclerView.LayoutParams(ViewGroup.MarginLayoutParams source)
RecyclerView.LayoutParams(ViewGroup.LayoutParams source)
RecyclerView.LayoutParams(RecyclerView.LayoutParams source)
-
Method Summary
Modifier and Type Method Description boolean
viewNeedsUpdate()
Returns true if the view this LayoutParams is attached to needs to have its contentupdated from the corresponding adapter. boolean
isViewInvalid()
Returns true if the view this LayoutParams is attached to is now representingpotentially invalid data. boolean
isItemRemoved()
Returns true if the adapter data item corresponding to the view this LayoutParamsis attached to has been removed from the data set. boolean
isItemChanged()
Returns true if the adapter data item corresponding to the view this LayoutParamsis attached to has been changed in the data set. int
getViewPosition()
int
getViewLayoutPosition()
Returns the adapter position that the view this LayoutParams is attached to correspondsto as of latest layout calculation. int
getViewAdapterPosition()
int
getAbsoluteAdapterPosition()
Returns the up-to-date adapter position that the view this LayoutParams is attached tocorresponds to in the RecyclerView. int
getBindingAdapterPosition()
Returns the up-to-date adapter position that the view this LayoutParams is attached tocorresponds to with respect to the Adapter that bound this View. -
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
-
RecyclerView.LayoutParams
RecyclerView.LayoutParams(Context c, AttributeSet attrs)
-
RecyclerView.LayoutParams
RecyclerView.LayoutParams(int width, int height)
-
RecyclerView.LayoutParams
RecyclerView.LayoutParams(ViewGroup.MarginLayoutParams source)
-
RecyclerView.LayoutParams
RecyclerView.LayoutParams(ViewGroup.LayoutParams source)
-
RecyclerView.LayoutParams
RecyclerView.LayoutParams(RecyclerView.LayoutParams source)
-
-
Method Detail
-
viewNeedsUpdate
boolean viewNeedsUpdate()
Returns true if the view this LayoutParams is attached to needs to have its contentupdated from the corresponding adapter.
-
isViewInvalid
boolean isViewInvalid()
Returns true if the view this LayoutParams is attached to is now representingpotentially invalid data. A LayoutManager should scrap/recycle it.
-
isItemRemoved
boolean isItemRemoved()
Returns true if the adapter data item corresponding to the view this LayoutParamsis attached to has been removed from the data set. A LayoutManager may choose totreat it differently in order to animate its outgoing or disappearing state.
-
isItemChanged
boolean isItemChanged()
Returns true if the adapter data item corresponding to the view this LayoutParamsis attached to has been changed in the data set. A LayoutManager may choose totreat it differently in order to animate its changing state.
-
getViewPosition
@Deprecated() int getViewPosition()
-
getViewLayoutPosition
int getViewLayoutPosition()
Returns the adapter position that the view this LayoutParams is attached to correspondsto as of latest layout calculation.
-
getViewAdapterPosition
@Deprecated() int getViewAdapterPosition()
-
getAbsoluteAdapterPosition
int getAbsoluteAdapterPosition()
Returns the up-to-date adapter position that the view this LayoutParams is attached tocorresponds to in the RecyclerView. If the RecyclerView has an Adapter that merges other adapters, this position will be with respect to theadapter that is assigned to the RecyclerView.
-
getBindingAdapterPosition
int getBindingAdapterPosition()
Returns the up-to-date adapter position that the view this LayoutParams is attached tocorresponds to with respect to the Adapter that bound this View.
-
-
-
-