# RecyclerView.ItemAnimator

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  
belongs to Maven artifact com.android.support:recyclerview-v7:28.0.0-alpha1  
Summary:[Nested Classes](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#nestedclasses)\|[Constants](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#constants)\|[Ctors](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#pubctors)\|[Methods](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#)  

# RecyclerView.ItemAnimator

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public
static

abstract
class
RecyclerView.ItemAnimator
`  
`

extends Object


``


`

|---|-----------------------------------------------------|
| java.lang.Object                                       ||
| ↳ | android.support.v7.widget.RecyclerView.ItemAnimator |

|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#)Known Direct Subclasses [SimpleItemAnimator](https://developer.android.com/reference/android/support/v7/widget/SimpleItemAnimator) |------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------| | [SimpleItemAnimator](https://developer.android.com/reference/android/support/v7/widget/SimpleItemAnimator) | A wrapper class for ItemAnimator that records View bounds and decides whether it should run move, change, add or remove animations. | |

|---|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#)Known Indirect Subclasses [DefaultItemAnimator](https://developer.android.com/reference/android/support/v7/widget/DefaultItemAnimator) |--------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [DefaultItemAnimator](https://developer.android.com/reference/android/support/v7/widget/DefaultItemAnimator) | This implementation of[RecyclerView.ItemAnimator](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator)provides basic animations on remove, add, and move events that happen to the items in a RecyclerView. | ||

<br />

*** ** * ** ***

This class defines the animations that take place on items as changes are made to the adapter. Subclasses of ItemAnimator can be used to implement custom animations for actions on ViewHolder items. The RecyclerView will manage retaining these items while they are being animated, but implementors must call[dispatchAnimationFinished(ViewHolder)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#dispatchAnimationFinished(android.support.v7.widget.RecyclerView.ViewHolder))when a ViewHolder's animation is finished. In other words, there must be a matching[dispatchAnimationFinished(ViewHolder)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#dispatchAnimationFinished(android.support.v7.widget.RecyclerView.ViewHolder))call for each[animateAppearance()](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#animateAppearance(android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo)),[animateChange()](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#animateChange(android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo))[animatePersistence()](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#animatePersistence(android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo)), and[animateDisappearance()](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#animateDisappearance(android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo))call.

By default, RecyclerView uses[DefaultItemAnimator](https://developer.android.com/reference/android/support/v7/widget/DefaultItemAnimator).

<br />

**See also:**

- [setItemAnimator(ItemAnimator)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView#setItemAnimator(android.support.v7.widget.RecyclerView.ItemAnimator))

## Summary

|                                                                                                                                                                                                                                                            ### Nested classes                                                                                                                                                                                                                                                             ||
|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` @interface` | [RecyclerView.ItemAnimator.AdapterChanges](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator.AdapterChanges) The set of flags that might be passed to[recordPreLayoutInformation(State, ViewHolder, int, List)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#recordPreLayoutInformation(android.support.v7.widget.RecyclerView.State, android.support.v7.widget.RecyclerView.ViewHolder, int, java.util.List<java.lang.Object>)). |
| ` interface`  | [RecyclerView.ItemAnimator.ItemAnimatorFinishedListener](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator.ItemAnimatorFinishedListener) This interface is used to inform listeners when all pending or running animations in an ItemAnimator are finished.                                                                                                                                                                                                                      |
| ` class`      | [RecyclerView.ItemAnimator.ItemHolderInfo](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator.ItemHolderInfo) A simple data structure that holds information about an item's bounds.                                                                                                                                                                                                                                                                                              |

|                                                                                                                                                                                     ### Constants                                                                                                                                                                                     ||
|-------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | [FLAG_APPEARED_IN_PRE_LAYOUT](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#FLAG_APPEARED_IN_PRE_LAYOUT) This ViewHolder was not laid out but has been added to the layout in pre-layout state by the[RecyclerView.LayoutManager](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.LayoutManager). |
| `int` | [FLAG_CHANGED](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#FLAG_CHANGED) The Item represented by this ViewHolder is updated.                                                                                                                                                                                                   |
| `int` | [FLAG_INVALIDATED](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#FLAG_INVALIDATED) Adapter[notifyDataSetChanged()](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter#notifyDataSetChanged())has been called and the content represented by this ViewHolder is invalid.                      |
| `int` | [FLAG_MOVED](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#FLAG_MOVED) The position of the Item represented by this ViewHolder has been changed.                                                                                                                                                                                 |
| `int` | [FLAG_REMOVED](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#FLAG_REMOVED) The Item represented by this ViewHolder is removed from the adapter.                                                                                                                                                                                  |

|                                                                     ### Public constructors                                                                     ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[RecyclerView.ItemAnimator](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#RecyclerView.ItemAnimator())`() ` |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ### Public methods                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract boolean`                                                                                                                                       | ` `[animateAppearance](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#animateAppearance(android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo))`(`[RecyclerView.ViewHolder](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ViewHolder)` viewHolder, `[RecyclerView.ItemAnimator.ItemHolderInfo](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator.ItemHolderInfo)` preLayoutInfo, `[RecyclerView.ItemAnimator.ItemHolderInfo](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator.ItemHolderInfo)` postLayoutInfo) ` Called by the RecyclerView when a ViewHolder is added to the layout.                                                                                                                                                                                                                                                                                                                                                                                       |
| ` abstract boolean`                                                                                                                                       | ` `[animateChange](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#animateChange(android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo))`(`[RecyclerView.ViewHolder](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ViewHolder)` oldHolder, `[RecyclerView.ViewHolder](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ViewHolder)` newHolder, `[RecyclerView.ItemAnimator.ItemHolderInfo](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator.ItemHolderInfo)` preLayoutInfo, `[RecyclerView.ItemAnimator.ItemHolderInfo](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator.ItemHolderInfo)` postLayoutInfo) ` Called by the RecyclerView when an adapter item is present both before and after the layout and RecyclerView has received a[notifyItemChanged(int)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter#notifyItemChanged(int))call for it. |
| ` abstract boolean`                                                                                                                                       | ` `[animateDisappearance](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#animateDisappearance(android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo))`(`[RecyclerView.ViewHolder](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ViewHolder)` viewHolder, `[RecyclerView.ItemAnimator.ItemHolderInfo](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator.ItemHolderInfo)` preLayoutInfo, `[RecyclerView.ItemAnimator.ItemHolderInfo](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator.ItemHolderInfo)` postLayoutInfo) ` Called by the RecyclerView when a ViewHolder has disappeared from the layout.                                                                                                                                                                                                                                                                                                                                                                        |
| ` abstract boolean`                                                                                                                                       | ` `[animatePersistence](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#animatePersistence(android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo))`(`[RecyclerView.ViewHolder](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ViewHolder)` viewHolder, `[RecyclerView.ItemAnimator.ItemHolderInfo](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator.ItemHolderInfo)` preLayoutInfo, `[RecyclerView.ItemAnimator.ItemHolderInfo](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator.ItemHolderInfo)` postLayoutInfo) ` Called by the RecyclerView when a ViewHolder is present in both before and after the layout and RecyclerView has not received a[notifyItemChanged(int)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter#notifyItemChanged(int))call for it or a[notifyDataSetChanged()](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter#notifyDataSetChanged())call.                       |
| ` boolean`                                                                                                                                                | ` `[canReuseUpdatedViewHolder](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#canReuseUpdatedViewHolder(android.support.v7.widget.RecyclerView.ViewHolder, java.util.List<java.lang.Object>))`(`[RecyclerView.ViewHolder](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ViewHolder)` viewHolder, List<Object> payloads) ` When an item is changed, ItemAnimator can decide whether it wants to re-use the same ViewHolder for animations or RecyclerView should create a copy of the item and ItemAnimator will use both to run the animation (e.g.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ` boolean`                                                                                                                                                | ` `[canReuseUpdatedViewHolder](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#canReuseUpdatedViewHolder(android.support.v7.widget.RecyclerView.ViewHolder))`(`[RecyclerView.ViewHolder](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ViewHolder)` viewHolder) ` When an item is changed, ItemAnimator can decide whether it wants to re-use the same ViewHolder for animations or RecyclerView should create a copy of the item and ItemAnimator will use both to run the animation (e.g.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ` final void`                                                                                                                                             | ` `[dispatchAnimationFinished](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#dispatchAnimationFinished(android.support.v7.widget.RecyclerView.ViewHolder))`(`[RecyclerView.ViewHolder](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ViewHolder)` viewHolder) ` Method to be called by subclasses when an animation is finished.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ` final void`                                                                                                                                             | ` `[dispatchAnimationStarted](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#dispatchAnimationStarted(android.support.v7.widget.RecyclerView.ViewHolder))`(`[RecyclerView.ViewHolder](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ViewHolder)` viewHolder) ` Method to be called by subclasses when an animation is started.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ` final void`                                                                                                                                             | ` `[dispatchAnimationsFinished](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#dispatchAnimationsFinished())`() ` This method should be called by ItemAnimator implementations to notify any listeners that all pending and active item animations are finished.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ` abstract void`                                                                                                                                          | ` `[endAnimation](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#endAnimation(android.support.v7.widget.RecyclerView.ViewHolder))`(`[RecyclerView.ViewHolder](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ViewHolder)` item) ` Method called when an animation on a view should be ended immediately.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ` abstract void`                                                                                                                                          | ` `[endAnimations](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#endAnimations())`() ` Method called when all item animations should be ended immediately.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ` long`                                                                                                                                                   | ` `[getAddDuration](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#getAddDuration())`() ` Gets the current duration for which all add animations will run.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ` long`                                                                                                                                                   | ` `[getChangeDuration](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#getChangeDuration())`() ` Gets the current duration for which all change animations will run.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ` long`                                                                                                                                                   | ` `[getMoveDuration](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#getMoveDuration())`() ` Gets the current duration for which all move animations will run.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ` long`                                                                                                                                                   | ` `[getRemoveDuration](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#getRemoveDuration())`() ` Gets the current duration for which all remove animations will run.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ` abstract boolean`                                                                                                                                       | ` `[isRunning](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#isRunning())`() ` Method which returns whether there are any item animations currently running.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ` final boolean`                                                                                                                                          | ` `[isRunning](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#isRunning(android.support.v7.widget.RecyclerView.ItemAnimator.ItemAnimatorFinishedListener))`(`[RecyclerView.ItemAnimator.ItemAnimatorFinishedListener](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator.ItemAnimatorFinishedListener)` listener) ` Like[isRunning()](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#isRunning()), this method returns whether there are any item animations currently running.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ` `[RecyclerView.ItemAnimator.ItemHolderInfo](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator.ItemHolderInfo) | ` `[obtainHolderInfo](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#obtainHolderInfo())`() ` Returns a new[RecyclerView.ItemAnimator.ItemHolderInfo](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator.ItemHolderInfo)which will be used to store information about the ViewHolder.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ` void`                                                                                                                                                   | ` `[onAnimationFinished](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#onAnimationFinished(android.support.v7.widget.RecyclerView.ViewHolder))`(`[RecyclerView.ViewHolder](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ViewHolder)` viewHolder) ` Called after[dispatchAnimationFinished(ViewHolder)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#dispatchAnimationFinished(android.support.v7.widget.RecyclerView.ViewHolder))is called by the ItemAnimator.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ` void`                                                                                                                                                   | ` `[onAnimationStarted](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#onAnimationStarted(android.support.v7.widget.RecyclerView.ViewHolder))`(`[RecyclerView.ViewHolder](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ViewHolder)` viewHolder) ` Called when a new animation is started on the given ViewHolder.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ` `[RecyclerView.ItemAnimator.ItemHolderInfo](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator.ItemHolderInfo) | ` `[recordPostLayoutInformation](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#recordPostLayoutInformation(android.support.v7.widget.RecyclerView.State, android.support.v7.widget.RecyclerView.ViewHolder))`(`[RecyclerView.State](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.State)` state, `[RecyclerView.ViewHolder](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ViewHolder)` viewHolder) ` Called by the RecyclerView after the layout is complete.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ` `[RecyclerView.ItemAnimator.ItemHolderInfo](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator.ItemHolderInfo) | ` `[recordPreLayoutInformation](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#recordPreLayoutInformation(android.support.v7.widget.RecyclerView.State, android.support.v7.widget.RecyclerView.ViewHolder, int, java.util.List<java.lang.Object>))`(`[RecyclerView.State](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.State)` state, `[RecyclerView.ViewHolder](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ViewHolder)` viewHolder, int changeFlags, List<Object> payloads) ` Called by the RecyclerView before the layout begins.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ` abstract void`                                                                                                                                          | ` `[runPendingAnimations](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#runPendingAnimations())`() ` Called when there are pending animations waiting to be started.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ` void`                                                                                                                                                   | ` `[setAddDuration](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#setAddDuration(long))`(long addDuration) ` Sets the duration for which all add animations will run.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ` void`                                                                                                                                                   | ` `[setChangeDuration](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#setChangeDuration(long))`(long changeDuration) ` Sets the duration for which all change animations will run.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ` void`                                                                                                                                                   | ` `[setMoveDuration](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#setMoveDuration(long))`(long moveDuration) ` Sets the duration for which all move animations will run.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ` void`                                                                                                                                                   | ` `[setRemoveDuration](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#setRemoveDuration(long))`(long removeDuration) ` Sets the duration for which all remove animations will run.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#)From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||

## Constants

### FLAG_APPEARED_IN_PRE_LAYOUT

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int FLAG_APPEARED_IN_PRE_LAYOUT
```

This ViewHolder was not laid out but has been added to the layout in pre-layout state by the[RecyclerView.LayoutManager](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.LayoutManager). This means that the item was already in the Adapter but invisible and it may become visible in the post layout phase. LayoutManagers may prefer to add new items in pre-layout to specify their virtual location when they are invisible (e.g. to specify the item should*animate in*from below the visible area).

<br />

<br />

**See also:**

- [recordPreLayoutInformation(State, ViewHolder, int, List)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#recordPreLayoutInformation(android.support.v7.widget.RecyclerView.State, android.support.v7.widget.RecyclerView.ViewHolder, int, java.util.List<java.lang.Object>))

Constant Value: 4096 (0x00001000)  

### FLAG_CHANGED

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int FLAG_CHANGED
```

The Item represented by this ViewHolder is updated.

<br />

<br />

**See also:**

- [recordPreLayoutInformation(State, ViewHolder, int, List)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#recordPreLayoutInformation(android.support.v7.widget.RecyclerView.State, android.support.v7.widget.RecyclerView.ViewHolder, int, java.util.List<java.lang.Object>))

Constant Value: 2 (0x00000002)  

### FLAG_INVALIDATED

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int FLAG_INVALIDATED
```

Adapter[notifyDataSetChanged()](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter#notifyDataSetChanged())has been called and the content represented by this ViewHolder is invalid.

<br />

<br />

**See also:**

- [recordPreLayoutInformation(State, ViewHolder, int, List)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#recordPreLayoutInformation(android.support.v7.widget.RecyclerView.State, android.support.v7.widget.RecyclerView.ViewHolder, int, java.util.List<java.lang.Object>))

Constant Value: 4 (0x00000004)  

### FLAG_MOVED

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int FLAG_MOVED
```

The position of the Item represented by this ViewHolder has been changed. This flag is not bound to[notifyItemMoved(int, int)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter#notifyItemMoved(int, int)). It might be set in response to any adapter change that may have a side effect on this item. (e.g. The item before this one has been removed from the Adapter).

<br />

<br />

**See also:**

- [recordPreLayoutInformation(State, ViewHolder, int, List)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#recordPreLayoutInformation(android.support.v7.widget.RecyclerView.State, android.support.v7.widget.RecyclerView.ViewHolder, int, java.util.List<java.lang.Object>))

Constant Value: 2048 (0x00000800)  

### FLAG_REMOVED

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int FLAG_REMOVED
```

The Item represented by this ViewHolder is removed from the adapter.

<br />

<br />

**See also:**

- [recordPreLayoutInformation(State, ViewHolder, int, List)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#recordPreLayoutInformation(android.support.v7.widget.RecyclerView.State, android.support.v7.widget.RecyclerView.ViewHolder, int, java.util.List<java.lang.Object>))

Constant Value: 8 (0x00000008)

## Public constructors

### RecyclerView.ItemAnimator

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
RecyclerView.ItemAnimator ()
```

<br />

<br />

## Public methods

### animateAppearance

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean animateAppearance (RecyclerView.ViewHolder viewHolder, 
                RecyclerView.ItemAnimator.ItemHolderInfo preLayoutInfo, 
                RecyclerView.ItemAnimator.ItemHolderInfo postLayoutInfo)
```

Called by the RecyclerView when a ViewHolder is added to the layout.

In detail, this means that the ViewHolder was**not**a child when the layout started but has been added by the LayoutManager. It might be newly added to the adapter or simply become visible due to other factors.

ItemAnimator must call[dispatchAnimationFinished(ViewHolder)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#dispatchAnimationFinished(android.support.v7.widget.RecyclerView.ViewHolder))when the animation is complete (or instantly call[dispatchAnimationFinished(ViewHolder)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#dispatchAnimationFinished(android.support.v7.widget.RecyclerView.ViewHolder))if it decides not to animate the view).

<br />

|                                                                                                                                                                                                                                                                                                      Parameters                                                                                                                                                                                                                                                                                                      ||
|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `viewHolder`     | `RecyclerView.ViewHolder`: The ViewHolder which should be animated <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `preLayoutInfo`  | `RecyclerView.ItemAnimator.ItemHolderInfo`: The information that was returned from[recordPreLayoutInformation(State, ViewHolder, int, List)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#recordPreLayoutInformation(android.support.v7.widget.RecyclerView.State, android.support.v7.widget.RecyclerView.ViewHolder, int, java.util.List<java.lang.Object>)). Might be null if Item was just added to the adapter or LayoutManager does not support predictive animations or it could not predict that this ViewHolder will become visible. <br /> |
| `postLayoutInfo` | `RecyclerView.ItemAnimator.ItemHolderInfo`: The information that was returned from[recordPreLayoutInformation(State, ViewHolder, int, List)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#recordPreLayoutInformation(android.support.v7.widget.RecyclerView.State, android.support.v7.widget.RecyclerView.ViewHolder, int, java.util.List<java.lang.Object>)). <br />                                                                                                                                                                               |

|                                                                                                       Returns                                                                                                       ||
|-----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `boolean` | true if a later call to[runPendingAnimations()](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#runPendingAnimations())is requested, false otherwise. <br /> |

### animateChange

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean animateChange (RecyclerView.ViewHolder oldHolder, 
                RecyclerView.ViewHolder newHolder, 
                RecyclerView.ItemAnimator.ItemHolderInfo preLayoutInfo, 
                RecyclerView.ItemAnimator.ItemHolderInfo postLayoutInfo)
```

Called by the RecyclerView when an adapter item is present both before and after the layout and RecyclerView has received a[notifyItemChanged(int)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter#notifyItemChanged(int))call for it. This method may also be called when[notifyDataSetChanged()](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter#notifyDataSetChanged())is called and adapter has stable ids so that RecyclerView could still rebind views to the same ViewHolders. If viewType changes when[notifyDataSetChanged()](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter#notifyDataSetChanged())is called, this method**will not** be called, instead,[animateAppearance(ViewHolder, ItemHolderInfo, ItemHolderInfo)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#animateAppearance(android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo))will be called for the new ViewHolder and the old one will be recycled.

If this method is called due to a[notifyDataSetChanged()](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter#notifyDataSetChanged())call, there is a good possibility that item contents didn't really change but it is rebound from the adapter.[DefaultItemAnimator](https://developer.android.com/reference/android/support/v7/widget/DefaultItemAnimator)will skip animating the View if its location on the screen didn't change and your animator should handle this case as well and avoid creating unnecessary animations.

When an item is updated, ItemAnimator has a chance to ask RecyclerView to keep the previous presentation of the item as-is and supply a new ViewHolder for the updated presentation (see:[canReuseUpdatedViewHolder(ViewHolder, List)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#canReuseUpdatedViewHolder(android.support.v7.widget.RecyclerView.ViewHolder, java.util.List<java.lang.Object>)). This is useful if you don't know the contents of the Item and would like to cross-fade the old and the new one ([DefaultItemAnimator](https://developer.android.com/reference/android/support/v7/widget/DefaultItemAnimator)uses this technique).

When you are writing a custom item animator for your layout, it might be more performant and elegant to re-use the same ViewHolder and animate the content changes manually.

When[notifyItemChanged(int)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter#notifyItemChanged(int))is called, the Item's view type may change. If the Item's view type has changed or ItemAnimator returned`false`for this ViewHolder when[canReuseUpdatedViewHolder(ViewHolder, List)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#canReuseUpdatedViewHolder(android.support.v7.widget.RecyclerView.ViewHolder, java.util.List<java.lang.Object>))was called, the`oldHolder`and`newHolder`will be different ViewHolder instances which represent the same Item. In that case, only the new ViewHolder is visible to the LayoutManager but RecyclerView keeps old ViewHolder attached for animations.

ItemAnimator must call[dispatchAnimationFinished(ViewHolder)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#dispatchAnimationFinished(android.support.v7.widget.RecyclerView.ViewHolder))for each distinct ViewHolder when their animation is complete (or instantly call[dispatchAnimationFinished(ViewHolder)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#dispatchAnimationFinished(android.support.v7.widget.RecyclerView.ViewHolder))if it decides not to animate the view).

If oldHolder and newHolder are the same instance, you should call[dispatchAnimationFinished(ViewHolder)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#dispatchAnimationFinished(android.support.v7.widget.RecyclerView.ViewHolder))**only once**.

Note that when a ViewHolder both changes and disappears in the same layout pass, the animation callback method which will be called by the RecyclerView depends on the ItemAnimator's decision whether to re-use the same ViewHolder or not, and also the LayoutManager's decision whether to layout the changed version of a disappearing ViewHolder or not. RecyclerView will call`animateChange`instead of[animateDisappearance](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#animateDisappearance(android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo))if and only if the ItemAnimator returns`false`from[canReuseUpdatedViewHolder](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#canReuseUpdatedViewHolder(android.support.v7.widget.RecyclerView.ViewHolder))and the LayoutManager lays out a new disappearing view that holds the updated information. Built-in LayoutManagers try to avoid laying out updated versions of disappearing views.

<br />

|                                                                                                                                                                                                               Parameters                                                                                                                                                                                                               ||
|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `oldHolder`      | `RecyclerView.ViewHolder`: The ViewHolder before the layout is started, might be the same instance with newHolder. <br />                                                                                                                                                                                                                                                                                            |
| `newHolder`      | `RecyclerView.ViewHolder`: The ViewHolder after the layout is finished, might be the same instance with oldHolder. <br />                                                                                                                                                                                                                                                                                            |
| `preLayoutInfo`  | `RecyclerView.ItemAnimator.ItemHolderInfo`: The information that was returned from[recordPreLayoutInformation(State, ViewHolder, int, List)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#recordPreLayoutInformation(android.support.v7.widget.RecyclerView.State, android.support.v7.widget.RecyclerView.ViewHolder, int, java.util.List<java.lang.Object>)). <br /> |
| `postLayoutInfo` | `RecyclerView.ItemAnimator.ItemHolderInfo`: The information that was returned from[recordPreLayoutInformation(State, ViewHolder, int, List)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#recordPreLayoutInformation(android.support.v7.widget.RecyclerView.State, android.support.v7.widget.RecyclerView.ViewHolder, int, java.util.List<java.lang.Object>)). <br /> |

|                                                                                                       Returns                                                                                                       ||
|-----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `boolean` | true if a later call to[runPendingAnimations()](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#runPendingAnimations())is requested, false otherwise. <br /> |

### animateDisappearance

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean animateDisappearance (RecyclerView.ViewHolder viewHolder, 
                RecyclerView.ItemAnimator.ItemHolderInfo preLayoutInfo, 
                RecyclerView.ItemAnimator.ItemHolderInfo postLayoutInfo)
```

Called by the RecyclerView when a ViewHolder has disappeared from the layout.

This means that the View was a child of the LayoutManager when layout started but has been removed by the LayoutManager. It might have been removed from the adapter or simply become invisible due to other factors. You can distinguish these two cases by checking the change flags that were passed to[recordPreLayoutInformation(State, ViewHolder, int, List)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#recordPreLayoutInformation(android.support.v7.widget.RecyclerView.State, android.support.v7.widget.RecyclerView.ViewHolder, int, java.util.List<java.lang.Object>)).

Note that when a ViewHolder both changes and disappears in the same layout pass, the animation callback method which will be called by the RecyclerView depends on the ItemAnimator's decision whether to re-use the same ViewHolder or not, and also the LayoutManager's decision whether to layout the changed version of a disappearing ViewHolder or not. RecyclerView will call[animateChange](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#animateChange(android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo))instead of`animateDisappearance`if and only if the ItemAnimator returns`false`from[canReuseUpdatedViewHolder](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#canReuseUpdatedViewHolder(android.support.v7.widget.RecyclerView.ViewHolder))and the LayoutManager lays out a new disappearing view that holds the updated information. Built-in LayoutManagers try to avoid laying out updated versions of disappearing views.

If LayoutManager supports predictive animations, it might provide a target disappear location for the View by laying it out in that location. When that happens, RecyclerView will call[recordPostLayoutInformation(State, ViewHolder)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#recordPostLayoutInformation(android.support.v7.widget.RecyclerView.State, android.support.v7.widget.RecyclerView.ViewHolder))and the response of that call will be passed to this method as the`postLayoutInfo`.

ItemAnimator must call[dispatchAnimationFinished(ViewHolder)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#dispatchAnimationFinished(android.support.v7.widget.RecyclerView.ViewHolder))when the animation is complete (or instantly call[dispatchAnimationFinished(ViewHolder)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#dispatchAnimationFinished(android.support.v7.widget.RecyclerView.ViewHolder))if it decides not to animate the view).

<br />

|                                                                                                                                                                                                                     Parameters                                                                                                                                                                                                                     ||
|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `viewHolder`     | `RecyclerView.ViewHolder`: The ViewHolder which should be animated <br />                                                                                                                                                                                                                                                                                                                                                        |
| `preLayoutInfo`  | `RecyclerView.ItemAnimator.ItemHolderInfo`: The information that was returned from[recordPreLayoutInformation(State, ViewHolder, int, List)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#recordPreLayoutInformation(android.support.v7.widget.RecyclerView.State, android.support.v7.widget.RecyclerView.ViewHolder, int, java.util.List<java.lang.Object>)). <br />             |
| `postLayoutInfo` | `RecyclerView.ItemAnimator.ItemHolderInfo`: The information that was returned from[recordPostLayoutInformation(State, ViewHolder)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#recordPostLayoutInformation(android.support.v7.widget.RecyclerView.State, android.support.v7.widget.RecyclerView.ViewHolder)). Might be null if the LayoutManager did not layout the item. <br /> |

|                                                                                                       Returns                                                                                                       ||
|-----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `boolean` | true if a later call to[runPendingAnimations()](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#runPendingAnimations())is requested, false otherwise. <br /> |

### animatePersistence

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean animatePersistence (RecyclerView.ViewHolder viewHolder, 
                RecyclerView.ItemAnimator.ItemHolderInfo preLayoutInfo, 
                RecyclerView.ItemAnimator.ItemHolderInfo postLayoutInfo)
```

Called by the RecyclerView when a ViewHolder is present in both before and after the layout and RecyclerView has not received a[notifyItemChanged(int)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter#notifyItemChanged(int))call for it or a[notifyDataSetChanged()](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter#notifyDataSetChanged())call.

This ViewHolder still represents the same data that it was representing when the layout started but its position / size may be changed by the LayoutManager.

If the Item's layout position didn't change, RecyclerView still calls this method because it does not track this information (or does not necessarily know that an animation is not required). Your ItemAnimator should handle this case and if there is nothing to animate, it should call[dispatchAnimationFinished(ViewHolder)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#dispatchAnimationFinished(android.support.v7.widget.RecyclerView.ViewHolder))and return`false`.

ItemAnimator must call[dispatchAnimationFinished(ViewHolder)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#dispatchAnimationFinished(android.support.v7.widget.RecyclerView.ViewHolder))when the animation is complete (or instantly call[dispatchAnimationFinished(ViewHolder)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#dispatchAnimationFinished(android.support.v7.widget.RecyclerView.ViewHolder))if it decides not to animate the view).

<br />

|                                                                                                                                                                                                               Parameters                                                                                                                                                                                                               ||
|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `viewHolder`     | `RecyclerView.ViewHolder`: The ViewHolder which should be animated <br />                                                                                                                                                                                                                                                                                                                                            |
| `preLayoutInfo`  | `RecyclerView.ItemAnimator.ItemHolderInfo`: The information that was returned from[recordPreLayoutInformation(State, ViewHolder, int, List)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#recordPreLayoutInformation(android.support.v7.widget.RecyclerView.State, android.support.v7.widget.RecyclerView.ViewHolder, int, java.util.List<java.lang.Object>)). <br /> |
| `postLayoutInfo` | `RecyclerView.ItemAnimator.ItemHolderInfo`: The information that was returned from[recordPreLayoutInformation(State, ViewHolder, int, List)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#recordPreLayoutInformation(android.support.v7.widget.RecyclerView.State, android.support.v7.widget.RecyclerView.ViewHolder, int, java.util.List<java.lang.Object>)). <br /> |

|                                                                                                       Returns                                                                                                       ||
|-----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `boolean` | true if a later call to[runPendingAnimations()](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#runPendingAnimations())is requested, false otherwise. <br /> |

### canReuseUpdatedViewHolder

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean canReuseUpdatedViewHolder (RecyclerView.ViewHolder viewHolder, 
                List<Object> payloads)
```

When an item is changed, ItemAnimator can decide whether it wants to re-use the same ViewHolder for animations or RecyclerView should create a copy of the item and ItemAnimator will use both to run the animation (e.g. cross-fade).

Note that this method will only be called if the[RecyclerView.ViewHolder](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ViewHolder)still has the same type ([getItemViewType(int)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter#getItemViewType(int))). Otherwise, ItemAnimator will always receive both[RecyclerView.ViewHolder](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ViewHolder)s in the[animateChange(ViewHolder, ViewHolder, ItemHolderInfo, ItemHolderInfo)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#animateChange(android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo))method.

<br />

|                                                                                                                                                                                                                                                                                     Parameters                                                                                                                                                                                                                                                                                     ||
|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `viewHolder` | `RecyclerView.ViewHolder`: The ViewHolder which represents the changed item's old content. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `payloads`   | `List`: A non-null list of merged payloads that were sent with change notifications. Can be empty if the adapter is invalidated via[notifyDataSetChanged()](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter#notifyDataSetChanged()). The same list of payloads will be passed into[onBindViewHolder(ViewHolder, int, List)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter#onBindViewHolder(VH, int, java.util.List<java.lang.Object>))method**if** this method returns`true`. <br /> |

|                                                                                                                                                                                                                     Returns                                                                                                                                                                                                                      ||
|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `boolean` | True if RecyclerView should just rebind to the same ViewHolder or false if RecyclerView should create a new ViewHolder and pass this ViewHolder to the ItemAnimator to animate. Default implementation calls[canReuseUpdatedViewHolder(ViewHolder)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#canReuseUpdatedViewHolder(android.support.v7.widget.RecyclerView.ViewHolder)). <br /> |

**See also:**

- [canReuseUpdatedViewHolder(ViewHolder)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#canReuseUpdatedViewHolder(android.support.v7.widget.RecyclerView.ViewHolder))  

### canReuseUpdatedViewHolder

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean canReuseUpdatedViewHolder (RecyclerView.ViewHolder viewHolder)
```

When an item is changed, ItemAnimator can decide whether it wants to re-use the same ViewHolder for animations or RecyclerView should create a copy of the item and ItemAnimator will use both to run the animation (e.g. cross-fade).

Note that this method will only be called if the[RecyclerView.ViewHolder](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ViewHolder)still has the same type ([getItemViewType(int)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter#getItemViewType(int))). Otherwise, ItemAnimator will always receive both[RecyclerView.ViewHolder](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ViewHolder)s in the[animateChange(ViewHolder, ViewHolder, ItemHolderInfo, ItemHolderInfo)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#animateChange(android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo))method.

If your application is using change payloads, you can override[canReuseUpdatedViewHolder(ViewHolder, List)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#canReuseUpdatedViewHolder(android.support.v7.widget.RecyclerView.ViewHolder, java.util.List<java.lang.Object>))to decide based on payloads.

<br />

|                                                   Parameters                                                    ||
|--------------|---------------------------------------------------------------------------------------------------|
| `viewHolder` | `RecyclerView.ViewHolder`: The ViewHolder which represents the changed item's old content. <br /> |

|                                                                                                                 Returns                                                                                                                 ||
|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `boolean` | True if RecyclerView should just rebind to the same ViewHolder or false if RecyclerView should create a new ViewHolder and pass this ViewHolder to the ItemAnimator to animate. Default implementation returns`true`. <br /> |

**See also:**

- [canReuseUpdatedViewHolder(ViewHolder, List)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#canReuseUpdatedViewHolder(android.support.v7.widget.RecyclerView.ViewHolder, java.util.List<java.lang.Object>))  

### dispatchAnimationFinished

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void dispatchAnimationFinished (RecyclerView.ViewHolder viewHolder)
```

Method to be called by subclasses when an animation is finished.

For each call RecyclerView makes to[animateAppearance()](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#animateAppearance(android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo)),[animatePersistence()](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#animatePersistence(android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo)), or[animateDisappearance()](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#animateDisappearance(android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo)), there should be a matching[dispatchAnimationFinished(ViewHolder)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#dispatchAnimationFinished(android.support.v7.widget.RecyclerView.ViewHolder))call by the subclass.

For[animateChange()](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#animateChange(android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo)), subclass should call this method for both the`oldHolder`and`newHolder`(if they are not the same instance).

<br />

|                                         Parameters                                          ||
|--------------|-------------------------------------------------------------------------------|
| `viewHolder` | `RecyclerView.ViewHolder`: The ViewHolder whose animation is finished. <br /> |

**See also:**

- [onAnimationFinished(ViewHolder)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#onAnimationFinished(android.support.v7.widget.RecyclerView.ViewHolder))  

### dispatchAnimationStarted

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void dispatchAnimationStarted (RecyclerView.ViewHolder viewHolder)
```

Method to be called by subclasses when an animation is started.

For each call RecyclerView makes to[animateAppearance()](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#animateAppearance(android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo)),[animatePersistence()](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#animatePersistence(android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo)), or[animateDisappearance()](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#animateDisappearance(android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo)), there should be a matching[dispatchAnimationStarted(ViewHolder)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#dispatchAnimationStarted(android.support.v7.widget.RecyclerView.ViewHolder))call by the subclass.

For[animateChange()](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#animateChange(android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo)), subclass should call this method for both the`oldHolder`and`newHolder`(if they are not the same instance).

If your ItemAnimator decides not to animate a ViewHolder, it should call[dispatchAnimationFinished(ViewHolder)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#dispatchAnimationFinished(android.support.v7.widget.RecyclerView.ViewHolder))**without** calling[dispatchAnimationStarted(ViewHolder)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#dispatchAnimationStarted(android.support.v7.widget.RecyclerView.ViewHolder)).

<br />

|                                         Parameters                                          ||
|--------------|-------------------------------------------------------------------------------|
| `viewHolder` | `RecyclerView.ViewHolder`: The ViewHolder whose animation is starting. <br /> |

**See also:**

- [onAnimationStarted(ViewHolder)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#onAnimationStarted(android.support.v7.widget.RecyclerView.ViewHolder))  

### dispatchAnimationsFinished

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void dispatchAnimationsFinished ()
```

This method should be called by ItemAnimator implementations to notify any listeners that all pending and active item animations are finished.

<br />

### endAnimation

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void endAnimation (RecyclerView.ViewHolder item)
```

Method called when an animation on a view should be ended immediately. This could happen when other events, like scrolling, occur, so that animating views can be quickly put into their proper end locations. Implementations should ensure that any animations running on the item are canceled and affected properties are set to their end values. Also,[dispatchAnimationFinished(ViewHolder)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#dispatchAnimationFinished(android.support.v7.widget.RecyclerView.ViewHolder))should be called for each finished animation since the animations are effectively done when this method is called.

<br />

|                                          Parameters                                          ||
|--------|--------------------------------------------------------------------------------------|
| `item` | `RecyclerView.ViewHolder`: The item for which an animation should be stopped. <br /> |

### endAnimations

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void endAnimations ()
```

Method called when all item animations should be ended immediately. This could happen when other events, like scrolling, occur, so that animating views can be quickly put into their proper end locations. Implementations should ensure that any animations running on any items are canceled and affected properties are set to their end values. Also,[dispatchAnimationFinished(ViewHolder)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#dispatchAnimationFinished(android.support.v7.widget.RecyclerView.ViewHolder))should be called for each finished animation since the animations are effectively done when this method is called.

<br />

### getAddDuration

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
long getAddDuration ()
```

Gets the current duration for which all add animations will run.

<br />

|                 Returns                 ||
|--------|---------------------------------|
| `long` | The current add duration <br /> |

### getChangeDuration

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
long getChangeDuration ()
```

Gets the current duration for which all change animations will run.

<br />

|                  Returns                   ||
|--------|------------------------------------|
| `long` | The current change duration <br /> |

### getMoveDuration

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
long getMoveDuration ()
```

Gets the current duration for which all move animations will run.

<br />

|                 Returns                  ||
|--------|----------------------------------|
| `long` | The current move duration <br /> |

### getRemoveDuration

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
long getRemoveDuration ()
```

Gets the current duration for which all remove animations will run.

<br />

|                  Returns                   ||
|--------|------------------------------------|
| `long` | The current remove duration <br /> |

### isRunning

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean isRunning ()
```

Method which returns whether there are any item animations currently running. This method can be used to determine whether to delay other actions until animations end.

<br />

|                                           Returns                                           ||
|-----------|----------------------------------------------------------------------------------|
| `boolean` | true if there are any item animations currently running, false otherwise. <br /> |

### isRunning

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean isRunning (RecyclerView.ItemAnimator.ItemAnimatorFinishedListener listener)
```

Like[isRunning()](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#isRunning()), this method returns whether there are any item animations currently running. Additionally, the listener passed in will be called when there are no item animations running, either immediately (before the method returns) if no animations are currently running, or when the currently running animations are[finished](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#dispatchAnimationsFinished()).

Note that the listener is transient - it is either called immediately and not stored at all, or stored only until it is called when running animations are finished sometime later.

<br />

<br />

|                                                                                                                                                                               Parameters                                                                                                                                                                                ||
|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `listener` | `RecyclerView.ItemAnimator.ItemAnimatorFinishedListener`: A listener to be called immediately if no animations are running or later when currently-running animations have finished. A null listener is equivalent to calling[isRunning()](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#isRunning()). <br /> |

|                                           Returns                                           ||
|-----------|----------------------------------------------------------------------------------|
| `boolean` | true if there are any item animations currently running, false otherwise. <br /> |

### obtainHolderInfo

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
RecyclerView.ItemAnimator.ItemHolderInfo obtainHolderInfo ()
```

Returns a new[RecyclerView.ItemAnimator.ItemHolderInfo](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator.ItemHolderInfo)which will be used to store information about the ViewHolder. This information will later be passed into`animate**`methods.

You can override this method if you want to extend[RecyclerView.ItemAnimator.ItemHolderInfo](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator.ItemHolderInfo)and provide your own instances.

<br />

|                                                                                                                                                           Returns                                                                                                                                                           ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [RecyclerView.ItemAnimator.ItemHolderInfo](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator.ItemHolderInfo) | A new[RecyclerView.ItemAnimator.ItemHolderInfo](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator.ItemHolderInfo). <br /> |

### onAnimationFinished

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onAnimationFinished (RecyclerView.ViewHolder viewHolder)
```

Called after[dispatchAnimationFinished(ViewHolder)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#dispatchAnimationFinished(android.support.v7.widget.RecyclerView.ViewHolder))is called by the ItemAnimator.

<br />

|                                                                          Parameters                                                                           ||
|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------|
| `viewHolder` | `RecyclerView.ViewHolder`: The ViewHolder whose animation is finished. There might still be other animations running on this ViewHolder. <br /> |

**See also:**

- [dispatchAnimationFinished(ViewHolder)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#dispatchAnimationFinished(android.support.v7.widget.RecyclerView.ViewHolder))  

### onAnimationStarted

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onAnimationStarted (RecyclerView.ViewHolder viewHolder)
```

Called when a new animation is started on the given ViewHolder.

<br />

|                                                                                    Parameters                                                                                    ||
|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `viewHolder` | `RecyclerView.ViewHolder`: The ViewHolder which started animating. Note that the ViewHolder might already be animating and this might be another animation. <br /> |

**See also:**

- [dispatchAnimationStarted(ViewHolder)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#dispatchAnimationStarted(android.support.v7.widget.RecyclerView.ViewHolder))  

### recordPostLayoutInformation

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
RecyclerView.ItemAnimator.ItemHolderInfo recordPostLayoutInformation (RecyclerView.State state, 
                RecyclerView.ViewHolder viewHolder)
```

Called by the RecyclerView after the layout is complete. Item animator should record necessary information about the View's final state.

The data returned from this method will be passed to the related`animate**`methods.

The default implementation returns an[RecyclerView.ItemAnimator.ItemHolderInfo](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator.ItemHolderInfo)which holds the bounds of the View.

<br />

|                                                                       Parameters                                                                       ||
|--------------|------------------------------------------------------------------------------------------------------------------------------------------|
| `state`      | `RecyclerView.State`: The current State of RecyclerView which includes some useful data about the layout that will be calculated. <br /> |
| `viewHolder` | `RecyclerView.ViewHolder`: The ViewHolder whose information should be recorded. <br />                                                   |

|                                                                                                                                                                             Returns                                                                                                                                                                              ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [RecyclerView.ItemAnimator.ItemHolderInfo](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator.ItemHolderInfo) | An ItemHolderInfo that preserves necessary information about the ViewHolder. This object will be passed back to related`animate**`methods when RecyclerView decides how items should be animated. <br /> |

**See also:**

- [recordPreLayoutInformation(State, ViewHolder, int, List)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#recordPreLayoutInformation(android.support.v7.widget.RecyclerView.State, android.support.v7.widget.RecyclerView.ViewHolder, int, java.util.List<java.lang.Object>))
- [animateAppearance(ViewHolder, ItemHolderInfo, ItemHolderInfo)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#animateAppearance(android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo))
- [animateDisappearance(ViewHolder, ItemHolderInfo, ItemHolderInfo)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#animateDisappearance(android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo))
- [animateChange(ViewHolder, ViewHolder, ItemHolderInfo, ItemHolderInfo)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#animateChange(android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo))
- [animatePersistence(ViewHolder, ItemHolderInfo, ItemHolderInfo)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#animatePersistence(android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo))  

### recordPreLayoutInformation

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
RecyclerView.ItemAnimator.ItemHolderInfo recordPreLayoutInformation (RecyclerView.State state, 
                RecyclerView.ViewHolder viewHolder, 
                int changeFlags, 
                List<Object> payloads)
```

Called by the RecyclerView before the layout begins. Item animator should record necessary information about the View before it is potentially rebound, moved or removed.

The data returned from this method will be passed to the related`animate**`methods.

Note that this method may be called after pre-layout phase if LayoutManager adds new Views to the layout in pre-layout pass.

The default implementation returns an[RecyclerView.ItemAnimator.ItemHolderInfo](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator.ItemHolderInfo)which holds the bounds of the View and the adapter change flags.

<br />

|                                                                                                                                                                                                              Parameters                                                                                                                                                                                                               ||
|---------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `state`       | `RecyclerView.State`: The current State of RecyclerView which includes some useful data about the layout that will be calculated. <br />                                                                                                                                                                                                                                                                               |
| `viewHolder`  | `RecyclerView.ViewHolder`: The ViewHolder whose information should be recorded. <br />                                                                                                                                                                                                                                                                                                                                 |
| `changeFlags` | `int`: Additional information about what changes happened in the Adapter about the Item represented by this ViewHolder. For instance, if item is deleted from the adapter,[FLAG_REMOVED](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#FLAG_REMOVED)will be set. <br />                                                                                                  |
| `payloads`    | `List`: The payload list that was previously passed to[notifyItemChanged(int, Object)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter#notifyItemChanged(int, java.lang.Object))or[notifyItemRangeChanged(int, int, Object)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter#notifyItemRangeChanged(int, int, java.lang.Object)). <br /> |

|                                                                                                                                                                   Returns                                                                                                                                                                   ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [RecyclerView.ItemAnimator.ItemHolderInfo](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator.ItemHolderInfo) | An ItemHolderInfo instance that preserves necessary information about the ViewHolder. This object will be passed back to related`animate**`methods after layout is complete. <br /> |

**See also:**

- [recordPostLayoutInformation(State, ViewHolder)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#recordPostLayoutInformation(android.support.v7.widget.RecyclerView.State, android.support.v7.widget.RecyclerView.ViewHolder))
- [animateAppearance(ViewHolder, ItemHolderInfo, ItemHolderInfo)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#animateAppearance(android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo))
- [animateDisappearance(ViewHolder, ItemHolderInfo, ItemHolderInfo)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#animateDisappearance(android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo))
- [animateChange(ViewHolder, ViewHolder, ItemHolderInfo, ItemHolderInfo)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#animateChange(android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo))
- [animatePersistence(ViewHolder, ItemHolderInfo, ItemHolderInfo)](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#animatePersistence(android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo))  

### runPendingAnimations

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void runPendingAnimations ()
```

Called when there are pending animations waiting to be started. This state is governed by the return values from[animateAppearance()](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#animateAppearance(android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo)),[animateChange()](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#animateChange(android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo))[animatePersistence()](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#animatePersistence(android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo)), and[animateDisappearance()](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator#animateDisappearance(android.support.v7.widget.RecyclerView.ViewHolder, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo, android.support.v7.widget.RecyclerView.ItemAnimator.ItemHolderInfo)), which inform the RecyclerView that the ItemAnimator wants to be called later to start the associated animations. runPendingAnimations() will be scheduled to be run on the next frame.

<br />

### setAddDuration

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void setAddDuration (long addDuration)
```

Sets the duration for which all add animations will run.

<br />

|                   Parameters                   ||
|---------------|---------------------------------|
| `addDuration` | `long`: The add duration <br /> |

### setChangeDuration

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void setChangeDuration (long changeDuration)
```

Sets the duration for which all change animations will run.

<br />

|                      Parameters                      ||
|------------------|------------------------------------|
| `changeDuration` | `long`: The change duration <br /> |

### setMoveDuration

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void setMoveDuration (long moveDuration)
```

Sets the duration for which all move animations will run.

<br />

|                    Parameters                    ||
|----------------|----------------------------------|
| `moveDuration` | `long`: The move duration <br /> |

### setRemoveDuration

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void setRemoveDuration (long removeDuration)
```

Sets the duration for which all remove animations will run.

<br />

|                      Parameters                      ||
|------------------|------------------------------------|
| `removeDuration` | `long`: The remove duration <br /> |

-

  ## Annotations

  - [RecyclerView.EdgeEffectFactory.EdgeDirection](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.EdgeEffectFactory.EdgeDirection)
  - [RecyclerView.ItemAnimator.AdapterChanges](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator.AdapterChanges)
-

  ## Interfaces

  - [ActionMenuView.OnMenuItemClickListener](https://developer.android.com/reference/android/support/v7/widget/ActionMenuView.OnMenuItemClickListener)
  - [PopupMenu.OnDismissListener](https://developer.android.com/reference/android/support/v7/widget/PopupMenu.OnDismissListener)
  - [PopupMenu.OnMenuItemClickListener](https://developer.android.com/reference/android/support/v7/widget/PopupMenu.OnMenuItemClickListener)
  - [RecyclerView.ChildDrawingOrderCallback](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ChildDrawingOrderCallback)
  - [RecyclerView.ItemAnimator.ItemAnimatorFinishedListener](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator.ItemAnimatorFinishedListener)
  - [RecyclerView.LayoutManager.LayoutPrefetchRegistry](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.LayoutManager.LayoutPrefetchRegistry)
  - [RecyclerView.OnChildAttachStateChangeListener](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.OnChildAttachStateChangeListener)
  - [RecyclerView.OnItemTouchListener](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.OnItemTouchListener)
  - [RecyclerView.RecyclerListener](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.RecyclerListener)
  - [RecyclerView.SmoothScroller.ScrollVectorProvider](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.SmoothScroller.ScrollVectorProvider)
  - [SearchView.OnCloseListener](https://developer.android.com/reference/android/support/v7/widget/SearchView.OnCloseListener)
  - [SearchView.OnQueryTextListener](https://developer.android.com/reference/android/support/v7/widget/SearchView.OnQueryTextListener)
  - [SearchView.OnSuggestionListener](https://developer.android.com/reference/android/support/v7/widget/SearchView.OnSuggestionListener)
  - [ShareActionProvider.OnShareTargetSelectedListener](https://developer.android.com/reference/android/support/v7/widget/ShareActionProvider.OnShareTargetSelectedListener)
  - [ThemedSpinnerAdapter](https://developer.android.com/reference/android/support/v7/widget/ThemedSpinnerAdapter)
  - [Toolbar.OnMenuItemClickListener](https://developer.android.com/reference/android/support/v7/widget/Toolbar.OnMenuItemClickListener)
-

  ## Classes

  - [ActionMenuView](https://developer.android.com/reference/android/support/v7/widget/ActionMenuView)
  - [ActionMenuView.LayoutParams](https://developer.android.com/reference/android/support/v7/widget/ActionMenuView.LayoutParams)
  - [AppCompatAutoCompleteTextView](https://developer.android.com/reference/android/support/v7/widget/AppCompatAutoCompleteTextView)
  - [AppCompatButton](https://developer.android.com/reference/android/support/v7/widget/AppCompatButton)
  - [AppCompatCheckBox](https://developer.android.com/reference/android/support/v7/widget/AppCompatCheckBox)
  - [AppCompatCheckedTextView](https://developer.android.com/reference/android/support/v7/widget/AppCompatCheckedTextView)
  - [AppCompatEditText](https://developer.android.com/reference/android/support/v7/widget/AppCompatEditText)
  - [AppCompatImageButton](https://developer.android.com/reference/android/support/v7/widget/AppCompatImageButton)
  - [AppCompatImageView](https://developer.android.com/reference/android/support/v7/widget/AppCompatImageView)
  - [AppCompatMultiAutoCompleteTextView](https://developer.android.com/reference/android/support/v7/widget/AppCompatMultiAutoCompleteTextView)
  - [AppCompatRadioButton](https://developer.android.com/reference/android/support/v7/widget/AppCompatRadioButton)
  - [AppCompatRatingBar](https://developer.android.com/reference/android/support/v7/widget/AppCompatRatingBar)
  - [AppCompatSeekBar](https://developer.android.com/reference/android/support/v7/widget/AppCompatSeekBar)
  - [AppCompatSpinner](https://developer.android.com/reference/android/support/v7/widget/AppCompatSpinner)
  - [AppCompatTextView](https://developer.android.com/reference/android/support/v7/widget/AppCompatTextView)
  - [CardView](https://developer.android.com/reference/android/support/v7/widget/CardView)
  - [DefaultItemAnimator](https://developer.android.com/reference/android/support/v7/widget/DefaultItemAnimator)
  - [DividerItemDecoration](https://developer.android.com/reference/android/support/v7/widget/DividerItemDecoration)
  - [GridLayout](https://developer.android.com/reference/android/support/v7/widget/GridLayout)
  - [GridLayout.Alignment](https://developer.android.com/reference/android/support/v7/widget/GridLayout.Alignment)
  - [GridLayout.LayoutParams](https://developer.android.com/reference/android/support/v7/widget/GridLayout.LayoutParams)
  - [GridLayout.Spec](https://developer.android.com/reference/android/support/v7/widget/GridLayout.Spec)
  - [GridLayoutManager](https://developer.android.com/reference/android/support/v7/widget/GridLayoutManager)
  - [GridLayoutManager.DefaultSpanSizeLookup](https://developer.android.com/reference/android/support/v7/widget/GridLayoutManager.DefaultSpanSizeLookup)
  - [GridLayoutManager.LayoutParams](https://developer.android.com/reference/android/support/v7/widget/GridLayoutManager.LayoutParams)
  - [GridLayoutManager.SpanSizeLookup](https://developer.android.com/reference/android/support/v7/widget/GridLayoutManager.SpanSizeLookup)
  - [LinearLayoutCompat](https://developer.android.com/reference/android/support/v7/widget/LinearLayoutCompat)
  - [LinearLayoutCompat.LayoutParams](https://developer.android.com/reference/android/support/v7/widget/LinearLayoutCompat.LayoutParams)
  - [LinearLayoutManager](https://developer.android.com/reference/android/support/v7/widget/LinearLayoutManager)
  - [LinearLayoutManager.LayoutChunkResult](https://developer.android.com/reference/android/support/v7/widget/LinearLayoutManager.LayoutChunkResult)
  - [LinearSmoothScroller](https://developer.android.com/reference/android/support/v7/widget/LinearSmoothScroller)
  - [LinearSnapHelper](https://developer.android.com/reference/android/support/v7/widget/LinearSnapHelper)
  - [ListPopupWindow](https://developer.android.com/reference/android/support/v7/widget/ListPopupWindow)
  - [OrientationHelper](https://developer.android.com/reference/android/support/v7/widget/OrientationHelper)
  - [PagerSnapHelper](https://developer.android.com/reference/android/support/v7/widget/PagerSnapHelper)
  - [PopupMenu](https://developer.android.com/reference/android/support/v7/widget/PopupMenu)
  - [RecyclerView](https://developer.android.com/reference/android/support/v7/widget/RecyclerView)
  - [RecyclerView.Adapter](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter)
  - [RecyclerView.AdapterDataObserver](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.AdapterDataObserver)
  - [RecyclerView.EdgeEffectFactory](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.EdgeEffectFactory)
  - [RecyclerView.ItemAnimator](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator)
  - [RecyclerView.ItemAnimator.ItemHolderInfo](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator.ItemHolderInfo)
  - [RecyclerView.ItemDecoration](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemDecoration)
  - [RecyclerView.LayoutManager](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.LayoutManager)
  - [RecyclerView.LayoutManager.Properties](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.LayoutManager.Properties)
  - [RecyclerView.LayoutParams](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.LayoutParams)
  - [RecyclerView.OnFlingListener](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.OnFlingListener)
  - [RecyclerView.OnScrollListener](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.OnScrollListener)
  - [RecyclerView.RecycledViewPool](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.RecycledViewPool)
  - [RecyclerView.Recycler](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Recycler)
  - [RecyclerView.SimpleOnItemTouchListener](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.SimpleOnItemTouchListener)
  - [RecyclerView.SmoothScroller](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.SmoothScroller)
  - [RecyclerView.SmoothScroller.Action](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.SmoothScroller.Action)
  - [RecyclerView.State](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.State)
  - [RecyclerView.ViewCacheExtension](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ViewCacheExtension)
  - [RecyclerView.ViewHolder](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ViewHolder)
  - [RecyclerViewAccessibilityDelegate](https://developer.android.com/reference/android/support/v7/widget/RecyclerViewAccessibilityDelegate)
  - [RecyclerViewAccessibilityDelegate.ItemDelegate](https://developer.android.com/reference/android/support/v7/widget/RecyclerViewAccessibilityDelegate.ItemDelegate)
  - [SearchView](https://developer.android.com/reference/android/support/v7/widget/SearchView)
  - [ShareActionProvider](https://developer.android.com/reference/android/support/v7/widget/ShareActionProvider)
  - [SimpleItemAnimator](https://developer.android.com/reference/android/support/v7/widget/SimpleItemAnimator)
  - [SnapHelper](https://developer.android.com/reference/android/support/v7/widget/SnapHelper)
  - [StaggeredGridLayoutManager](https://developer.android.com/reference/android/support/v7/widget/StaggeredGridLayoutManager)
  - [StaggeredGridLayoutManager.LayoutParams](https://developer.android.com/reference/android/support/v7/widget/StaggeredGridLayoutManager.LayoutParams)
  - [SwitchCompat](https://developer.android.com/reference/android/support/v7/widget/SwitchCompat)
  - [ThemedSpinnerAdapter.Helper](https://developer.android.com/reference/android/support/v7/widget/ThemedSpinnerAdapter.Helper)
  - [Toolbar](https://developer.android.com/reference/android/support/v7/widget/Toolbar)
  - [Toolbar.LayoutParams](https://developer.android.com/reference/android/support/v7/widget/Toolbar.LayoutParams)
  - [Toolbar.SavedState](https://developer.android.com/reference/android/support/v7/widget/Toolbar.SavedState)
  - [TooltipCompat](https://developer.android.com/reference/android/support/v7/widget/TooltipCompat)