English | Site Directory

Android - An Open Handset Alliance Project

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

Constants inherited from class android.view.animation.Animation
Fields 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  willChangeTargetViewBounds()

Indicates whether or not this animation will affect the current bounds of the target 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 willChangeTargetViewBounds()

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

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.

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.
Build m5-rc15g - 14 May 2008 12:50