RecyclerView.ItemAnimator.ItemHolderInfo


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 constructors

Public functions

RecyclerView.ItemAnimator.ItemHolderInfo

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

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 properties

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

ItemHolderInfo

Added in 1.0.0
ItemHolderInfo()

Public functions

setFrom

Added in 1.0.0
fun setFrom(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.

setFrom

Added in 1.0.0
fun setFrom(
    holder: RecyclerView.ViewHolder,
    @RecyclerView.ItemAnimator.AdapterChanges 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.

@RecyclerView.ItemAnimator.AdapterChanges flags: Int

The adapter change flags that were passed into recordPreLayoutInformation.

Public properties

bottom

Added in 1.0.0
val bottomInt

The bottom edge of the View (excluding decorations)

changeFlags

Added in 1.0.0
@RecyclerView.ItemAnimator.AdapterChanges
val changeFlagsInt

The change flags that were passed to recordPreLayoutInformation.

left

Added in 1.0.0
val leftInt

The left edge of the View (excluding decorations)

right

Added in 1.0.0
val rightInt

The right edge of the View (excluding decorations)

top

Added in 1.0.0
val topInt

The top edge of the View (excluding decorations)