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

# Animation

*** ** * ** ***

` public abstract class Animation `   
` extends https://developer.android.com/reference/java/lang/Object ` ` implements https://developer.android.com/reference/java/lang/Cloneable `

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

Known direct subclasses [AlphaAnimation](https://developer.android.com/reference/android/view/animation/AlphaAnimation), [AnimationSet](https://developer.android.com/reference/android/view/animation/AnimationSet), [RotateAnimation](https://developer.android.com/reference/android/view/animation/RotateAnimation), [ScaleAnimation](https://developer.android.com/reference/android/view/animation/ScaleAnimation), [TranslateAnimation](https://developer.android.com/reference/android/view/animation/TranslateAnimation) [AlphaAnimation](https://developer.android.com/reference/android/view/animation/AlphaAnimation) An animation that controls the alpha level of an object. [AnimationSet](https://developer.android.com/reference/android/view/animation/AnimationSet) Represents a group of Animations that should be played together. [RotateAnimation](https://developer.android.com/reference/android/view/animation/RotateAnimation) An animation that controls the rotation of an object. [ScaleAnimation](https://developer.android.com/reference/android/view/animation/ScaleAnimation) An animation that controls the scale of an object. [TranslateAnimation](https://developer.android.com/reference/android/view/animation/TranslateAnimation) An animation that controls the position of an object.   

*** ** * ** ***

Abstraction for an Animation that can be applied to Views, Surfaces, or other objects. See the `https://developer.android.com/reference/android/view/animation/package-summary`.

## Summary

| ### Nested classes ||
|---|---|
| ` interface` | `https://developer.android.com/reference/android/view/animation/Animation.AnimationListener` <br /> An animation listener receives notifications from an animation. |
| ` class` | `https://developer.android.com/reference/android/view/animation/Animation.Description` Utility class to parse a string description of a size. |

| ### XML attributes ||
|---|---|
| [`android:backdropColor`](https://developer.android.com/reference/android/view/animation/Animation#attr_android:backdropColor) | Special option for window animations: whether the window's background should be used as a background to the animation. |
| [`android:detachWallpaper`](https://developer.android.com/reference/android/view/animation/Animation#attr_android:detachWallpaper) | Special option for window animations: if this window is on top of a wallpaper, don't animate the wallpaper with it. |
| [`android:duration`](https://developer.android.com/reference/android/view/animation/Animation#attr_android:duration) | Amount of time (in milliseconds) for the animation to run. |
| [`android:fillAfter`](https://developer.android.com/reference/android/view/animation/Animation#attr_android:fillAfter) | When set to true, the animation transformation is applied after the animation is over. |
| [`android:fillBefore`](https://developer.android.com/reference/android/view/animation/Animation#attr_android:fillBefore) | When set to true or when fillEnabled is not set to true, the animation transformation is applied before the animation has started. |
| [`android:fillEnabled`](https://developer.android.com/reference/android/view/animation/Animation#attr_android:fillEnabled) | When set to true, the value of fillBefore is taken into account. |
| [`android:interpolator`](https://developer.android.com/reference/android/view/animation/Animation#attr_android:interpolator) | Defines the interpolator used to smooth the animation movement in time. |
| [`android:repeatCount`](https://developer.android.com/reference/android/view/animation/Animation#attr_android:repeatCount) | Defines how many times the animation should repeat. |
| [`android:repeatMode`](https://developer.android.com/reference/android/view/animation/Animation#attr_android:repeatMode) | Defines the animation behavior when it reaches the end and the repeat count is greater than 0 or infinite. |
| [`android:showBackdrop`](https://developer.android.com/reference/android/view/animation/Animation#attr_android:showBackdrop) | Special option for window animations: whether to show a background behind the animating windows. |
| [`android:startOffset`](https://developer.android.com/reference/android/view/animation/Animation#attr_android:startOffset) | Delay in milliseconds before the animation runs, once start time is reached. |
| [`android:zAdjustment`](https://developer.android.com/reference/android/view/animation/Animation#attr_android:zAdjustment) | Allows for an adjustment of the Z ordering of the content being animated for the duration of the animation. |

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/view/animation/Animation#ABSOLUTE` The specified dimension is an absolute number of pixels. |
| `int` | `https://developer.android.com/reference/android/view/animation/Animation#INFINITE` Repeat the animation indefinitely. |
| `int` | `https://developer.android.com/reference/android/view/animation/Animation#RELATIVE_TO_PARENT` The specified dimension holds a float and should be multiplied by the height or width of the parent of the object being animated. |
| `int` | `https://developer.android.com/reference/android/view/animation/Animation#RELATIVE_TO_SELF` The specified dimension holds a float and should be multiplied by the height or width of the object being animated. |
| `int` | `https://developer.android.com/reference/android/view/animation/Animation#RESTART` When the animation reaches the end and the repeat count is INFINTE_REPEAT or a positive value, the animation restarts from the beginning. |
| `int` | `https://developer.android.com/reference/android/view/animation/Animation#REVERSE` When the animation reaches the end and the repeat count is INFINTE_REPEAT or a positive value, the animation plays backward (and then forward again). |
| `int` | `https://developer.android.com/reference/android/view/animation/Animation#START_ON_FIRST_FRAME` Can be used as the start time to indicate the start time should be the current time when `https://developer.android.com/reference/android/view/animation/Animation#getTransformation(long,%20android.view.animation.Transformation)` is invoked for the first animation frame. |
| `int` | `https://developer.android.com/reference/android/view/animation/Animation#ZORDER_BOTTOM` Requests that the content being animated be forced under all other content for the duration of the animation. |
| `int` | `https://developer.android.com/reference/android/view/animation/Animation#ZORDER_NORMAL` Requests that the content being animated be kept in its current Z order. |
| `int` | `https://developer.android.com/reference/android/view/animation/Animation#ZORDER_TOP` Requests that the content being animated be forced on top of all other content for the duration of the animation. |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/view/animation/Animation#Animation()() ` Creates a new animation with a duration of 0ms, the default interpolator, with fillBefore set to true and fillAfter set to false |
| ` https://developer.android.com/reference/android/view/animation/Animation#Animation(android.content.Context,%20android.util.AttributeSet)(https://developer.android.com/reference/android/content/Context context, https://developer.android.com/reference/android/util/AttributeSet attrs) ` Creates a new animation whose parameters come from the specified context and attributes set. |

| ### Public methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/view/animation/Animation#cancel()() ` Cancel the animation. |
| ` long` | ` https://developer.android.com/reference/android/view/animation/Animation#computeDurationHint()() ` Compute a hint at how long the entire animation may last, in milliseconds. |
| ` int` | ` https://developer.android.com/reference/android/view/animation/Animation#getBackdropColor()() ` Returns the background color to show behind the animating windows. |
| ` int` | ` https://developer.android.com/reference/android/view/animation/Animation#getBackgroundColor()() ` *This method was deprecated in API level 30. None of window animations are running with background color.* |
| ` boolean` | ` https://developer.android.com/reference/android/view/animation/Animation#getDetachWallpaper()() ` *This method was deprecated in API level 29. All window animations are running with detached wallpaper.* |
| ` long` | ` https://developer.android.com/reference/android/view/animation/Animation#getDuration()() ` How long this animation should last |
| ` boolean` | ` https://developer.android.com/reference/android/view/animation/Animation#getFillAfter()() ` If fillAfter is true, this animation will apply its transformation after the end time of the animation. |
| ` boolean` | ` https://developer.android.com/reference/android/view/animation/Animation#getFillBefore()() ` If fillBefore is true, this animation will apply its transformation before the start time of the animation. |
| ` https://developer.android.com/reference/android/view/animation/Interpolator` | ` https://developer.android.com/reference/android/view/animation/Animation#getInterpolator()() ` Gets the acceleration curve type for this animation. |
| ` int` | ` https://developer.android.com/reference/android/view/animation/Animation#getRepeatCount()() ` Defines how many times the animation should repeat. |
| ` int` | ` https://developer.android.com/reference/android/view/animation/Animation#getRepeatMode()() ` Defines what this animation should do when it reaches the end. |
| ` boolean` | ` https://developer.android.com/reference/android/view/animation/Animation#getShowBackdrop()() ` If showBackdrop is `true` and this animation is applied on a window, then the windows in the animation will animate with the background associated with this window behind them. |
| ` long` | ` https://developer.android.com/reference/android/view/animation/Animation#getStartOffset()() ` When this animation should start, relative to StartTime |
| ` long` | ` https://developer.android.com/reference/android/view/animation/Animation#getStartTime()() ` When this animation should start. |
| ` boolean` | ` https://developer.android.com/reference/android/view/animation/Animation#getTransformation(long,%20android.view.animation.Transformation,%20float)(long currentTime, https://developer.android.com/reference/android/view/animation/Transformation outTransformation, float scale) ` Gets the transformation to apply at a specified point in time. |
| ` boolean` | ` https://developer.android.com/reference/android/view/animation/Animation#getTransformation(long,%20android.view.animation.Transformation)(long currentTime, https://developer.android.com/reference/android/view/animation/Transformation outTransformation) ` Gets the transformation to apply at a specified point in time. |
| ` int` | ` https://developer.android.com/reference/android/view/animation/Animation#getZAdjustment()() ` Returns the Z ordering mode to use while running the animation as previously set by `https://developer.android.com/reference/android/view/animation/Animation#setZAdjustment(int)`. |
| ` boolean` | ` https://developer.android.com/reference/android/view/animation/Animation#hasEnded()() ` <br /> Indicates whether this animation has ended or not. |
| ` boolean` | ` https://developer.android.com/reference/android/view/animation/Animation#hasStarted()() ` <br /> Indicates whether this animation has started or not. |
| ` void` | ` https://developer.android.com/reference/android/view/animation/Animation#initialize(int,%20int,%20int,%20int)(int width, int height, int parentWidth, int parentHeight) ` Initialize this animation with the dimensions of the object being animated as well as the objects parents. |
| ` boolean` | ` https://developer.android.com/reference/android/view/animation/Animation#isFillEnabled()() ` If fillEnabled is true, this animation will apply the value of fillBefore. |
| ` boolean` | ` https://developer.android.com/reference/android/view/animation/Animation#isInitialized()() ` Whether or not the animation has been initialized. |
| ` void` | ` https://developer.android.com/reference/android/view/animation/Animation#reset()() ` Reset the initialization state of this animation. |
| ` void` | ` https://developer.android.com/reference/android/view/animation/Animation#restrictDuration(long)(long durationMillis) ` Ensure that the duration that this animation will run is not longer than <var translate="no">durationMillis</var>. |
| ` void` | ` https://developer.android.com/reference/android/view/animation/Animation#scaleCurrentDuration(float)(float scale) ` How much to scale the duration by. |
| ` void` | ` https://developer.android.com/reference/android/view/animation/Animation#setAnimationListener(android.view.animation.Animation.AnimationListener)(https://developer.android.com/reference/android/view/animation/Animation.AnimationListener listener) ` <br /> Binds an animation listener to this animation. |
| ` void` | ` https://developer.android.com/reference/android/view/animation/Animation#setBackdropColor(int)(int backdropColor) ` Set the color to use for the backdrop shown behind the animating windows. |
| ` void` | ` https://developer.android.com/reference/android/view/animation/Animation#setBackgroundColor(int)(int bg) ` *This method was deprecated in API level 30. None of window animations are running with background color.* |
| ` void` | ` https://developer.android.com/reference/android/view/animation/Animation#setDetachWallpaper(boolean)(boolean detachWallpaper) ` *This method was deprecated in API level 29. All window animations are running with detached wallpaper.* |
| ` void` | ` https://developer.android.com/reference/android/view/animation/Animation#setDuration(long)(long durationMillis) ` How long this animation should last. |
| ` void` | ` https://developer.android.com/reference/android/view/animation/Animation#setFillAfter(boolean)(boolean fillAfter) ` If fillAfter is true, the transformation that this animation performed will persist when it is finished. |
| ` void` | ` https://developer.android.com/reference/android/view/animation/Animation#setFillBefore(boolean)(boolean fillBefore) ` If fillBefore is true, this animation will apply its transformation before the start time of the animation. |
| ` void` | ` https://developer.android.com/reference/android/view/animation/Animation#setFillEnabled(boolean)(boolean fillEnabled) ` If fillEnabled is true, the animation will apply the value of fillBefore. |
| ` void` | ` https://developer.android.com/reference/android/view/animation/Animation#setInterpolator(android.view.animation.Interpolator)(https://developer.android.com/reference/android/view/animation/Interpolator i) ` Sets the acceleration curve for this animation. |
| ` void` | ` https://developer.android.com/reference/android/view/animation/Animation#setInterpolator(android.content.Context,%20int)(https://developer.android.com/reference/android/content/Context context, int resID) ` Sets the acceleration curve for this animation. |
| ` void` | ` https://developer.android.com/reference/android/view/animation/Animation#setRepeatCount(int)(int repeatCount) ` Sets how many times the animation should be repeated. |
| ` void` | ` https://developer.android.com/reference/android/view/animation/Animation#setRepeatMode(int)(int repeatMode) ` Defines what this animation should do when it reaches the end. |
| ` void` | ` https://developer.android.com/reference/android/view/animation/Animation#setShowBackdrop(boolean)(boolean showBackdrop) ` If showBackdrop is `true` and this animation is applied on a window, then the windows in the animation will animate with the background associated with this window behind them. |
| ` void` | ` https://developer.android.com/reference/android/view/animation/Animation#setStartOffset(long)(long startOffset) ` When this animation should start relative to the start time. |
| ` void` | ` https://developer.android.com/reference/android/view/animation/Animation#setStartTime(long)(long startTimeMillis) ` When this animation should start. |
| ` void` | ` https://developer.android.com/reference/android/view/animation/Animation#setZAdjustment(int)(int zAdjustment) ` Set the Z ordering mode to use while running the animation. |
| ` void` | ` https://developer.android.com/reference/android/view/animation/Animation#start()() ` Convenience method to start the animation the first time `https://developer.android.com/reference/android/view/animation/Animation#getTransformation(long,%20android.view.animation.Transformation)` is invoked. |
| ` void` | ` https://developer.android.com/reference/android/view/animation/Animation#startNow()() ` Convenience method to start the animation at the current time in milliseconds. |
| ` boolean` | ` https://developer.android.com/reference/android/view/animation/Animation#willChangeBounds()() ` <br /> Indicates whether or not this animation will affect the bounds of the animated view. |
| ` boolean` | ` https://developer.android.com/reference/android/view/animation/Animation#willChangeTransformationMatrix()() ` <br /> Indicates whether or not this animation will affect the transformation matrix. |

| ### Protected methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/view/animation/Animation#applyTransformation(float,%20android.view.animation.Transformation)(float interpolatedTime, https://developer.android.com/reference/android/view/animation/Transformation t) ` Helper for getTransformation. |
| ` https://developer.android.com/reference/android/view/animation/Animation` | ` https://developer.android.com/reference/android/view/animation/Animation#clone()() ` Creates and returns a copy of this object. |
| ` void` | ` https://developer.android.com/reference/android/view/animation/Animation#ensureInterpolator()() ` Gurantees that this animation has an interpolator. |
| ` void` | ` https://developer.android.com/reference/android/view/animation/Animation#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. |
| ` float` | ` https://developer.android.com/reference/android/view/animation/Animation#getScaleFactor()() ` The scale factor is set by the call to `getTransformation`. |
| ` float` | ` https://developer.android.com/reference/android/view/animation/Animation#resolveSize(int,%20float,%20int,%20int)(int type, float value, int size, int parentSize) ` Convert the information in the description of a size to an actual dimension |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` 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 https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` 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` ` 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` ` 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:backdropColor

Special option for window animations: whether the window's background should be used as a background to the animation.

May be a color value, in the form of "`#*rgb*`", "`#*argb*`", "`#*rrggbb*`", or "`#*aarrggbb*`".

<br />

**Related methods:**

- `https://developer.android.com/reference/android/view/animation/Animation#setBackdropColor(int)`

### android:detachWallpaper

Special option for window animations: if this window is on top of a wallpaper, don't animate the wallpaper with it.

May be a boolean value, such as "`true`" or "`false`".

<br />

**Related methods:**

- `https://developer.android.com/reference/android/view/animation/Animation#setDetachWallpaper(boolean)`

### android:duration

Amount of time (in milliseconds) for the animation to run.

May be an integer value, such as "`100`".

<br />

**Related methods:**

- `https://developer.android.com/reference/android/view/animation/Animation#setDuration(long)`

### android:fillAfter

When set to true, the animation transformation is applied after the animation is over. The default value is false. If fillEnabled is not set to true and the animation is not set on a View, fillAfter is assumed to be true.

May be a boolean value, such as "`true`" or "`false`".

<br />

**Related methods:**

- `https://developer.android.com/reference/android/view/animation/Animation#setFillAfter(boolean)`

### android:fillBefore

When set to true or when fillEnabled is not set to true, the animation transformation is applied before the animation has started. The default value is true.

May be a boolean value, such as "`true`" or "`false`".

<br />

**Related methods:**

- `https://developer.android.com/reference/android/view/animation/Animation#setFillBefore(boolean)`

### android:fillEnabled

When set to true, the value of fillBefore is taken into account.

May be a boolean value, such as "`true`" or "`false`".

<br />

**Related methods:**

- `https://developer.android.com/reference/android/view/animation/Animation#setFillEnabled(boolean)`

### android:interpolator

Defines the interpolator used to smooth the animation movement in time.

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

- `https://developer.android.com/reference/android/view/animation/Animation#setInterpolator(android.content.Context,%20int)`

### android:repeatCount

Defines how many times the animation should repeat. The default value is 0.

May be an integer value, such as "`100`".

Must be one of the following constant values.

| Constant | Value | Description |
|---|---|---|
| infinite | ffffffff |   |

<br />

<br />

**Related methods:**

- `https://developer.android.com/reference/android/view/animation/Animation#setRepeatCount(int)`

### android:repeatMode

Defines the animation behavior when it reaches the end and the repeat count is greater than 0 or infinite. The default value is restart.

Must be one of the following constant values.

| Constant | Value | Description |
|---|---|---|
| restart | 1 | The animation starts again from the beginning. |
| reverse | 2 | The animation plays backward. |

<br />

<br />

**Related methods:**

- `https://developer.android.com/reference/android/view/animation/Animation#setRepeatMode(int)`

### android:showBackdrop

Special option for window animations: whether to show a background behind the animating windows. By default the window's background is used unless overridden by the animation.

May be a boolean value, such as "`true`" or "`false`".

<br />

**Related methods:**

- `https://developer.android.com/reference/android/view/animation/Animation#setShowBackdrop(boolean)`

### android:startOffset

Delay in milliseconds before the animation runs, once start time is reached.

May be an integer value, such as "`100`".

<br />

**Related methods:**

- `https://developer.android.com/reference/android/view/animation/Animation#setStartOffset(long)`

### android:zAdjustment

Allows for an adjustment of the Z ordering of the content being animated for the duration of the animation. The default value is normal.

Must be one of the following constant values.

| Constant | Value | Description |
|---|---|---|
| bottom | ffffffff | The content being animated is forced under all other content for the duration of the animation. |
| normal | 0 | The content being animated be kept in its current Z order. |
| top | 1 | The content being animated is forced on top of all other content for the duration of the animation. |

<br />

<br />

**Related methods:**

- `https://developer.android.com/reference/android/view/animation/Animation#setZAdjustment(int)`

## Constants

### ABSOLUTE

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

```
public static final int ABSOLUTE
```

The specified dimension is an absolute number of pixels.

<br />

Constant Value: 0 (0x00000000)

### INFINITE

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

```
public static final int INFINITE
```

Repeat the animation indefinitely.

<br />

Constant Value: -1 (0xffffffff)

### RELATIVE_TO_PARENT

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

```
public static final int RELATIVE_TO_PARENT
```

The specified dimension holds a float and should be multiplied by the height or width of the parent of the object being animated.

<br />

Constant Value: 2 (0x00000002)

### RELATIVE_TO_SELF

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

```
public static final int RELATIVE_TO_SELF
```

The specified dimension holds a float and should be multiplied by the height or width of the object being animated.

<br />

Constant Value: 1 (0x00000001)

### RESTART

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

```
public static final int RESTART
```

When the animation reaches the end and the repeat count is INFINTE_REPEAT or a positive value, the animation restarts from the beginning.

<br />

Constant Value: 1 (0x00000001)

### REVERSE

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

```
public static final int REVERSE
```

When the animation reaches the end and the repeat count is INFINTE_REPEAT or a positive value, the animation plays backward (and then forward again).

<br />

Constant Value: 2 (0x00000002)

### START_ON_FIRST_FRAME

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

```
public static final int START_ON_FIRST_FRAME
```

Can be used as the start time to indicate the start time should be the current time when `https://developer.android.com/reference/android/view/animation/Animation#getTransformation(long,%20android.view.animation.Transformation)` is invoked for the first animation frame. This can is useful for short animations.

<br />

Constant Value: -1 (0xffffffff)

### ZORDER_BOTTOM

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

```
public static final int ZORDER_BOTTOM
```

Requests that the content being animated be forced under all other content for the duration of the animation.

<br />

Constant Value: -1 (0xffffffff)

### ZORDER_NORMAL

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

```
public static final int ZORDER_NORMAL
```

Requests that the content being animated be kept in its current Z order.

<br />

Constant Value: 0 (0x00000000)

### ZORDER_TOP

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

```
public static final int ZORDER_TOP
```

Requests that the content being animated be forced on top of all other content for the duration of the animation.

<br />

Constant Value: 1 (0x00000001)

## Public constructors

### Animation

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

```
public Animation ()
```

Creates a new animation with a duration of 0ms, the default interpolator, with fillBefore set to true and fillAfter set to false

<br />

### Animation

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

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

Creates a new animation whose parameters come from the specified context and attributes set.

<br />

| Parameters ||
|---|---|
| `context` | `Context`: the application environment <br /> |
| `attrs` | `AttributeSet`: the set of attributes holding the animation parameters <br /> |

## Public methods

### cancel

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

```
public void cancel ()
```

Cancel the animation. Cancelling an animation invokes the animation listener, if set, to notify the end of the animation. If you cancel an animation manually, you must call `https://developer.android.com/reference/android/view/animation/Animation#reset()` before starting the animation again.

<br />

**See also:**

- `https://developer.android.com/reference/android/view/animation/Animation#reset()`
- `https://developer.android.com/reference/android/view/animation/Animation#start()`
- `https://developer.android.com/reference/android/view/animation/Animation#startNow()`

### computeDurationHint

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

```
public long computeDurationHint ()
```

Compute a hint at how long the entire animation may last, in milliseconds. Animations can be written to cause themselves to run for a different duration than what is computed here, but generally this should be accurate.

<br />

| Returns ||
|---|---|
| `long` | <br /> |

### getBackdropColor

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

```
public int getBackdropColor ()
```

Returns the background color to show behind the animating windows. Will only show the background if showBackdrop was set to true. See `https://developer.android.com/reference/android/view/animation/Animation#setShowBackdrop(boolean)`.

<br />

**Related XML Attributes:**

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

| Returns ||
|---|---|
| `int` | The backdrop color. If 0, the backdrop color will not apply. <br /> |

### getBackgroundColor

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

```
public int getBackgroundColor ()
```

<br />

**This method was deprecated in API level 30.**   

None of window animations are running with background color.

Returns the background color behind the animation.

<br />

| Returns ||
|---|---|
| `int` | <br /> |

**See also:**

- `https://developer.android.com/reference/android/view/animation/Animation#getBackdropColor()`

### getDetachWallpaper

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

```
public boolean getDetachWallpaper ()
```

<br />

**This method was deprecated in API level 29.**   

All window animations are running with detached wallpaper.

Return value of `https://developer.android.com/reference/android/view/animation/Animation#setDetachWallpaper(boolean)`.

<br />

**Related XML Attributes:**

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

| Returns ||
|---|---|
| `boolean` | <br /> |

### getDuration

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

```
public long getDuration ()
```

How long this animation should last

<br />

**Related XML Attributes:**

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

| Returns ||
|---|---|
| `long` | the duration in milliseconds of the animation <br /> |

### getFillAfter

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

```
public boolean getFillAfter ()
```

If fillAfter is true, this animation will apply its transformation after the end time of the animation.

<br />

**Related XML Attributes:**

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

| Returns ||
|---|---|
| `boolean` | true if the animation applies its transformation after it ends <br /> |

### getFillBefore

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

```
public boolean getFillBefore ()
```

If fillBefore is true, this animation will apply its transformation before the start time of the animation. If fillBefore is false and `https://developer.android.com/reference/android/view/animation/Animation#isFillEnabled()` is true, the transformation will not be applied until the start time of the animation.

<br />

**Related XML Attributes:**

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

| Returns ||
|---|---|
| `boolean` | true if the animation applies its transformation before it starts <br /> |

### getInterpolator

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

```
public Interpolator getInterpolator ()
```

Gets the acceleration curve type for this animation.

<br />

**Related XML Attributes:**

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

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/animation/Interpolator` | the `https://developer.android.com/reference/android/view/animation/Interpolator` associated to this animation <br /> |

### getRepeatCount

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

```
public int getRepeatCount ()
```

Defines how many times the animation should repeat. The default value is 0.

<br />

**Related XML Attributes:**

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

| Returns ||
|---|---|
| `int` | the number of times the animation should repeat, or `https://developer.android.com/reference/android/view/animation/Animation#INFINITE` <br /> |

### getRepeatMode

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

```
public int getRepeatMode ()
```

Defines what this animation should do when it reaches the end.

<br />

**Related XML Attributes:**

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

| Returns ||
|---|---|
| `int` | either one of `https://developer.android.com/reference/android/view/animation/Animation#REVERSE` or `https://developer.android.com/reference/android/view/animation/Animation#RESTART` <br /> |

### getShowBackdrop

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

```
public boolean getShowBackdrop ()
```

If showBackdrop is `true` and this animation is applied on a window, then the windows in the animation will animate with the background associated with this window behind them. If no backdrop color is explicitly set, the backdrop's color comes from the `https://developer.android.com/reference/android/R.styleable#Theme_colorBackground` that is applied to this window through its theme. If multiple animating windows have showBackdrop set to `true` during an animation, the top most window with showBackdrop set to `true` and a valid background color takes precedence.

<br />

**Related XML Attributes:**

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

| Returns ||
|---|---|
| `boolean` | if a backdrop should be shown behind the animating windows. <br /> |

### getStartOffset

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

```
public long getStartOffset ()
```

When this animation should start, relative to StartTime

<br />

**Related XML Attributes:**

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

| Returns ||
|---|---|
| `long` | the start offset in milliseconds <br /> |

### getStartTime

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

```
public long getStartTime ()
```

When this animation should start. If the animation has not startet yet, this method might return `https://developer.android.com/reference/android/view/animation/Animation#START_ON_FIRST_FRAME`.

<br />

| Returns ||
|---|---|
| `long` | the time in milliseconds when the animation should start or `https://developer.android.com/reference/android/view/animation/Animation#START_ON_FIRST_FRAME` <br /> |

### getTransformation

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

```
public boolean getTransformation (long currentTime, 
                Transformation outTransformation, 
                float scale)
```

Gets the transformation to apply at a specified point in time. Implementations of this method should always replace the specified Transformation or document they are doing otherwise.

<br />

| Parameters ||
|---|---|
| `currentTime` | `long`: Where we are in the animation. This is wall clock time. <br /> |
| `outTransformation` | `Transformation`: A transformation object that is provided by the caller and will be filled in by the animation. <br /> |
| `scale` | `float`: Scaling factor to apply to any inputs to the transform operation, such pivot points being rotated or scaled around. <br /> |

| Returns ||
|---|---|
| `boolean` | True if the animation is still running <br /> |

### getTransformation

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

```
public boolean getTransformation (long currentTime, 
                Transformation outTransformation)
```

Gets the transformation to apply at a specified point in time. Implementations of this method should always replace the specified Transformation or document they are doing otherwise.

<br />

| Parameters ||
|---|---|
| `currentTime` | `long`: Where we are in the animation. This is wall clock time. <br /> |
| `outTransformation` | `Transformation`: A transformation object that is provided by the caller and will be filled in by the animation. <br /> |

| Returns ||
|---|---|
| `boolean` | True if the animation is still running <br /> |

### getZAdjustment

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

```
public int getZAdjustment ()
```

Returns the Z ordering mode to use while running the animation as previously set by `https://developer.android.com/reference/android/view/animation/Animation#setZAdjustment(int)`.

<br />

**Related XML Attributes:**

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

| Returns ||
|---|---|
| `int` | Returns one of `https://developer.android.com/reference/android/view/animation/Animation#ZORDER_NORMAL`, `https://developer.android.com/reference/android/view/animation/Animation#ZORDER_TOP`, or `https://developer.android.com/reference/android/view/animation/Animation#ZORDER_BOTTOM`. <br /> |

### hasEnded

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

```
public boolean hasEnded ()
```

<br />

Indicates whether this animation has ended or not.

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if the animation has ended, false otherwise <br /> |

### hasStarted

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

```
public boolean hasStarted ()
```

<br />

Indicates whether this animation has started or not.

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if the animation has started, false otherwise <br /> |

### initialize

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

```
public void initialize (int width, 
                int height, 
                int parentWidth, 
                int parentHeight)
```

Initialize this animation with the dimensions of the object being animated as well as the objects parents. (This is to support animation sizes being specified relative to these dimensions.)

Objects that interpret Animations should call this method when the sizes of the object being animated and its parent are known, and before calling `https://developer.android.com/reference/android/view/animation/Animation#getTransformation(long,%20android.view.animation.Transformation)`.

<br />

| Parameters ||
|---|---|
| `width` | `int`: Width of the object being animated <br /> |
| `height` | `int`: Height of the object being animated <br /> |
| `parentWidth` | `int`: Width of the animated object's parent <br /> |
| `parentHeight` | `int`: Height of the animated object's parent <br /> |

### isFillEnabled

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

```
public boolean isFillEnabled ()
```

If fillEnabled is true, this animation will apply the value of fillBefore.

<br />

**Related XML Attributes:**

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

| Returns ||
|---|---|
| `boolean` | true if the animation will take fillBefore into account <br /> |

### isInitialized

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

```
public boolean isInitialized ()
```

Whether or not the animation has been initialized.

<br />

| Returns ||
|---|---|
| `boolean` | Has this animation been initialized. <br /> |

**See also:**

- `https://developer.android.com/reference/android/view/animation/Animation#initialize(int,%20int,%20int,%20int)`

### reset

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

```
public void reset ()
```

Reset the initialization state of this animation.

<br />

**See also:**

- `https://developer.android.com/reference/android/view/animation/Animation#initialize(int,%20int,%20int,%20int)`

### restrictDuration

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

```
public void restrictDuration (long durationMillis)
```

Ensure that the duration that this animation will run is not longer than <var translate="no">durationMillis</var>. In addition to adjusting the duration itself, this ensures that the repeat count also will not make it run longer than the given time.

<br />

| Parameters ||
|---|---|
| `durationMillis` | `long`: The maximum duration the animation is allowed to run. <br /> |

### scaleCurrentDuration

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

```
public void scaleCurrentDuration (float scale)
```

How much to scale the duration by.

<br />

| Parameters ||
|---|---|
| `scale` | `float`: The amount to scale the duration. <br /> |

### setAnimationListener

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

```
public void setAnimationListener (Animation.AnimationListener listener)
```

<br />

Binds an animation listener to this animation. The animation listener is notified of animation events such as the end of the animation or the repetition of the animation.

<br />

<br />

| Parameters ||
|---|---|
| `listener` | `Animation.AnimationListener`: the animation listener to be notified <br /> |

### setBackdropColor

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

```
public void setBackdropColor (int backdropColor)
```

Set the color to use for the backdrop shown behind the animating windows. Will only show the backdrop if showBackdrop was set to true. See `https://developer.android.com/reference/android/view/animation/Animation#setShowBackdrop(boolean)`.

<br />

**Related XML Attributes:**

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

| Parameters ||
|---|---|
| `backdropColor` | `int`: The backdrop color. If 0, the backdrop color will not apply. <br /> |

### setBackgroundColor

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

```
public void setBackgroundColor (int bg)
```

<br />

**This method was deprecated in API level 30.**   

None of window animations are running with background color.

Set background behind animation.

<br />

| Parameters ||
|---|---|
| `bg` | `int`: The background color. If 0, no background. Currently must be black, with any desired alpha level. <br /> |

**See also:**

- `https://developer.android.com/reference/android/view/animation/Animation#setBackdropColor(int)`

### setDetachWallpaper

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

```
public void setDetachWallpaper (boolean detachWallpaper)
```

<br />

**This method was deprecated in API level 29.**   

All window animations are running with detached wallpaper.

If detachWallpaper is true, and this is a window animation of a window that has a wallpaper background, then the window will be detached from the wallpaper while it runs. That is, the animation will only be applied to the window, and the wallpaper behind it will remain static.

<br />

**Related XML Attributes:**

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

| Parameters ||
|---|---|
| `detachWallpaper` | `boolean`: true if the wallpaper should be detached from the animation <br /> |

### setDuration

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

```
public void setDuration (long durationMillis)
```

How long this animation should last. The duration cannot be negative.

<br />

**Related XML Attributes:**

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

| Parameters ||
|---|---|
| `durationMillis` | `long`: Duration in milliseconds <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the duration is \< 0 |

### setFillAfter

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

```
public void setFillAfter (boolean fillAfter)
```

If fillAfter is true, the transformation that this animation performed will persist when it is finished. Defaults to false if not set. Note that this applies to individual animations and when using an `https://developer.android.com/reference/android/view/animation/AnimationSet` to chain animations.

<br />

**Related XML Attributes:**

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

| Parameters ||
|---|---|
| `fillAfter` | `boolean`: true if the animation should apply its transformation after it ends <br /> |

**See also:**

- `https://developer.android.com/reference/android/view/animation/Animation#setFillEnabled(boolean)`

### setFillBefore

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

```
public void setFillBefore (boolean fillBefore)
```

If fillBefore is true, this animation will apply its transformation before the start time of the animation. Defaults to true if `https://developer.android.com/reference/android/view/animation/Animation#setFillEnabled(boolean)` is not set to true. Note that this applies when using an `https://developer.android.com/reference/android/view/animation/AnimationSet` to chain animations. The transformation is not applied before the AnimationSet itself starts.

<br />

**Related XML Attributes:**

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

| Parameters ||
|---|---|
| `fillBefore` | `boolean`: true if the animation should apply its transformation before it starts <br /> |

**See also:**

- `https://developer.android.com/reference/android/view/animation/Animation#setFillEnabled(boolean)`

### setFillEnabled

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

```
public void setFillEnabled (boolean fillEnabled)
```

If fillEnabled is true, the animation will apply the value of fillBefore. Otherwise, fillBefore is ignored and the animation transformation is always applied until the animation ends.

<br />

**Related XML Attributes:**

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

| Parameters ||
|---|---|
| `fillEnabled` | `boolean`: true if the animation should take the value of fillBefore into account <br /> |

**See also:**

- `https://developer.android.com/reference/android/view/animation/Animation#setFillBefore(boolean)`
- `https://developer.android.com/reference/android/view/animation/Animation#setFillAfter(boolean)`

### setInterpolator

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

```
public void setInterpolator (Interpolator i)
```

Sets the acceleration curve for this animation. Defaults to a linear interpolation.

<br />

**Related XML Attributes:**

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

| Parameters ||
|---|---|
| `i` | `Interpolator`: The interpolator which defines the acceleration curve <br /> |

### setInterpolator

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

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

Sets the acceleration curve for this animation. The interpolator is loaded as a resource from the specified context.

<br />

**Related XML Attributes:**

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

| Parameters ||
|---|---|
| `context` | `Context`: The application environment <br /> |
| `resID` | `int`: The resource identifier of the interpolator to load <br /> |

### setRepeatCount

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

```
public void setRepeatCount (int repeatCount)
```

Sets how many times the animation should be repeated. If the repeat count is 0, the animation is never repeated. If the repeat count is greater than 0 or `https://developer.android.com/reference/android/view/animation/Animation#INFINITE`, the repeat mode will be taken into account. The repeat count is 0 by default.

<br />

**Related XML Attributes:**

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

| Parameters ||
|---|---|
| `repeatCount` | `int`: the number of times the animation should be repeated <br /> |

### setRepeatMode

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

```
public void setRepeatMode (int repeatMode)
```

Defines what this animation should do when it reaches the end. This setting is applied only when the repeat count is either greater than 0 or `https://developer.android.com/reference/android/view/animation/Animation#INFINITE`. Defaults to `https://developer.android.com/reference/android/view/animation/Animation#RESTART`.

<br />

**Related XML Attributes:**

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

| Parameters ||
|---|---|
| `repeatMode` | `int`: `https://developer.android.com/reference/android/view/animation/Animation#RESTART` or `https://developer.android.com/reference/android/view/animation/Animation#REVERSE` <br /> |

### setShowBackdrop

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

```
public void setShowBackdrop (boolean showBackdrop)
```

If showBackdrop is `true` and this animation is applied on a window, then the windows in the animation will animate with the background associated with this window behind them. If no backdrop color is explicitly set, the backdrop's color comes from the `https://developer.android.com/reference/android/R.styleable#Theme_colorBackground` that is applied to this window through its theme. If multiple animating windows have showBackdrop set to `true` during an animation, the top most window with showBackdrop set to `true` and a valid background color takes precedence.

<br />

**Related XML Attributes:**

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

| Parameters ||
|---|---|
| `showBackdrop` | `boolean`: Whether to show a background behind the windows during the animation. <br /> |

### setStartOffset

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

```
public void setStartOffset (long startOffset)
```

When this animation should start relative to the start time. This is most useful when composing complex animations using an `https://developer.android.com/reference/android/view/animation/AnimationSet` where some of the animations components start at different times.

<br />

**Related XML Attributes:**

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

| Parameters ||
|---|---|
| `startOffset` | `long`: When this Animation should start, in milliseconds from the start time of the root AnimationSet. <br /> |

### setStartTime

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

```
public void setStartTime (long startTimeMillis)
```

When this animation should start. When the start time is set to `https://developer.android.com/reference/android/view/animation/Animation#START_ON_FIRST_FRAME`, the animation will start the first time `https://developer.android.com/reference/android/view/animation/Animation#getTransformation(long,%20android.view.animation.Transformation)` is invoked. The time passed to this method should be obtained by calling `https://developer.android.com/reference/android/view/animation/AnimationUtils#currentAnimationTimeMillis()` instead of `https://developer.android.com/reference/java/lang/System#currentTimeMillis()`.

<br />

| Parameters ||
|---|---|
| `startTimeMillis` | `long`: the start time in milliseconds <br /> |

### setZAdjustment

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

```
public void setZAdjustment (int zAdjustment)
```

Set the Z ordering mode to use while running the animation.

<br />

**Related XML Attributes:**

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

| Parameters ||
|---|---|
| `zAdjustment` | `int`: The desired mode, one of `https://developer.android.com/reference/android/view/animation/Animation#ZORDER_NORMAL`, `https://developer.android.com/reference/android/view/animation/Animation#ZORDER_TOP`, or `https://developer.android.com/reference/android/view/animation/Animation#ZORDER_BOTTOM`. <br /> |

### start

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

```
public void start ()
```

Convenience method to start the animation the first time `https://developer.android.com/reference/android/view/animation/Animation#getTransformation(long,%20android.view.animation.Transformation)` is invoked.

<br />

### startNow

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

```
public void startNow ()
```

Convenience method to start the animation at the current time in milliseconds.

<br />

### willChangeBounds

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

```
public boolean willChangeBounds ()
```

<br />

Indicates whether or not this animation will affect the bounds of the animated view. For instance, a fade animation will not affect the bounds whereas a 200% scale animation will.

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if this animation will change the view's bounds <br /> |

### willChangeTransformationMatrix

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

```
public boolean willChangeTransformationMatrix ()
```

<br />

Indicates whether or not this animation will affect the transformation matrix. For instance, a fade animation will not affect the matrix whereas a scale animation will.

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if this animation will change the transformation matrix <br /> |

## Protected methods

### applyTransformation

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

```
protected void applyTransformation (float interpolatedTime, 
                Transformation t)
```

Helper for getTransformation. Subclasses should implement this to apply their transforms given an interpolation value. Implementations of this method should always replace the specified Transformation or document they are doing otherwise.

<br />

| Parameters ||
|---|---|
| `interpolatedTime` | `float`: The value of the normalized time (0.0 to 1.0) after it has been run through the interpolation function. <br /> |
| `t` | `Transformation`: The Transformation object to fill in with the current transforms. <br /> |

### clone

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

```
protected Animation clone ()
```

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object `x`, the expression:
>
> ```
> x.clone() != x
> ```
will be true, and that the expression:
>
> ```
> x.clone().getClass() == x.getClass()
> ```
will be `true`, but these are not absolute requirements. While it is typically the case that:
>
> ```
> x.clone().equals(x)
> ```
will be `true`, this is not an absolute requirement.

By convention, the returned object should be obtained by calling `super.clone`. If a class and all of its superclasses (except `Object`) obey this convention, it will be the case that `x.clone().getClass() == x.getClass()`.

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by `super.clone` before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by `super.clone` need to be modified.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/animation/Animation` | a clone of this instance. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/CloneNotSupportedException` |   |

### ensureInterpolator

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

```
protected void ensureInterpolator ()
```

Gurantees that this animation has an interpolator. Will use a AccelerateDecelerateInterpolator is nothing else was specified.

<br />

### finalize

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

```
protected void finalize ()
```

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. A subclass overrides the `finalize` method to dispose of system resources or to perform other cleanup.

The general contract of `finalize` is that it is invoked if and when the Java virtual machine has determined that there is no longer any means by which this object can be accessed by any thread that has not yet died, except as a result of an action taken by the finalization of some other object or class which is ready to be finalized. The `finalize` method may take any action, including making this object available again to other threads; the usual purpose of `finalize`, however, is to perform cleanup actions before the object is irrevocably discarded. For example, the finalize method for an object that represents an input/output connection might perform explicit I/O transactions to break the connection before the object is permanently discarded.

The `finalize` method of class `Object` performs no special action; it simply returns normally. Subclasses of `Object` may override this definition.

The Java programming language does not guarantee which thread will invoke the `finalize` method for any given object. It is guaranteed, however, that the thread that invokes finalize will not be holding any user-visible synchronization locks when finalize is invoked. If an uncaught exception is thrown by the finalize method, the exception is ignored and finalization of that object terminates.

After the `finalize` method has been invoked for an object, no further action is taken until the Java virtual machine has again determined that there is no longer any means by which this object can be accessed by any thread that has not yet died, including possible actions by other objects or classes which are ready to be finalized, at which point the object may be discarded.

The `finalize` method is never invoked more than once by a Java virtual machine for any given object.

Any exception thrown by the `finalize` method causes the finalization of this object to be halted, but is otherwise ignored.

<br />

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/Throwable` |   |

### getScaleFactor

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

```
protected float getScaleFactor ()
```

The scale factor is set by the call to `getTransformation`. Overrides of `https://developer.android.com/reference/android/view/animation/Animation#getTransformation(long,%20android.view.animation.Transformation,%20float)` will get this value directly. Overrides of `https://developer.android.com/reference/android/view/animation/Animation#applyTransformation(float,%20android.view.animation.Transformation)` can call this method to get the value.

<br />

| Returns ||
|---|---|
| `float` | float The scale factor that should be applied to pre-scaled values in an Animation such as the pivot points in `https://developer.android.com/reference/android/view/animation/ScaleAnimation` and `https://developer.android.com/reference/android/view/animation/RotateAnimation`. <br /> |

### resolveSize

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

```
protected float resolveSize (int type, 
                float value, 
                int size, 
                int parentSize)
```

Convert the information in the description of a size to an actual dimension

<br />

| Parameters ||
|---|---|
| `type` | `int`: One of Animation.ABSOLUTE, Animation.RELATIVE_TO_SELF, or Animation.RELATIVE_TO_PARENT. <br /> |
| `value` | `float`: The dimension associated with the type parameter <br /> |
| `size` | `int`: The size of the object being animated <br /> |
| `parentSize` | `int`: The size of the parent of the object being animated <br /> |

| Returns ||
|---|---|
| `float` | The dimension to use for the animation <br /> |