android.view.animation.AlphaAnimation
An animation that controls the alpha level of an object.
Useful for fading things in and out. This animation ends up
changing the alpha property of a Transformation
Summary
|
|
|
Value |
|
int |
ABSOLUTE |
The specified dimension is an absolute number of pixels. |
0 |
0x00000000 |
int |
INFINITE |
Repeat the animation indefinitely. |
-1 |
0xffffffff |
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. |
2 |
0x00000002 |
int |
RELATIVE_TO_SELF |
The specified dimension holds a float and should be multiplied by the
height or width of the object being animated. |
1 |
0x00000001 |
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. |
1 |
0x00000001 |
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). |
2 |
0x00000002 |
int |
START_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. |
-1 |
0xffffffff |
int |
ZORDER_BOTTOM |
Requests that the content being animated be forced under all other
content for the duration of the animation. |
-1 |
0xffffffff |
int |
ZORDER_NORMAL |
Requests that the content being animated be kept in its current Z
order. |
0 |
0x00000000 |
int |
ZORDER_TOP |
Requests that the content being animated be forced on top of all other
content for the duration of the animation. |
1 |
0x00000001 |
Public Constructors
Public Methods
Protected Methods
applyTransformation,
ensureInterpolator,
getDuration,
getFillAfter,
getFillBefore,
getInterpolator,
getRepeatCount,
getRepeatMode,
getStartOffset,
getStartTime,
getTransformation,
getZAdjustment,
hasEnded,
hasStarted,
initialize,
isInitialized,
reset,
resolveSize,
restrictDuration,
scaleCurrentDuration,
setAnimationListener,
setDuration,
setFillAfter,
setFillBefore,
setInterpolator,
setInterpolator,
setRepeatCount,
setRepeatMode,
setStartOffset,
setStartTime,
setZAdjustment,
start,
startNow,
willChangeBounds,
willChangeTransformationMatrix
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Public Constructors
public
AlphaAnimation(Context context, AttributeSet attrs)
Constructor used whan an AlphaAnimation is loaded from a resource.
Parameters
context
| Application context to use |
attrs
| Attribute set from which to read values
|
public
AlphaAnimation(float fromAlpha, float toAlpha)
Constructor to use when building an AlphaAnimation from code
Parameters
fromAlpha
| Starting alpha value for the animation, where 1.0 means
fully opaque and 0.0 means fully transparent. |
toAlpha
| Ending alpha value for the animation.
|
Public Methods
public
boolean
willChangeBounds()
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.
Returns
- true if this animation will change the view's bounds
public
boolean
willChangeTransformationMatrix()
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.
Returns
- true if this animation will change the transformation matrix
Protected Methods
protected
void
applyTransformation(float interpolatedTime, Transformation t)
Changes the alpha property of the supplied
Transformation
Parameters
interpolatedTime
| The value of the normalized time (0.0 to 1.0)
after it has been run through the interpolation function. |
t
| The Transofrmation object to fill in with the current
transforms.
|