Skip to content

Most visited

Recently visited

navigation
added in version 24.1.0
belongs to Maven artifact com.android.support:recyclerview-v7:27.0.0

RecyclerView.ItemAnimator.ItemHolderInfo

public static class RecyclerView.ItemAnimator.ItemHolderInfo
extends Object

java.lang.Object
   ↳ android.support.v7.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

Fields

public int bottom

The bottom edge of the View (excluding decorations)

public int changeFlags

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

public int left

The left edge of the View (excluding decorations)

public int right

The right edge of the View (excluding decorations)

public int top

The top edge of the View (excluding decorations)

Public constructors

RecyclerView.ItemAnimator.ItemHolderInfo()

Public methods

RecyclerView.ItemAnimator.ItemHolderInfo setFrom(RecyclerView.ViewHolder holder, int flags)

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

RecyclerView.ItemAnimator.ItemHolderInfo setFrom(RecyclerView.ViewHolder holder)

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

Inherited methods

From class java.lang.Object

Fields

bottom

added in version 24.1.0
int bottom

The bottom edge of the View (excluding decorations)

changeFlags

added in version 24.1.0
int changeFlags

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

left

added in version 24.1.0
int left

The left edge of the View (excluding decorations)

right

added in version 24.1.0
int right

The right edge of the View (excluding decorations)

top

added in version 24.1.0
int top

The top edge of the View (excluding decorations)

Public constructors

RecyclerView.ItemAnimator.ItemHolderInfo

added in version 24.1.0
RecyclerView.ItemAnimator.ItemHolderInfo ()

Public methods

setFrom

added in version 24.1.0
RecyclerView.ItemAnimator.ItemHolderInfo setFrom (RecyclerView.ViewHolder holder, 
                int flags)

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).

Returns
RecyclerView.ItemAnimator.ItemHolderInfo This RecyclerView.ItemAnimator.ItemHolderInfo

setFrom

added in version 24.1.0
RecyclerView.ItemAnimator.ItemHolderInfo setFrom (RecyclerView.ViewHolder holder)

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.

Returns
RecyclerView.ItemAnimator.ItemHolderInfo This RecyclerView.ItemAnimator.ItemHolderInfo

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (Dec 2017 Android Platform & Tools Survey)