public class RotationAnimation extends Animation implements Combinable
Modifier and Type | Field and Description |
---|---|
static int |
PIVOT_BOTTOM_LEFT |
static int |
PIVOT_BOTTOM_RIGHT |
static int |
PIVOT_CENTER |
static int |
PIVOT_TOP_LEFT |
static int |
PIVOT_TOP_RIGHT |
DIRECTION_DOWN, DIRECTION_LEFT, DIRECTION_RIGHT, DIRECTION_UP, DURATION_DEFAULT, DURATION_LONG, DURATION_SHORT
Constructor and Description |
---|
RotationAnimation(View view)
This animation rotates the view by a customizable number of degrees and
at a customizable pivot point.
|
Modifier and Type | Method and Description |
---|---|
void |
animate()
This method animates the properties of the view specific to the Animation
object.
|
AnimatorSet |
getAnimatorSet() |
float |
getDegrees() |
long |
getDuration() |
TimeInterpolator |
getInterpolator() |
AnimationListener |
getListener() |
int |
getPivot()
The available pivot points are
PIVOT_CENTER ,
PIVOT_TOP_LEFT , PIVOT_TOP_RIGHT ,
PIVOT_BOTTOM_LEFT and PIVOT_BOTTOM_RIGHT . |
RotationAnimation |
setDegrees(float degrees)
In order to rotate anti-clockwise, the number of degrees should be
negative.
|
RotationAnimation |
setDuration(long duration) |
RotationAnimation |
setInterpolator(TimeInterpolator interpolator) |
RotationAnimation |
setListener(AnimationListener listener) |
RotationAnimation |
setPivot(int pivot)
The available pivot points are
PIVOT_CENTER ,
PIVOT_TOP_LEFT , PIVOT_TOP_RIGHT ,
PIVOT_BOTTOM_LEFT and PIVOT_BOTTOM_RIGHT . |
public static final int PIVOT_CENTER
public static final int PIVOT_TOP_LEFT
public static final int PIVOT_TOP_RIGHT
public static final int PIVOT_BOTTOM_LEFT
public static final int PIVOT_BOTTOM_RIGHT
public RotationAnimation(View view)
view
- The view to be animated.public void animate()
Animation
animate
in interface Combinable
animate
in class Animation
public AnimatorSet getAnimatorSet()
getAnimatorSet
in interface Combinable
public float getDegrees()
public RotationAnimation setDegrees(float degrees)
degrees
- The number of degrees to set to rotate by.public int getPivot()
PIVOT_CENTER
,
PIVOT_TOP_LEFT
, PIVOT_TOP_RIGHT
,
PIVOT_BOTTOM_LEFT
and PIVOT_BOTTOM_RIGHT
.public RotationAnimation setPivot(int pivot)
PIVOT_CENTER
,
PIVOT_TOP_LEFT
, PIVOT_TOP_RIGHT
,
PIVOT_BOTTOM_LEFT
and PIVOT_BOTTOM_RIGHT
.pivot
- The pivot point to set for rotation.public TimeInterpolator getInterpolator()
public RotationAnimation setInterpolator(TimeInterpolator interpolator)
setInterpolator
in interface Combinable
interpolator
- The interpolator of the entire animation to set.public long getDuration()
getDuration
in interface Combinable
public RotationAnimation setDuration(long duration)
setDuration
in interface Combinable
duration
- The duration of the entire animation to set.public AnimationListener getListener()
public RotationAnimation setListener(AnimationListener listener)
setListener
in interface Combinable
listener
- The listener to set for the end of the animation.