Java android.view.animation Animation fields, constructors, methods, implement or subclass

Example usage for Java android.view.animation Animation fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for android.view.animation Animation.

The text is from its open source code.

Subclass

android.view.animation.Animation has subclasses.
Click this link to see all its subclasses.

Field

intINFINITE
Repeat the animation indefinitely.
intRESTART
When the animation reaches the end and the repeat count is INFINTE_REPEAT or a positive value, the animation restarts from the beginning.
intREVERSE
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).
intSTART_ON_FIRST_FRAME
Can be used as the start time to indicate the start time should be the current time when #getTransformation(long,Transformation) is invoked for the first animation frame.
intABSOLUTE
The specified dimension is an absolute number of pixels.
intRELATIVE_TO_SELF
The specified dimension holds a float and should be multiplied by the height or width of the object being animated.
intRELATIVE_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.
intZORDER_TOP
Requests that the content being animated be forced on top of all other content for the duration of the animation.

Constructor

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

Method

voidcancel()
Cancel the animation.
ClassgetClass()
Returns the runtime class of this Object .
longgetDuration()
How long this animation should last
InterpolatorgetInterpolator()
Gets the acceleration curve type for this animation.
longgetStartOffset()
When this animation should start, relative to StartTime
longgetStartTime()
When this animation should start.
booleanhasEnded()

Indicates whether this animation has ended or not.

booleanhasStarted()

Indicates whether this animation has started or not.

voidinitialize(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.
booleanisInitialized()
Whether or not the animation has been initialized.
voidreset()
Reset the initialization state of this animation.
voidscaleCurrentDuration(float scale)
How much to scale the duration by.
voidsetAnimationListener(AnimationListener listener)

Binds an animation listener to this animation.

voidsetDuration(long durationMillis)
How long this animation should last.
voidsetFillAfter(boolean fillAfter)
If fillAfter is true, the transformation that this animation performed will persist when it is finished.
voidsetFillBefore(boolean fillBefore)
If fillBefore is true, this animation will apply its transformation before the start time of the animation.
voidsetFillEnabled(boolean fillEnabled)
If fillEnabled is true, the animation will apply the value of fillBefore.
voidsetInterpolator(Interpolator i)
Sets the acceleration curve for this animation.
voidsetInterpolator(Context context, @AnimRes @InterpolatorRes int resID)
Sets the acceleration curve for this animation.
voidsetRepeatCount(int repeatCount)
Sets how many times the animation should be repeated.
voidsetRepeatMode(int repeatMode)
Defines what this animation should do when it reaches the end.
voidsetStartOffset(long startOffset)
When this animation should start relative to the start time.
voidsetStartTime(long startTimeMillis)
When this animation should start.
voidstart()
Convenience method to start the animation the first time #getTransformation(long,Transformation) is invoked.
voidstartNow()
Convenience method to start the animation at the current time in milliseconds.