ItemHolderInfo
open class ItemHolderInfo
kotlin.Any | |
↳ | androidx.recyclerview.widget.RecyclerView.ItemAnimator.ItemHolderInfo |
A simple data structure that holds information about an item's bounds. This information is used in calculating item animations. Default implementation of recordPreLayoutInformation(RecyclerView.State, ViewHolder, int, List)
and recordPostLayoutInformation(RecyclerView.State, ViewHolder)
returns this data structure. You can extend this class if you would like to keep more information about the Views.
If you want to provide your own implementation but still use `super` methods to record basic information, you can override obtainHolderInfo()
to provide your own instances.
Summary
Public constructors | |
---|---|
<init>() |
Public methods | |
---|---|
open RecyclerView.ItemAnimator.ItemHolderInfo |
setFrom(@NonNull holder: RecyclerView.ViewHolder) Sets the |
open RecyclerView.ItemAnimator.ItemHolderInfo |
setFrom(@NonNull holder: RecyclerView.ViewHolder, flags: Int) Sets the |
Properties | |
---|---|
Int |
The bottom edge of the View (excluding decorations) |
Int |
The change flags that were passed to |
Int |
The left edge of the View (excluding decorations) |
Int |
The right edge of the View (excluding decorations) |
Int |
The top edge of the View (excluding decorations) |
Public constructors
<init>
ItemHolderInfo()
Public methods
setFrom
@NonNull open fun setFrom(@NonNull holder: RecyclerView.ViewHolder): RecyclerView.ItemAnimator.ItemHolderInfo
Sets the left
, top
, right
and bottom
values from the given ViewHolder. Clears all changeFlags
.
Parameters | |
---|---|
holder |
RecyclerView.ViewHolder: The ViewHolder whose bounds should be copied. |
Return | |
---|---|
RecyclerView.ItemAnimator.ItemHolderInfo |
This ItemHolderInfo |
setFrom
@NonNull open fun setFrom(
@NonNull holder: RecyclerView.ViewHolder,
flags: Int
): RecyclerView.ItemAnimator.ItemHolderInfo
Sets the left
, top
, right
and bottom
values from the given ViewHolder and sets the changeFlags
to the given flags parameter.
Parameters | |
---|---|
holder |
RecyclerView.ViewHolder: The ViewHolder whose bounds should be copied. |
flags |
Int: The adapter change flags that were passed into recordPreLayoutInformation(RecyclerView.State, ViewHolder, int, * List) . |
Return | |
---|---|
RecyclerView.ItemAnimator.ItemHolderInfo |
This ItemHolderInfo |
Properties
changeFlags
var changeFlags: Int
The change flags that were passed to recordPreLayoutInformation(RecyclerView.State, ViewHolder, int, List)
.