RecyclerView.ItemAnimator.ItemHolderInfo

public class 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 and recordPostLayoutInformation 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 fields

int

The bottom edge of the View (excluding decorations)

int

The change flags that were passed to recordPreLayoutInformation.

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

Public methods

@NonNull RecyclerView.ItemAnimator.ItemHolderInfo

Sets the left, top, right and bottom values from the given ViewHolder.

@NonNull RecyclerView.ItemAnimator.ItemHolderInfo

Sets the left, top, right and bottom values from the given ViewHolder and sets the changeFlags to the given flags parameter.

Public fields

bottom

Added in 1.0.0
public int bottom

The bottom edge of the View (excluding decorations)

changeFlags

Added in 1.0.0
@RecyclerView.ItemAnimator.AdapterChanges
public int changeFlags

The change flags that were passed to recordPreLayoutInformation.

left

Added in 1.0.0
public int left

The left edge of the View (excluding decorations)

right

Added in 1.0.0
public int right

The right edge of the View (excluding decorations)

top

Added in 1.0.0
public int top

The top edge of the View (excluding decorations)

Public constructors

ItemHolderInfo

Added in 1.0.0
public ItemHolderInfo()

Public methods

setFrom

Added in 1.0.0
public @NonNull RecyclerView.ItemAnimator.ItemHolderInfo setFrom(@NonNull RecyclerView.ViewHolder holder)

Sets the left, top, right and bottom values from the given ViewHolder. Clears all changeFlags.

Parameters
@NonNull RecyclerView.ViewHolder holder

The ViewHolder whose bounds should be copied.

setFrom

Added in 1.0.0
public @NonNull RecyclerView.ItemAnimator.ItemHolderInfo setFrom(
    @NonNull RecyclerView.ViewHolder holder,
    @RecyclerView.ItemAnimator.AdapterChanges int flags
)

Sets the left, top, right and bottom values from the given ViewHolder and sets the changeFlags to the given flags parameter.

Parameters
@NonNull RecyclerView.ViewHolder holder

The ViewHolder whose bounds should be copied.

@RecyclerView.ItemAnimator.AdapterChanges int flags

The adapter change flags that were passed into recordPreLayoutInformation.