public class ExplodeAnimation extends Animation
Modifier and Type | Field and Description |
---|---|
static int |
MATRIX_1X2 |
static int |
MATRIX_1X3 |
static int |
MATRIX_2X1 |
static int |
MATRIX_2X2 |
static int |
MATRIX_2X3 |
static int |
MATRIX_3X1 |
static int |
MATRIX_3X2 |
static int |
MATRIX_3X3 |
DIRECTION_DOWN, DIRECTION_LEFT, DIRECTION_RIGHT, DIRECTION_UP, DURATION_DEFAULT, DURATION_LONG, DURATION_SHORT
Constructor and Description |
---|
ExplodeAnimation(View view)
This animation creates a bitmap of the view, divides them into
customizable number of X and Y parts and translates the parts away from
the center of the view to mimic an explosion.
|
Modifier and Type | Method and Description |
---|---|
void |
animate()
This method animates the properties of the view specific to the Animation
object.
|
long |
getDuration() |
int |
getExplodeMatrix()
The available matrices are
MATRIX_1X2 ,
MATRIX_1X3 , MATRIX_2X1 , MATRIX_2X2
, MATRIX_2X3 , MATRIX_3X1 ,
MATRIX_3X2 and MATRIX_3X3 . |
TimeInterpolator |
getInterpolator() |
AnimationListener |
getListener() |
ExplodeAnimation |
setDuration(long duration) |
ExplodeAnimation |
setExplodeMatrix(int matrix)
The available matrices are
MATRIX_1X2 ,
MATRIX_1X3 , MATRIX_2X1 , MATRIX_2X2
, MATRIX_2X3 , MATRIX_3X1 ,
MATRIX_3X2 and MATRIX_3X3 . |
ExplodeAnimation |
setInterpolator(TimeInterpolator interpolator) |
ExplodeAnimation |
setListener(AnimationListener listener) |
public static final int MATRIX_1X2
public static final int MATRIX_1X3
public static final int MATRIX_2X1
public static final int MATRIX_2X2
public static final int MATRIX_2X3
public static final int MATRIX_3X1
public static final int MATRIX_3X2
public static final int MATRIX_3X3
public ExplodeAnimation(View view)
view
- The view to be animated.public void animate()
Animation
public int getExplodeMatrix()
MATRIX_1X2
,
MATRIX_1X3
, MATRIX_2X1
, MATRIX_2X2
, MATRIX_2X3
, MATRIX_3X1
,
MATRIX_3X2
and MATRIX_3X3
.public ExplodeAnimation setExplodeMatrix(int matrix)
MATRIX_1X2
,
MATRIX_1X3
, MATRIX_2X1
, MATRIX_2X2
, MATRIX_2X3
, MATRIX_3X1
,
MATRIX_3X2
and MATRIX_3X3
.matrix
- The matrix that determines the number of X and Y parts to set.public TimeInterpolator getInterpolator()
public ExplodeAnimation setInterpolator(TimeInterpolator interpolator)
interpolator
- The interpolator of the entire animation to set.public long getDuration()
public ExplodeAnimation setDuration(long duration)
duration
- The duration of the entire animation to set.public AnimationListener getListener()
public ExplodeAnimation setListener(AnimationListener listener)
listener
- The listener to set for the end of the animation.