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

Public methods

open RecyclerView.ItemAnimator.ItemHolderInfo
setFrom(@NonNull holder: RecyclerView.ViewHolder)

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

open RecyclerView.ItemAnimator.ItemHolderInfo
setFrom(@NonNull holder: RecyclerView.ViewHolder, flags: Int)

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

Properties

Int

The bottom edge of the View (excluding decorations)

Int

The change flags that were passed to recordPreLayoutInformation(RecyclerView.State, ViewHolder, int, List).

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 RecyclerView.ViewHolder: The adapter change flags that were passed into recordPreLayoutInformation(RecyclerView.State, ViewHolder, int, * List).
Return
RecyclerView.ItemAnimator.ItemHolderInfo: This ItemHolderInfo

Properties

bottom

var bottom: Int

The bottom edge of the View (excluding decorations)

changeFlags

var changeFlags: Int

The change flags that were passed to recordPreLayoutInformation(RecyclerView.State, ViewHolder, int, List).

left

var left: Int

The left edge of the View (excluding decorations)

right

var right: Int

The right edge of the View (excluding decorations)

top

var top: Int

The top edge of the View (excluding decorations)