Android
android.view.animation
public class

android.view.animation.AlphaAnimation

java.lang.Object
android.view.animation.Animation
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

XML Attributes inherited from class android.view.animation.Animation
Constants inherited from class android.view.animation.Animation

Public Constructors

            AlphaAnimation(Context context, AttributeSet attrs)
Constructor used whan an AlphaAnimation is loaded from a resource.
            AlphaAnimation(float fromAlpha, float toAlpha)
Constructor to use when building an AlphaAnimation from code

Public Methods

          boolean  willChangeBounds()

Indicates whether or not this animation will affect the bounds of the animated view.

          boolean  willChangeTransformationMatrix()

Indicates whether or not this animation will affect the transformation matrix.

Protected Methods

          void  applyTransformation(float interpolatedTime, Transformation t)
Changes the alpha property of the supplied Transformation
Methods inherited from class android.view.animation.Animation
Methods inherited from class java.lang.Object

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.
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:48