java.lang.Object | ||
↳ | android.view.animation.Animation | |
↳ | android.view.animation.TranslateAnimation |
An animation that controls the position of an object. See the
full package
description for details and
sample code.
[Expand]
Inherited XML Attributes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
android.view.animation.Animation
|
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
android.view.animation.Animation
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructor used when a TranslateAnimation is loaded from a resource.
| |||||||||||
Constructor to use when building a TranslateAnimation from code
| |||||||||||
Constructor to use when building a TranslateAnimation from code
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Initialize this animation with the dimensions of the object being
animated as well as the objects parents.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Helper for getTransformation.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
android.view.animation.Animation
| |||||||||||
From class
java.lang.Object
|
Constructor used when a TranslateAnimation is loaded from a resource.
context | Application context to use |
---|---|
attrs | Attribute set from which to read values |
Constructor to use when building a TranslateAnimation from code
fromXDelta | Change in X coordinate to apply at the start of the animation |
---|---|
toXDelta | Change in X coordinate to apply at the end of the animation |
fromYDelta | Change in Y coordinate to apply at the start of the animation |
toYDelta | Change in Y coordinate to apply at the end of the animation |
Constructor to use when building a TranslateAnimation from code
fromXType | Specifies how fromXValue should be interpreted. One of Animation.ABSOLUTE, Animation.RELATIVE_TO_SELF, or Animation.RELATIVE_TO_PARENT. |
---|---|
fromXValue | Change in X coordinate to apply at the start of the animation. This value can either be an absolute number if fromXType is ABSOLUTE, or a percentage (where 1.0 is 100%) otherwise. |
toXType | Specifies how toXValue should be interpreted. One of Animation.ABSOLUTE, Animation.RELATIVE_TO_SELF, or Animation.RELATIVE_TO_PARENT. |
toXValue | Change in X coordinate to apply at the end of the animation. This value can either be an absolute number if toXType is ABSOLUTE, or a percentage (where 1.0 is 100%) otherwise. |
fromYType | Specifies how fromYValue should be interpreted. One of Animation.ABSOLUTE, Animation.RELATIVE_TO_SELF, or Animation.RELATIVE_TO_PARENT. |
fromYValue | Change in Y coordinate to apply at the start of the animation. This value can either be an absolute number if fromYType is ABSOLUTE, or a percentage (where 1.0 is 100%) otherwise. |
toYType | Specifies how toYValue should be interpreted. One of Animation.ABSOLUTE, Animation.RELATIVE_TO_SELF, or Animation.RELATIVE_TO_PARENT. |
toYValue | Change in Y coordinate to apply at the end of the animation. This value can either be an absolute number if toYType is ABSOLUTE, or a percentage (where 1.0 is 100%) otherwise. |
Initialize this animation with the dimensions of the object being animated as well as the objects parents. (This is to support animation sizes being specifed 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 getTransformation(long, Transformation)
.
width | Width of the object being animated |
---|---|
height | Height of the object being animated |
parentWidth | Width of the animated object's parent |
parentHeight | Height of the animated object's parent |
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.
interpolatedTime | The value of the normalized time (0.0 to 1.0) after it has been run through the interpolation function. |
---|---|
t | The Transformation object to fill in with the current transforms. |