public class

Transformation

extends Object
java.lang.Object
   ↳ android.view.animation.Transformation

Class Overview

Defines the transformation to be applied at one point in time of an Animation.

Summary

Fields
public static int TYPE_ALPHA Indicates a transformation that applies an alpha only (uses an identity matrix.)
public static int TYPE_BOTH Indicates a transformation that applies an alpha and a matrix.
public static int TYPE_IDENTITY Indicates a transformation that has no effect (alpha = 1 and identity matrix.)
public static int TYPE_MATRIX Indicates a transformation that applies a matrix only (alpha = 1.)
protected float mAlpha
protected Matrix mMatrix
protected int mTransformationType
Public Constructors
Transformation()
Creates a new transformation with alpha = 1 and the identity matrix.
Public Methods
void clear()
Reset the transformation to a state that leaves the object being animated in an unmodified state.
void compose(Transformation t)
Apply this Transformation to an existing Transformation, e.g.
float getAlpha()
Matrix getMatrix()
int getTransformationType()
Indicates the nature of this transformation.
void set(Transformation t)
Clones the specified transformation.
void setAlpha(float alpha)
Sets the degree of transparency
void setTransformationType(int transformationType)
Sets the transformation type.
String toShortString()
Return a string representation of the transformation in a compact form.
String toString()
Returns a string containing a concise, human-readable description of this object.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

public static int TYPE_ALPHA

Indicates a transformation that applies an alpha only (uses an identity matrix.)

public static int TYPE_BOTH

Indicates a transformation that applies an alpha and a matrix.

public static int TYPE_IDENTITY

Indicates a transformation that has no effect (alpha = 1 and identity matrix.)

public static int TYPE_MATRIX

Indicates a transformation that applies a matrix only (alpha = 1.)

protected float mAlpha

protected Matrix mMatrix

protected int mTransformationType

Public Constructors

public Transformation ()

Creates a new transformation with alpha = 1 and the identity matrix.

Public Methods

public void clear ()

Reset the transformation to a state that leaves the object being animated in an unmodified state. The transformation type is TYPE_BOTH by default.

public void compose (Transformation t)

Apply this Transformation to an existing Transformation, e.g. apply a scale effect to something that has already been rotated.

public float getAlpha ()

Returns
  • The degree of transparency

public Matrix getMatrix ()

Returns
  • The 3x3 Matrix representing the trnasformation to apply to the coordinates of the object being animated

public int getTransformationType ()

Indicates the nature of this transformation.

public void set (Transformation t)

Clones the specified transformation.

Parameters
t The transformation to clone.

public void setAlpha (float alpha)

Sets the degree of transparency

Parameters
alpha 1.0 means fully opaqe and 0.0 means fully transparent

public void setTransformationType (int transformationType)

Sets the transformation type.

Parameters
transformationType One of TYPE_ALPHA, TYPE_MATRIX, TYPE_BOTH or TYPE_IDENTITY.

public String toShortString ()

Return a string representation of the transformation in a compact form.

public String toString ()

Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation simply concatenates the class name, the '@' sign and a hexadecimal representation of the object's hashCode(), that is, it is equivalent to the following expression:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Returns
  • a printable representation of this object.