# GridLayoutAnimationController

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/GridLayoutAnimationController#nestedclasses)\|[XML Attrs](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#lattrs)\|[Inherited XML Attrs](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#inhattrs)\|[Constants](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#constants)\|[Inherited Constants](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#inhconstants)\|[Inherited Fields](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#inhfields)\|[Ctors](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#pubctors)\|[Methods](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#pubmethods)\|[Protected Methods](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#promethods)\|[Inherited Methods](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#inhmethods)  

# GridLayoutAnimationController

*** ** * ** ***

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

`
public


class
GridLayoutAnimationController
`  
`


``

extends `[LayoutAnimationController](https://developer.android.com/reference/android/view/animation/LayoutAnimationController)`


``


`

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

<br />

*** ** * ** ***

A layout animation controller is used to animated a grid layout's children. While[LayoutAnimationController](https://developer.android.com/reference/android/view/animation/LayoutAnimationController)relies only on the index of the child in the view group to compute the animation delay, this class uses both the X and Y coordinates of the child within a grid. In addition, the animation direction can be controlled. The default direction is`DIRECTION_LEFT_TO_RIGHT | DIRECTION_TOP_TO_BOTTOM`. You can also set the animation priority to columns or rows. The default priority is none. Information used to compute the animation delay of each child are stored in an instance of[GridLayoutAnimationController.AnimationParameters](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController.AnimationParameters), itself stored in the[ViewGroup.LayoutParams](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams)of the view.  
**See also:**

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

## Summary

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

|                                                                                                                     ### XML attributes                                                                                                                      ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------|
| [`android:columnDelay`](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#attr_android:columnDelay)             | Fraction of the animation duration used to delay the beginning of the animation of each column. |
| [`android:direction`](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#attr_android:direction)                 | Direction of the animation in the grid.                                                         |
| [`android:directionPriority`](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#attr_android:directionPriority) | Priority of the rows and columns.                                                               |
| [`android:rowDelay`](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#attr_android:rowDelay)                   | Fraction of the animation duration used to delay the beginning of the animation of each row.    |

| ### Inherited XML attributes |
|------------------------------|---|
| From class[android.view.animation.LayoutAnimationController](https://developer.android.com/reference/android/view/animation/LayoutAnimationController) |--------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------| | [`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` | [DIRECTION_BOTTOM_TO_TOP](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#DIRECTION_BOTTOM_TO_TOP) Animates the children starting from the bottom of the grid to the top.  |
| `int` | [DIRECTION_HORIZONTAL_MASK](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#DIRECTION_HORIZONTAL_MASK) Bitmask used to retrieve the horizontal component of the direction. |
| `int` | [DIRECTION_LEFT_TO_RIGHT](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#DIRECTION_LEFT_TO_RIGHT) Animates the children starting from the left of the grid to the right.  |
| `int` | [DIRECTION_RIGHT_TO_LEFT](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#DIRECTION_RIGHT_TO_LEFT) Animates the children starting from the right of the grid to the left.  |
| `int` | [DIRECTION_TOP_TO_BOTTOM](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#DIRECTION_TOP_TO_BOTTOM) Animates the children starting from the top of the grid to the bottom.  |
| `int` | [DIRECTION_VERTICAL_MASK](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#DIRECTION_VERTICAL_MASK) Bitmask used to retrieve the vertical component of the direction.       |
| `int` | [PRIORITY_COLUMN](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#PRIORITY_COLUMN) Columns are animated first.                                                             |
| `int` | [PRIORITY_NONE](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#PRIORITY_NONE) Rows and columns are animated at the same time.                                             |
| `int` | [PRIORITY_ROW](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#PRIORITY_ROW) Rows are animated first.                                                                      |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ### Inherited constants                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From class[android.view.animation.LayoutAnimationController](https://developer.android.com/reference/android/view/animation/LayoutAnimationController) |-------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `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. | |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ### Inherited fields                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From class[android.view.animation.LayoutAnimationController](https://developer.android.com/reference/android/view/animation/LayoutAnimationController) |----------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` 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                                                                                                                                                                                                                               ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[GridLayoutAnimationController](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#GridLayoutAnimationController(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 grid layout animation controller from external resources. |
| ` `[GridLayoutAnimationController](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#GridLayoutAnimationController(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% for both rows and columns and the specified animation.                                                      |
| ` `[GridLayoutAnimationController](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#GridLayoutAnimationController(android.view.animation.Animation,%20float,%20float))`(`[Animation](https://developer.android.com/reference/android/view/animation/Animation)` animation, float columnDelay, float rowDelay) ` Creates a new layout animation controller with the specified delays and the specified animation.                     |

|                                                                                                                                               ### Public methods                                                                                                                                               ||
|------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` float`   | ` `[getColumnDelay](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#getColumnDelay())`() ` Returns the delay by which the children's animation are offset from one column to the other.                                                               |
| ` int`     | ` `[getDirection](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#getDirection())`() ` Returns the direction of the animation.                                                                                                                        |
| ` int`     | ` `[getDirectionPriority](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#getDirectionPriority())`() ` Returns the direction priority for the animation.                                                                                              |
| ` float`   | ` `[getRowDelay](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#getRowDelay())`() ` Returns the delay by which the children's animation are offset from one row to the other.                                                                        |
| ` void`    | ` `[setColumnDelay](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#setColumnDelay(float))`(float columnDelay) ` Sets the delay, as a fraction of the animation duration, by which the children's animations are offset from one column to the other. |
| ` void`    | ` `[setDirection](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#setDirection(int))`(int direction) ` Sets the direction of the animation.                                                                                                           |
| ` void`    | ` `[setDirectionPriority](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#setDirectionPriority(int))`(int directionPriority) ` Specifies the direction priority of the animation.                                                                     |
| ` void`    | ` `[setRowDelay](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#setRowDelay(float))`(float rowDelay) ` Sets the delay, as a fraction of the animation duration, by which the children's animations are offset from one row to the other.             |
| ` boolean` | ` `[willOverlap](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#willOverlap())`() ` Indicates whether two children's animations will overlap.                                                                                                        |

|                                                                                                                                                               ### Protected methods                                                                                                                                                               ||
|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` long` | ` `[getDelayForView](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#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. |

| ### Inherited methods |
|-----------------------|---|
| From class` `[android.view.animation.LayoutAnimationController](https://developer.android.com/reference/android/view/animation/LayoutAnimationController)` ` |------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[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.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | | ` 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.                                                                                                                                                                                                                                                                                                                                                                                          | | ` `[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.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | | ` 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()). | | ` 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.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | ||
| 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:columnDelay

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

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:direction

Direction of the animation in the grid.

Must be one or more (separated by '\|') of the following constant values.

|   Constant    | Value |             Description              |
|---------------|-------|--------------------------------------|
| bottom_to_top | 2     | Animates rows from bottom to top.    |
| left_to_right | 0     | Animates columns from left to right. |
| right_to_left | 1     | Animates columns from right to left. |
| top_to_bottom | 0     | Animates rows from top to bottom.    |

<br />

<br />

### android:directionPriority

Priority of the rows and columns. When the priority is none, both rows and columns have the same priority. When the priority is column, the animations will be applied on the columns first. The same goes for rows.

Must be one of the following constant values.

| Constant | Value |                   Description                   |
|----------|-------|-------------------------------------------------|
| column   | 1     | Columns are animated first.                     |
| none     | 0     | Rows and columns are animated at the same time. |
| row      | 2     | Rows are animated first.                        |

<br />

<br />

### android:rowDelay

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

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 />

## Constants

### DIRECTION_BOTTOM_TO_TOP

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

```
public static final int DIRECTION_BOTTOM_TO_TOP
```

Animates the children starting from the bottom of the grid to the top.

<br />

Constant Value: 2 (0x00000002)  

### DIRECTION_HORIZONTAL_MASK

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

```
public static final int DIRECTION_HORIZONTAL_MASK
```

Bitmask used to retrieve the horizontal component of the direction.

<br />

Constant Value: 1 (0x00000001)  

### DIRECTION_LEFT_TO_RIGHT

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

```
public static final int DIRECTION_LEFT_TO_RIGHT
```

Animates the children starting from the left of the grid to the right.

<br />

Constant Value: 0 (0x00000000)  

### DIRECTION_RIGHT_TO_LEFT

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

```
public static final int DIRECTION_RIGHT_TO_LEFT
```

Animates the children starting from the right of the grid to the left.

<br />

Constant Value: 1 (0x00000001)  

### DIRECTION_TOP_TO_BOTTOM

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

```
public static final int DIRECTION_TOP_TO_BOTTOM
```

Animates the children starting from the top of the grid to the bottom.

<br />

Constant Value: 0 (0x00000000)  

### DIRECTION_VERTICAL_MASK

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

```
public static final int DIRECTION_VERTICAL_MASK
```

Bitmask used to retrieve the vertical component of the direction.

<br />

Constant Value: 2 (0x00000002)  

### PRIORITY_COLUMN

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

```
public static final int PRIORITY_COLUMN
```

Columns are animated first.

<br />

Constant Value: 1 (0x00000001)  

### PRIORITY_NONE

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

```
public static final int PRIORITY_NONE
```

Rows and columns are animated at the same time.

<br />

Constant Value: 0 (0x00000000)  

### PRIORITY_ROW

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

```
public static final int PRIORITY_ROW
```

Rows are animated first.

<br />

Constant Value: 2 (0x00000002)

## Public constructors

### GridLayoutAnimationController

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

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

Creates a new grid 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 /> |

### GridLayoutAnimationController

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

```
public GridLayoutAnimationController (Animation animation)
```

Creates a new layout animation controller with a delay of 50% for both rows and columns and the specified animation.

<br />

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

### GridLayoutAnimationController

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

```
public GridLayoutAnimationController (Animation animation, 
                float columnDelay, 
                float rowDelay)
```

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

<br />

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

## Public methods

### getColumnDelay

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

```
public float getColumnDelay ()
```

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

<br />

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

**See also:**

- [setColumnDelay(float)](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#setColumnDelay(float))
- [getRowDelay()](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#getRowDelay())
- [setRowDelay(float)](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#setRowDelay(float))  

### getDirection

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

```
public int getDirection ()
```

Returns the direction of the animation.[DIRECTION_HORIZONTAL_MASK](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#DIRECTION_HORIZONTAL_MASK)and[DIRECTION_VERTICAL_MASK](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#DIRECTION_VERTICAL_MASK)can be used to retrieve the horizontal and vertical components of the direction.

<br />

|                   Returns                    ||
|-------|---------------------------------------|
| `int` | the direction of the animation <br /> |

**See also:**

- [setDirection(int)](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#setDirection(int))
- [DIRECTION_BOTTOM_TO_TOP](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#DIRECTION_BOTTOM_TO_TOP)
- [DIRECTION_TOP_TO_BOTTOM](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#DIRECTION_TOP_TO_BOTTOM)
- [DIRECTION_LEFT_TO_RIGHT](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#DIRECTION_LEFT_TO_RIGHT)
- [DIRECTION_RIGHT_TO_LEFT](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#DIRECTION_RIGHT_TO_LEFT)
- [DIRECTION_HORIZONTAL_MASK](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#DIRECTION_HORIZONTAL_MASK)
- [DIRECTION_VERTICAL_MASK](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#DIRECTION_VERTICAL_MASK)  

### getDirectionPriority

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

```
public int getDirectionPriority ()
```

Returns the direction priority for the animation. The priority can be either[PRIORITY_NONE](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#PRIORITY_NONE),[PRIORITY_COLUMN](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#PRIORITY_COLUMN)or[PRIORITY_ROW](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#PRIORITY_ROW).

<br />

|                        Returns                        ||
|-------|------------------------------------------------|
| `int` | the priority of the animation direction <br /> |

**See also:**

- [setDirectionPriority(int)](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#setDirectionPriority(int))
- [PRIORITY_COLUMN](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#PRIORITY_COLUMN)
- [PRIORITY_NONE](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#PRIORITY_NONE)
- [PRIORITY_ROW](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#PRIORITY_ROW)  

### getRowDelay

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

```
public float getRowDelay ()
```

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

<br />

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

**See also:**

- [setRowDelay(float)](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#setRowDelay(float))
- [getColumnDelay()](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#getColumnDelay())
- [setColumnDelay(float)](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#setColumnDelay(float))  

### setColumnDelay

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

```
public void setColumnDelay (float columnDelay)
```

Sets the delay, as a fraction of the animation duration, by which the children's animations are offset from one column to the other.

<br />

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

**See also:**

- [getColumnDelay()](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#getColumnDelay())
- [getRowDelay()](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#getRowDelay())
- [setRowDelay(float)](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#setRowDelay(float))  

### setDirection

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

```
public void setDirection (int direction)
```

Sets the direction of the animation. The direction is expressed as an integer containing a horizontal and vertical component. For instance,`DIRECTION_BOTTOM_TO_TOP | DIRECTION_RIGHT_TO_LEFT`.

<br />

|                        Parameters                         ||
|-------------|----------------------------------------------|
| `direction` | `int`: the direction of the animation <br /> |

**See also:**

- [getDirection()](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#getDirection())
- [DIRECTION_BOTTOM_TO_TOP](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#DIRECTION_BOTTOM_TO_TOP)
- [DIRECTION_TOP_TO_BOTTOM](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#DIRECTION_TOP_TO_BOTTOM)
- [DIRECTION_LEFT_TO_RIGHT](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#DIRECTION_LEFT_TO_RIGHT)
- [DIRECTION_RIGHT_TO_LEFT](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#DIRECTION_RIGHT_TO_LEFT)
- [DIRECTION_HORIZONTAL_MASK](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#DIRECTION_HORIZONTAL_MASK)
- [DIRECTION_VERTICAL_MASK](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#DIRECTION_VERTICAL_MASK)  

### setDirectionPriority

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

```
public void setDirectionPriority (int directionPriority)
```

Specifies the direction priority of the animation. For instance,[PRIORITY_COLUMN](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#PRIORITY_COLUMN)will give priority to columns: the animation will first play on the column, then on the rows.Z

<br />

|                                 Parameters                                 ||
|---------------------|-------------------------------------------------------|
| `directionPriority` | `int`: the direction priority of the animation <br /> |

**See also:**

- [getDirectionPriority()](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#getDirectionPriority())
- [PRIORITY_COLUMN](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#PRIORITY_COLUMN)
- [PRIORITY_NONE](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#PRIORITY_NONE)
- [PRIORITY_ROW](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#PRIORITY_ROW)  

### setRowDelay

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

```
public void setRowDelay (float rowDelay)
```

Sets the delay, as a fraction of the animation duration, by which the children's animations are offset from one row to the other.

<br />

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

**See also:**

- [getRowDelay()](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#getRowDelay())
- [getColumnDelay()](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#getColumnDelay())
- [setColumnDelay(float)](https://developer.android.com/reference/android/view/animation/GridLayoutAnimationController#setColumnDelay(float))  

### 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 /> |