|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface HAnimateEffect
The HAnimateEffect
interface
defines effect constants and controls for time-varying animations.
Implementations of HAnimateEffect should have the following default behaviors:
HAnimateEffect
should be stopped. Hence, to start an HAnimateEffect
the start
method must be explicitly
invoked. This mechanism allows for animations that are
programmatically controlled, e.g. via the setPosition
method.
PLAY_REPEATING
.
REPEAT_INFINITE
.
Field Summary | |
---|---|
static int |
PLAY_ALTERNATING
Indicates that the animation should be played in a repeating loop, alternating between the forward and reverse direction. |
static int |
PLAY_REPEATING
Indicates that the animation should be played forwards (in a repeating loop). |
static int |
REPEAT_INFINITE
This value, when passed to setRepeatCount ,
indicates that the animation shall repeat until the stop method is invoked. |
Method Summary | |
---|---|
int |
getDelay()
Gets the presentation delay for this HAnimateEffect . |
int |
getPlayMode()
Gets the playing mode for this HAnimateEffect . |
int |
getPosition()
Get the current index into the content array which this HAnimateEffect is using to display
content. |
int |
getRepeatCount()
Gets the number of times that this HAnimateEffect is to be played. |
boolean |
isAnimated()
This method indicates the animation (running) state of the HAnimateEffect . |
void |
setDelay(int count)
Sets the delay between the presentation of successive pieces of content (frames). |
void |
setPlayMode(int mode)
Sets the playing mode for this HAnimateEffect . |
void |
setPosition(int position)
Set this HAnimateEffect to
display the content at the specified position. |
void |
setRepeatCount(int count)
Sets the number of times that this HAnimateEffect should be played. |
void |
start()
This method starts this HAnimateEffect playing. |
void |
stop()
This method indicates that the running HAnimateEffect should be
stopped. |
Field Detail |
---|
static final int PLAY_REPEATING
The images are rendered in the same order that they are present in the sequence (array):
If the animation has not repeated sufficiently, then the rendering of the sequence is restarted from the first image, i.e. the images will continue to be rendered in the order:
Each rendering of the sequence of images 0 to (length-1), should be considered as a single "repeat".
static final int PLAY_ALTERNATING
The images are rendered in the same order that they are present in the sequence (array):
If the animation has not repeated sufficiently, then the rendering of the sequence is reversed - i.e. the images are rendered in the order
If the animation has not repeated sufficiently, then the rendering of the sequence is reversed (again) back to a forwards direction. I.e. the images are rendered in the order
Each rendering of the sequence of images forwards or backwards, should be considered as a single "repeat".
Note that when the sequence repeats, the last image (first image) is not rendered consecutively, i.e. twice.
static final int REPEAT_INFINITE
setRepeatCount
,
indicates that the animation shall repeat until the stop
method is invoked.
Method Detail |
---|
void start()
HAnimateEffect
playing. If start
is called when
the animation is already running it resets the animation
according to the current play mode, as returned by getPlayMode
.
void stop()
HAnimateEffect
should be
stopped. After calling this method, there is no guarantee that
one or more frames will not be displayed before the animation
actually stops playing. If the animation is already stopped
further calls to stop
have no effect.
boolean isAnimated()
HAnimateEffect
.
true
if this HAnimateEffect
is running, i.e. the start
method
has been invoked - false
otherwise.void setPosition(int position)
HAnimateEffect
to
display the content at the specified position. If the animation
is already running a call to setPosition
will
change the current value and affect the animation immediately.
position
- an index into the content array which specifies
the next piece of content to be displayed. If
position
is less than 0, then the array element at
index 0 is displayed, if position
is greater than
or equal to the length of the content array, then the array
element at index [length
-1] will be used.int getPosition()
HAnimateEffect
is using to display
content.
0 <= index < length
void setRepeatCount(int count)
HAnimateEffect
should be played.
If the animation is already running a call to
setRepeatCount
will change the current value and
reset the current number of repeats to 0, affecting the
animation immediately.
count
- the number of times that an HAnimateEffect
should be
played. Valid values of the repeat count are one or more, and
REPEAT_INFINITE
.int getRepeatCount()
HAnimateEffect
is to be played. Note that this method does not
return the number of repeats that are remaining to be played.
Except for HAnimateEffect
implementations that specify a
different default, getRepeatCount()
returns
REPEAT_INFINITE
if no call to
setRepeatCount()
has previously been made.
HAnimateEffect
is to be played. The
returned value shall be greater than zero, or REPEAT_INFINITE
.void setDelay(int count)
After calling setDelay
on a currently playing HAnimateEffect
, there is no
guarantee that one or more frames will not be displayed using
the previous delay until the new delay value takes effect.
count
- the content presentation delay in units of 0.1
seconds duration. If count is less than one "unit",
then it shall be treated as if it were a delay of one
"unit", i.e. 0.1 seconds.int getDelay()
HAnimateEffect
.
void setPlayMode(int mode)
HAnimateEffect
. If the animation is already running a call to
setPlayMode
will change the current value and
affect the animation immediately. The position of the animation
is unchanged.
mode
- the play mode for this HAnimateEffect
, which must be either PLAY_ALTERNATING
or PLAY_REPEATING
.int getPlayMode()
HAnimateEffect
.
HAnimateEffect
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |