# LayoutAnimationController

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Nested Classes](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#nestedclasses)\|[XML Attrs](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#lattrs)\|[Constants](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#constants)\|[Fields](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#lfields)\|[Ctors](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#pubctors)\|[Methods](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#pubmethods)\|[Protected Methods](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#promethods)\|[Inherited Methods](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#inhmethods)  

# LayoutAnimationController

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/view/animation/LayoutAnimationController "View this page in Kotlin")\|Java

`
public


class
LayoutAnimationController
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|--------------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.view.animation.LayoutAnimationController |

|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Known direct subclasses [GridLayoutAnimationController](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController) |-------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------| | [GridLayoutAnimationController](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController) | A layout animation controller is used to animated a grid layout's children. | |

<br />

*** ** * ** ***

A layout animation controller is used to animate the children of a layout or a view group. Each child uses the same animation but for every one of them, the animation starts at a different time. A layout animation controller is used by[ViewGroup](https://developer.android.com/reference/android/view/ViewGroup)to compute the delay by which each child's animation start must be offset. The delay is computed by using characteristics of each child, like its index in the view group. This standard implementation computes the delay by multiplying a fixed amount of miliseconds by the index of the child in its parent view group. Subclasses are supposed to override[getDelayForView(android.view.View)](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#getDelayForView(android.view.View))to implement a different way of computing the delay. For instance, a[GridLayoutAnimationController](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController)will compute the delay based on the column and row indices of the child in its parent view group. Information used to compute the animation delay of each child are stored in an instance of[LayoutAnimationController.AnimationParameters](https://developer.android.com/reference/android/view/animation/LayoutAnimationController.AnimationParameters), itself stored in the[ViewGroup.LayoutParams](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams)of the view.

## Summary

|                                                                                                                                             ### Nested classes                                                                                                                                              ||
|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` class` | [LayoutAnimationController.AnimationParameters](https://developer.android.com/reference/android/view/animation/LayoutAnimationController.AnimationParameters) The set of parameters that has to be attached to each view contained in the view group animated by the layout animation controller. |

|                                                                                                                ### XML attributes                                                                                                                ||
|--------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------|
| [`android:animation`](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#attr_android:animation)           | Animation to use on each child.                                                                |
| [`android:animationOrder`](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#attr_android:animationOrder) | The order in which the animations will be started.                                             |
| [`android:delay`](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#attr_android:delay)                   | Fraction of the animation duration used to delay the beginning of the animation of each child. |
| [`android:interpolator`](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#attr_android:interpolator)     | Interpolator used to interpolate the delay between the start of each animation.                |

|                                                                                                           ### Constants                                                                                                            ||
|-------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | [ORDER_NORMAL](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#ORDER_NORMAL) Distributes the animation delays in the order in which view were added to their view group.           |
| `int` | [ORDER_RANDOM](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#ORDER_RANDOM) Randomly distributes the animation delays.                                                            |
| `int` | [ORDER_REVERSE](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#ORDER_REVERSE) Distributes the animation delays in the reverse order in which view were added to their view group. |

|                                                                                                                                                             ### Fields                                                                                                                                                              ||
|----------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` protected `[Animation](https://developer.android.com/reference/android/view/animation/Animation)       | [mAnimation](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#mAnimation) The animation applied on each child of the view group on which this layout animation controller is set. |
| ` protected `[Interpolator](https://developer.android.com/reference/android/view/animation/Interpolator) | [mInterpolator](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#mInterpolator) The interpolator used to interpolate the delays.                                                  |
| ` protected `[Random](https://developer.android.com/reference/java/util/Random)                          | [mRandomizer](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#mRandomizer) The randomizer used when the order is set to random.                                                  |

|                                                                                                                                                                                                                      ### Public constructors                                                                                                                                                                                                                       ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[LayoutAnimationController](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#LayoutAnimationController(android.content.Context,%20android.util.AttributeSet))`(`[Context](https://developer.android.com/reference/android/content/Context)` context, `[AttributeSet](https://developer.android.com/reference/android/util/AttributeSet)` attrs) ` Creates a new layout animation controller from external resources. |
| ` `[LayoutAnimationController](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#LayoutAnimationController(android.view.animation.Animation))`(`[Animation](https://developer.android.com/reference/android/view/animation/Animation)` animation) ` Creates a new layout animation controller with a delay of 50% and the specified animation.                                                                           |
| ` `[LayoutAnimationController](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#LayoutAnimationController(android.view.animation.Animation,%20float))`(`[Animation](https://developer.android.com/reference/android/view/animation/Animation)` animation, float delay) ` Creates a new layout animation controller with the specified delay and the specified animation.                                                |

|                                                                                                                                                                                                                              ### Public methods                                                                                                                                                                                                                               ||
|------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[Animation](https://developer.android.com/reference/android/view/animation/Animation)       | ` `[getAnimation](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#getAnimation())`() ` Returns the animation applied to each child of the view group on which this controller is set.                                                                                                                                                |
| ` final `[Animation](https://developer.android.com/reference/android/view/animation/Animation) | ` `[getAnimationForView](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#getAnimationForView(android.view.View))`(`[View](https://developer.android.com/reference/android/view/View)` view) ` Returns the animation to be applied to the specified view.                                                                             |
| ` float`                                                                                       | ` `[getDelay](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#getDelay())`() ` Returns the delay by which the children's animation are offset.                                                                                                                                                                                       |
| ` `[Interpolator](https://developer.android.com/reference/android/view/animation/Interpolator) | ` `[getInterpolator](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#getInterpolator())`() ` Returns the interpolator used to interpolate the delays between the children.                                                                                                                                                           |
| ` int`                                                                                         | ` `[getOrder](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#getOrder())`() ` Returns the order used to compute the delay of each child's animation.                                                                                                                                                                                |
| ` boolean`                                                                                     | ` `[isDone](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#isDone())`() ` Indicates whether the layout animation is over or not.                                                                                                                                                                                                    |
| ` void`                                                                                        | ` `[setAnimation](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#setAnimation(android.view.animation.Animation))`(`[Animation](https://developer.android.com/reference/android/view/animation/Animation)` animation) ` Sets the animation to be run on each child of the view group on which this layout animation controller is .  |
| ` void`                                                                                        | ` `[setAnimation](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#setAnimation(android.content.Context,%20int))`(`[Context](https://developer.android.com/reference/android/content/Context)` context, int resourceID) ` Sets the animation to be run on each child of the view group on which this layout animation controller is . |
| ` void`                                                                                        | ` `[setDelay](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#setDelay(float))`(float delay) ` Sets the delay, as a fraction of the animation duration, by which the children's animations are offset.                                                                                                                               |
| ` void`                                                                                        | ` `[setInterpolator](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#setInterpolator(android.content.Context,%20int))`(`[Context](https://developer.android.com/reference/android/content/Context)` context, int resourceID) ` Sets the interpolator used to interpolate the delays between the children.                            |
| ` void`                                                                                        | ` `[setInterpolator](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#setInterpolator(android.view.animation.Interpolator))`(`[Interpolator](https://developer.android.com/reference/android/view/animation/Interpolator)` interpolator) ` Sets the interpolator used to interpolate the delays between the children.                 |
| ` void`                                                                                        | ` `[setOrder](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#setOrder(int))`(int order) ` Sets the order used to compute the delay of each child's animation.                                                                                                                                                                       |
| ` void`                                                                                        | ` `[start](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#start())`() ` Starts the animation.                                                                                                                                                                                                                                       |
| ` boolean`                                                                                     | ` `[willOverlap](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#willOverlap())`() ` Indicates whether two children's animations will overlap.                                                                                                                                                                                       |

|                                                                                                                                                                                                                                                                                                                                                         ### Protected methods                                                                                                                                                                                                                                                                                                                                                          ||
|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` long` | ` `[getDelayForView](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#getDelayForView(android.view.View))`(`[View](https://developer.android.com/reference/android/view/View)` view) ` Returns the amount of milliseconds by which the specified view's animation must be delayed or offset.                                                                                                                                                                                                                                                                                                                                                                                          |
| ` int`  | ` `[getTransformedIndex](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#getTransformedIndex(android.view.animation.LayoutAnimationController.AnimationParameters))`(`[LayoutAnimationController.AnimationParameters](https://developer.android.com/reference/android/view/animation/LayoutAnimationController.AnimationParameters)` params) ` Transforms the index stored in[LayoutAnimationController.AnimationParameters](https://developer.android.com/reference/android/view/animation/LayoutAnimationController.AnimationParameters)by the order returned by[getOrder()](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#getOrder()). |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## XML attributes

### android:animation

Animation to use on each child.

May be a reference to another resource, in the form "`@[+][`*package* `:]`*type* `/`*name*" or a theme attribute in the form "`?[`*package* `:]`*type* `/`*name*".

<br />

**Related methods:**

- [setAnimation(Context,int)](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#setAnimation(android.content.Context,%20int))

### android:animationOrder

The order in which the animations will be started.

Must be one of the following constant values.

| Constant | Value |                 Description                  |
|----------|-------|----------------------------------------------|
| normal   | 0     | Animations are started in the natural order. |
| random   | 2     | Animations are started randomly.             |
| reverse  | 1     | Animations are started in the reverse order. |

<br />

<br />

**Related methods:**

- [setOrder(int)](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#setOrder(int))

### android:delay

Fraction of the animation duration used to delay the beginning of the animation of each child.

May be a floating point value, such as "`1.2`".

May be a fractional value, which is a floating point number appended with either % or %p, such as "`14.5%`". The % suffix always means a percentage of the base size; the optional %p suffix provides a size relative to some parent container.

<br />

### android:interpolator

Interpolator used to interpolate the delay between the start of each animation.

May be a reference to another resource, in the form "`@[+][`*package* `:]`*type* `/`*name*" or a theme attribute in the form "`?[`*package* `:]`*type* `/`*name*".

<br />

**Related methods:**

- [setInterpolator(Interpolator)](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#setInterpolator(android.view.animation.Interpolator))

## Constants

### ORDER_NORMAL

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int ORDER_NORMAL
```

Distributes the animation delays in the order in which view were added to their view group.

<br />

Constant Value: 0 (0x00000000)  

### ORDER_RANDOM

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int ORDER_RANDOM
```

Randomly distributes the animation delays.

<br />

Constant Value: 2 (0x00000002)  

### ORDER_REVERSE

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int ORDER_REVERSE
```

Distributes the animation delays in the reverse order in which view were added to their view group.

<br />

Constant Value: 1 (0x00000001)

## Fields

### mAnimation

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
protected Animation mAnimation
```

The animation applied on each child of the view group on which this layout animation controller is set.

<br />

### mInterpolator

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
protected Interpolator mInterpolator
```

The interpolator used to interpolate the delays.

<br />

### mRandomizer

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
protected Random mRandomizer
```

The randomizer used when the order is set to random. Subclasses should use this object to avoid creating their own.

<br />

## Public constructors

### LayoutAnimationController

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public LayoutAnimationController (Context context, 
                AttributeSet attrs)
```

Creates a new layout animation controller from external resources.

<br />

|                                                    Parameters                                                     ||
|-----------|--------------------------------------------------------------------------------------------------------|
| `context` | `Context`: the Context the view group is running in, through which it can access the resources <br />  |
| `attrs`   | `AttributeSet`: the attributes of the XML tag that is inflating the layout animation controller <br /> |

### LayoutAnimationController

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public LayoutAnimationController (Animation animation)
```

Creates a new layout animation controller with a delay of 50% and the specified animation.

<br />

|                                      Parameters                                       ||
|-------------|--------------------------------------------------------------------------|
| `animation` | `Animation`: the animation to use on each child of the view group <br /> |

### LayoutAnimationController

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public LayoutAnimationController (Animation animation, 
                float delay)
```

Creates a new layout animation controller with the specified delay and the specified animation.

<br />

|                                      Parameters                                       ||
|-------------|--------------------------------------------------------------------------|
| `animation` | `Animation`: the animation to use on each child of the view group <br /> |
| `delay`     | `float`: the delay by which each child's animation must be offset <br /> |

## Public methods

### getAnimation

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public Animation getAnimation ()
```

Returns the animation applied to each child of the view group on which this controller is set.

<br />

|                                                                                            Returns                                                                                            ||
|---------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------|
| [Animation](https://developer.android.com/reference/android/view/animation/Animation) | an[Animation](https://developer.android.com/reference/android/view/animation/Animation)instance <br /> |

**See also:**

- [setAnimation(android.content.Context, int)](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#setAnimation(android.content.Context,%20int))
- [setAnimation(Animation)](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#setAnimation(android.view.animation.Animation))  

### getAnimationForView

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final Animation getAnimationForView (View view)
```

Returns the animation to be applied to the specified view. The returned animation is delayed by an offset computed according to the information provided by[LayoutAnimationController.AnimationParameters](https://developer.android.com/reference/android/view/animation/LayoutAnimationController.AnimationParameters). This method is called by view groups to obtain the animation to set on a specific child.

<br />

|                 Parameters                 ||
|--------|------------------------------------|
| `view` | `View`: the view to animate <br /> |

|                                                                                                                                                            Returns                                                                                                                                                            ||
|---------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Animation](https://developer.android.com/reference/android/view/animation/Animation) | an animation delayed by the number of milliseconds returned by[getDelayForView(android.view.View)](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#getDelayForView(android.view.View)) <br /> |

**See also:**

- [getDelay()](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#getDelay())
- [setDelay(float)](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#setDelay(float))
- [getDelayForView(android.view.View)](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#getDelayForView(android.view.View))  

### getDelay

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public float getDelay ()
```

Returns the delay by which the children's animation are offset. The delay is expressed as a fraction of the animation duration.

<br />

|                       Returns                        ||
|---------|---------------------------------------------|
| `float` | a fraction of the animation duration <br /> |

**See also:**

- [setDelay(float)](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#setDelay(float))  

### getInterpolator

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public Interpolator getInterpolator ()
```

Returns the interpolator used to interpolate the delays between the children.

<br />

|                                                                                              Returns                                                                                              ||
|---------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|
| [Interpolator](https://developer.android.com/reference/android/view/animation/Interpolator) | an[Interpolator](https://developer.android.com/reference/android/view/animation/Interpolator) <br /> |

### getOrder

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public int getOrder ()
```

Returns the order used to compute the delay of each child's animation.

<br />

**Related XML Attributes:**

- [android:animationOrder](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#attr_android:animationOrder)

|                                                                                                                                                                                         Returns                                                                                                                                                                                          ||
|-------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | one of[ORDER_NORMAL](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#ORDER_NORMAL),[ORDER_REVERSE](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#ORDER_REVERSE)or[ORDER_RANDOM](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#ORDER_RANDOM) <br /> |

### isDone

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean isDone ()
```

Indicates whether the layout animation is over or not. A layout animation is considered done when the animation with the longest delay is done.

<br />

|                                       Returns                                        ||
|-----------|---------------------------------------------------------------------------|
| `boolean` | true if all of the children's animations are over, false otherwise <br /> |

### setAnimation

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void setAnimation (Animation animation)
```

Sets the animation to be run on each child of the view group on which this layout animation controller is .

<br />

**Related XML Attributes:**

- [android:animation](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#attr_android:animation)

|                                      Parameters                                       ||
|-------------|--------------------------------------------------------------------------|
| `animation` | `Animation`: the animation to run on each child of the view group <br /> |

**See also:**

- [setAnimation(android.content.Context, int)](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#setAnimation(android.content.Context,%20int))
- [getAnimation()](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#getAnimation())  

### setAnimation

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void setAnimation (Context context, 
                int resourceID)
```

Sets the animation to be run on each child of the view group on which this layout animation controller is .

<br />

**Related XML Attributes:**

- [android:animation](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#attr_android:animation)

|                                      Parameters                                       ||
|--------------|-------------------------------------------------------------------------|
| `context`    | `Context`: the context from which the animation must be inflated <br /> |
| `resourceID` | `int`: the resource identifier of the animation <br />                  |

**See also:**

- [setAnimation(Animation)](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#setAnimation(android.view.animation.Animation))
- [getAnimation()](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#getAnimation())  

### setDelay

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void setDelay (float delay)
```

Sets the delay, as a fraction of the animation duration, by which the children's animations are offset. The general formula is:  

```
 child animation delay = child index * delay * animation duration
 
```

<br />

<br />

|                          Parameters                           ||
|---------|------------------------------------------------------|
| `delay` | `float`: a fraction of the animation duration <br /> |

**See also:**

- [getDelay()](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#getDelay())  

### setInterpolator

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void setInterpolator (Context context, 
                int resourceID)
```

Sets the interpolator used to interpolate the delays between the children.

<br />

**Related XML Attributes:**

- [android:interpolator](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#attr_android:interpolator)

|                                        Parameters                                        ||
|--------------|----------------------------------------------------------------------------|
| `context`    | `Context`: the context from which the interpolator must be inflated <br /> |
| `resourceID` | `int`: the resource identifier of the interpolator <br />                  |

**See also:**

- [getInterpolator()](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#getInterpolator())
- [setInterpolator(Interpolator)](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#setInterpolator(android.view.animation.Interpolator))  

### setInterpolator

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void setInterpolator (Interpolator interpolator)
```

Sets the interpolator used to interpolate the delays between the children.

<br />

**Related XML Attributes:**

- [android:interpolator](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#attr_android:interpolator)

|                       Parameters                        ||
|----------------|-----------------------------------------|
| `interpolator` | `Interpolator`: the interpolator <br /> |

**See also:**

- [getInterpolator()](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#getInterpolator())
- [setInterpolator(Interpolator)](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#setInterpolator(android.view.animation.Interpolator))  

### setOrder

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void setOrder (int order)
```

Sets the order used to compute the delay of each child's animation.

<br />

**Related XML Attributes:**

- [android:animationOrder](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#attr_android:animationOrder)

|                                                                                                                                                                                            Parameters                                                                                                                                                                                             ||
|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `order` | `int`: one of[ORDER_NORMAL](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#ORDER_NORMAL),[ORDER_REVERSE](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#ORDER_REVERSE)or[ORDER_RANDOM](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#ORDER_RANDOM) <br /> |

### start

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void start ()
```

Starts the animation.

<br />

### willOverlap

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean willOverlap ()
```

Indicates whether two children's animations will overlap. Animations overlap when the delay is lower than 100% (or 1.0).

<br />

|                              Returns                               ||
|-----------|---------------------------------------------------------|
| `boolean` | true if animations will overlap, false otherwise <br /> |

## Protected methods

### getDelayForView

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
protected long getDelayForView (View view)
```

Returns the amount of milliseconds by which the specified view's animation must be delayed or offset. Subclasses should override this method to return a suitable value. This implementation returns`child animation delay`milliseconds where:  

```
 child animation delay = child index * delay
 
```
The index is retrieved from the[LayoutAnimationController.AnimationParameters](https://developer.android.com/reference/android/view/animation/LayoutAnimationController.AnimationParameters)found in the view's[ViewGroup.LayoutParams](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams).

<br />

<br />

|                                Parameters                                 ||
|--------|-------------------------------------------------------------------|
| `view` | `View`: the view for which to obtain the animation's delay <br /> |

|                Returns                 ||
|--------|--------------------------------|
| `long` | a delay in milliseconds <br /> |

**See also:**

- [getAnimationForView(android.view.View)](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#getAnimationForView(android.view.View))
- [getDelay()](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#getDelay())
- [getTransformedIndex(android.view.animation.LayoutAnimationController.AnimationParameters)](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#getTransformedIndex(android.view.animation.LayoutAnimationController.AnimationParameters))
- [ViewGroup.LayoutParams](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams)  

### getTransformedIndex

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
protected int getTransformedIndex (LayoutAnimationController.AnimationParameters params)
```

Transforms the index stored in[LayoutAnimationController.AnimationParameters](https://developer.android.com/reference/android/view/animation/LayoutAnimationController.AnimationParameters)by the order returned by[getOrder()](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#getOrder()). Subclasses should override this method to provide additional support for other types of ordering. This method should be invoked by[getDelayForView(android.view.View)](https://developer.android.com/reference/android/view/animation/LayoutAnimationController#getDelayForView(android.view.View))prior to any computation.

<br />

|                                                   Parameters                                                    ||
|----------|-------------------------------------------------------------------------------------------------------|
| `params` | `LayoutAnimationController.AnimationParameters`: the animation parameters containing the index <br /> |

|              Returns              ||
|-------|----------------------------|
| `int` | a transformed index <br /> |