Tizen Native API  7.0
Animation View

Animation_View widget is designed to show and play animation of vector graphics based content. It hides all efl_canvas_vg details but just open an API to read vector data from file. Also, it implements details of animation control methods of Vector.

Vector data could contain static or animatable vector elements including animation infomation. Currently approved vector data file format is svg, json and eet. Only json(known for Lottie file as well) and eet could contains animation infomation, currently Animation_View is supporting.

This widget emits the following signals, besides the ones sent from Animation View.

  • "play,start": animation is just started.
  • "play,repeat": animation is just repeated.
  • "play,done": animation is just finished.
  • "play,pause": animation is just paused.
  • "play,resume": animation is just resumed.
  • "play,stop": animation is just stopped.
  • "play,update": animation is updated to the next frame.

Functions

void elm_animation_view_auto_play_set (Elm_Animation_View *obj, Eina_Bool auto_play)
 Animation will be started automatically when it's possible.
Eina_Bool elm_animation_view_auto_play_get (const Elm_Animation_View *obj)
 Animation will be started automatically when it's possible.
void elm_animation_view_auto_repeat_set (Elm_Animation_View *obj, Eina_Bool auto_repeat)
 Turn on/off animation looping.
Eina_Bool elm_animation_view_auto_repeat_get (const Elm_Animation_View *obj)
 Turn on/off animation looping.
Eina_Bool elm_animation_view_speed_set (Elm_Animation_View *obj, double speed)
 Control animation speed.
double elm_animation_view_speed_get (const Elm_Animation_View *obj)
 Control animation speed.
double elm_animation_view_duration_time_get (const Elm_Animation_View *obj)
 Get the duration of animation in seconds.
void elm_animation_view_progress_set (Elm_Animation_View *obj, double progress)
 Set current progress position of animation view object.
double elm_animation_view_progress_get (const Elm_Animation_View *obj)
 Set current progress position of animation view object.
void elm_animation_view_frame_set (Elm_Animation_View *obj, int frame_num)
 Number of current frame.
int elm_animation_view_frame_get (const Elm_Animation_View *obj)
 Number of current frame.
Eina_Bool elm_animation_view_play (Elm_Animation_View *obj)
 Play animation one time instantly when it's available.
Eina_Bool elm_animation_view_play_back (Elm_Animation_View *obj)
 Play back animation one time instantly when it's available.
Eina_Bool elm_animation_view_pause (Elm_Animation_View *obj)
 Pause current animation instantly.
Eina_Bool elm_animation_view_resume (Elm_Animation_View *obj)
 Resume paused animation to continue animation.
Eina_Bool elm_animation_view_stop (Elm_Animation_View *obj)
 Stop playing animation.
Eina_Size2D elm_animation_view_default_size_get (const Elm_Animation_View *obj)
Eina_Bool elm_animation_view_is_playing_back (Elm_Animation_View *obj)
 Returns the status whether current animation is on playing forward or backward. warning: If animation view is not on playing, it will return false.
int elm_animation_view_frame_count_get (const Elm_Animation_View *obj)
 Get the index of end frame of the animation view, if it's animated. note : frame number starts with 0.
void elm_animation_view_min_progress_set (Elm_Animation_View *obj, double min_progress)
 The start progress of the play. Default value is 0.
double elm_animation_view_min_progress_get (const Elm_Animation_View *obj)
 The start progress of the play. Default value is 0.
void elm_animation_view_max_progress_set (Elm_Animation_View *obj, double max_progress)
 The last progress of the play. Default value is 1.
double elm_animation_view_max_progress_get (const Elm_Animation_View *obj)
 The last progress of the play. Default value is 1.
void elm_animation_view_min_frame_set (Elm_Animation_View *obj, int min_frame)
 The start frame of the play. Default value is 0.
int elm_animation_view_min_frame_get (const Elm_Animation_View *obj)
 The start frame of the play. Default value is 0.
void elm_animation_view_max_frame_set (Elm_Animation_View *obj, int max_frame)
 The last frame of the play. Default value is elm_animation_view_frame_count_get - 1.
int elm_animation_view_max_frame_get (const Elm_Animation_View *obj)
 The last frame of the play. Default value is elm_animation_view_frame_count_get - 1.
Elm_Animation_View * elm_animation_view_add (Evas_Object *parent)
Eina_Bool elm_animation_view_file_set (Elm_Animation_View *obj, const char *file, const char *key)
Elm_Animation_View_State elm_animation_view_state_get (Elm_Animation_View *obj)
 Get current animation view state.

Function Documentation

Elm_Animation_View* elm_animation_view_add ( Evas_Object parent)

Add a new animation view widget to the parent's canvas

Parameters:
parentThe parent object
Returns:
The new animation view object or NULL if it failed to create.
Since (EFL) :
1.23
Since :
5.5
Eina_Bool elm_animation_view_auto_play_get ( const Elm_Animation_View *  obj)

Animation will be started automatically when it's possible.

If elm_animation_view_auto_play_get is true, animation will be started when it's readied. The condition of auto play is when animation view opened file successfully, yet to play it plus when the object is visible. If animation view is disabled, invisible, it turns to pause state then resume animation when it's visible again.

Warning:
This auto play will be only affected to the next animation source. So must be called before setting animation file

Returns auto play mode of an animation view object.

Parameters:
[in]objThe object.
Returns:
Auto play mode, Default value is false
Since (EFL) :
1.23
Since :
5.5
void elm_animation_view_auto_play_set ( Elm_Animation_View *  obj,
Eina_Bool  auto_play 
)

Animation will be started automatically when it's possible.

If elm_animation_view_auto_play_get is true, animation will be started when it's readied. The condition of auto play is when animation view opened file successfully, yet to play it plus when the object is visible. If animation view is disabled, invisible, it turns to pause state then resume animation when it's visible again.

Warning:
This auto play will be only affected to the next animation source. So must be called before setting animation file

Set auto play mode of an animation view object. true Enable auto play mode, disable otherwise

Parameters:
[in]objThe object.
[in]auto_playAuto play mode, Default value is false
Since (EFL) :
1.23
Since :
5.5
Eina_Bool elm_animation_view_auto_repeat_get ( const Elm_Animation_View *  obj)

Turn on/off animation looping.

If elm_animation_view_auto_repeat_get is true, it repeats animation when animation frame is reached to end. This auto repeat mode is valid to both play and play_back cases.

Returns auto repeat mode of an animation view object.

Parameters:
[in]objThe object.
Returns:
Loop mode, Defalut is false.
Since (EFL) :
1.23
Since :
5.5
void elm_animation_view_auto_repeat_set ( Elm_Animation_View *  obj,
Eina_Bool  auto_repeat 
)

Turn on/off animation looping.

If elm_animation_view_auto_repeat_get is true, it repeats animation when animation frame is reached to end. This auto repeat mode is valid to both play and play_back cases.

Enable loop mode if true, disable otherwise.

Parameters:
[in]objThe object.
[in]auto_repeatLoop mode, Defalut is false.
Since (EFL) :
1.23
Since :
5.5
Eina_Size2D elm_animation_view_default_size_get ( const Elm_Animation_View *  obj)

Get the default view size that specified from vector resource.

Since (EFL) :
1.23
Since :
5.5
double elm_animation_view_duration_time_get ( const Elm_Animation_View *  obj)

Get the duration of animation in seconds.

This API returns total duration time of current animation in the seconds. If current animation source isn't animatable, it returns zero.

Returns current duration of an animation in seconds.

Parameters:
[in]objThe object.
Returns:
duration time in the seconds
Since (EFL) :
1.23
Since :
5.5
Eina_Bool elm_animation_view_file_set ( Elm_Animation_View *  obj,
const char *  file,
const char *  key 
)

Set the source file from where an vector object must fetch the real vector data (it may be one of json, svg, eet files).

If the file supports multiple data stored in it (as Eet files do), you can specify the key to be used as the index of the vector in this file.

Parameters:
[in]fileThe vector file path.
[in]keyThe vector key in file (if its an Eet one), or NULL, otherwise.
Returns:
EINA_TRUE if it's succeed to read file, EINA_FALSE otherwise.
Since (EFL) :
1.23
Since :
5.5
int elm_animation_view_frame_count_get ( const Elm_Animation_View *  obj)

Get the index of end frame of the animation view, if it's animated. note : frame number starts with 0.

Parameters:
[in]objThe object.
Returns:
The number of frames. 0, if it's not animated.
Since (EFL) :
1.23
Since :
5.5
int elm_animation_view_frame_get ( const Elm_Animation_View *  obj)

Number of current frame.

Ranges from 0 to elm_animation_view_frame_count_get - 1.

Returns the current frame of an animation view object.

Parameters:
[in]objThe object.
Returns:
Current frame number.
Since (EFL) :
1.23
Since :
5.5
void elm_animation_view_frame_set ( Elm_Animation_View *  obj,
int  frame_num 
)

Number of current frame.

Ranges from 0 to elm_animation_view_frame_count_get - 1.

Set the current frame of an animation view object.

Parameters:
[in]objThe object.
[in]frame_numCurrent frame number.
Since (EFL) :
1.23
Since :
5.5
Eina_Bool elm_animation_view_is_playing_back ( Elm_Animation_View *  obj)

Returns the status whether current animation is on playing forward or backward. warning: If animation view is not on playing, it will return false.

Parameters:
[in]objThe object.
Returns:
true, if animation on playing back, false otherwise.
Since (EFL) :
1.23
Since :
5.5
int elm_animation_view_max_frame_get ( const Elm_Animation_View *  obj)

The last frame of the play. Default value is elm_animation_view_frame_count_get - 1.

Returns maximum frame of an animation object.

Parameters:
[in]objThe object.
Returns:
The maximum frame for play. Value must be elm_animation_view_min_frame_get ~ (elm_animation_view_frame_count_get - 1)
Since (EFL) :
1.23
Since :
5.5
void elm_animation_view_max_frame_set ( Elm_Animation_View *  obj,
int  max_frame 
)

The last frame of the play. Default value is elm_animation_view_frame_count_get - 1.

Set maximum frame of an animation object.

Parameters:
[in]objThe object.
[in]max_frameThe maximum frame for play. Value must be elm_animation_view_min_frame_get ~ (elm_animation_view_frame_count_get - 1)
Since (EFL) :
1.23
Since :
5.5
double elm_animation_view_max_progress_get ( const Elm_Animation_View *  obj)

The last progress of the play. Default value is 1.

Returns last progress of an animation object.

Parameters:
[in]objThe object.
Returns:
The maximum progress. Value must be 0 ~ 1.
Since (EFL) :
1.23
Since :
5.5
void elm_animation_view_max_progress_set ( Elm_Animation_View *  obj,
double  max_progress 
)

The last progress of the play. Default value is 1.

Set last progress of an animation object.

Parameters:
[in]objThe object.
[in]max_progressThe maximum progress. Value must be 0 ~ 1.
Since (EFL) :
1.23
Since :
5.5
int elm_animation_view_min_frame_get ( const Elm_Animation_View *  obj)

The start frame of the play. Default value is 0.

Returns minimum frame of an animation object.

Parameters:
[in]objThe object.
Returns:
The minimum frame for play. Value must be 0 ~ elm_animation_view_max_frame_get
Since (EFL) :
1.23
Since :
5.5
void elm_animation_view_min_frame_set ( Elm_Animation_View *  obj,
int  min_frame 
)

The start frame of the play. Default value is 0.

Set minimum frame of an animation object.

Parameters:
[in]objThe object.
[in]min_frameThe minimum frame for play. Value must be 0 ~ elm_animation_view_max_frame_get
Since (EFL) :
1.23
Since :
5.5
double elm_animation_view_min_progress_get ( const Elm_Animation_View *  obj)

The start progress of the play. Default value is 0.

Returns start progress of an animation object.

Parameters:
[in]objThe object.
Returns:
The minimum progress. Value must be 0 ~ 1.
Since (EFL) :
1.23
Since :
5.5
void elm_animation_view_min_progress_set ( Elm_Animation_View *  obj,
double  min_progress 
)

The start progress of the play. Default value is 0.

Set start progress of an animation object.

Parameters:
[in]objThe object.
[in]min_progressThe minimum progress. Value must be 0 ~ 1.
Since (EFL) :
1.23
Since :
5.5
Eina_Bool elm_animation_view_pause ( Elm_Animation_View *  obj)

Pause current animation instantly.

Once animation is paused, animation view must get resume to play continue again.

Warning:
Animation must be on playing or playing back status.
Parameters:
[in]objThe object.
Returns:
true when it's successful. false otherwise.
Since (EFL) :
1.23
Since :
5.5
Eina_Bool elm_animation_view_play ( Elm_Animation_View *  obj)

Play animation one time instantly when it's available.

If current keyframe is on a certain position by playing back, this will play forward from there.

Warning:
Play request will be ignored if animation source is not set yet or animation is paused state or it's already on playing.
Parameters:
[in]objThe object.
Returns:
true when it's successful. false otherwise.
Since (EFL) :
1.23
Since :
5.5
Eina_Bool elm_animation_view_play_back ( Elm_Animation_View *  obj)

Play back animation one time instantly when it's available.

If current keyframe is on a certain position by playing, this will play backward from there.

Warning:
Play back request will be ignored if animation source is not set yet or animation is paused state or it's already on playing back.
Parameters:
[in]objThe object.
Returns:
true when it's successful. false otherwise.
Since (EFL) :
1.23
Since :
5.5
double elm_animation_view_progress_get ( const Elm_Animation_View *  obj)

Set current progress position of animation view object.

When you required to jump on a certain frame instantly, you can change current position by using this API.

Warning:
The range of progress is 0 ~ 1.

Returns current progress position of an animation view object.

Parameters:
[in]objThe object.
Returns:
Progress position. Value must be 0 ~ 1.
Since (EFL) :
1.23
Since :
5.5
void elm_animation_view_progress_set ( Elm_Animation_View *  obj,
double  progress 
)

Set current progress position of animation view object.

When you required to jump on a certain frame instantly, you can change current position by using this API.

Warning:
The range of progress is 0 ~ 1.

Set the current progress position of an animation view object.

Parameters:
[in]objThe object.
[in]progressProgress position. Value must be 0 ~ 1.
Since (EFL) :
1.23
Since :
5.5
Eina_Bool elm_animation_view_resume ( Elm_Animation_View *  obj)

Resume paused animation to continue animation.

Warning:
This resume must be called on animation paused status.
Parameters:
[in]objThe object.
Returns:
true when it's successful. false otherwise.
Since (EFL) :
1.23
Since :
5.5
double elm_animation_view_speed_get ( const Elm_Animation_View *  obj)

Control animation speed.

Control animation speed by multiplying speed value. If you want to play animation double-time faster, you can give speed 2. If you want to play animation double-time slower, you can give speed 0.5.

Warning:
speed must be greater than zero.

Returns current animation speed of an animation view object.

Parameters:
[in]objThe object.
Returns:
Speed factor. Default value is 1.0
Since (EFL) :
1.23
Since :
5.5
Eina_Bool elm_animation_view_speed_set ( Elm_Animation_View *  obj,
double  speed 
)

Control animation speed.

Control animation speed by multiplying speed value. If you want to play animation double-time faster, you can give speed 2. If you want to play animation double-time slower, you can give speed 0.5.

Warning:
speed must be greater than zero.
Parameters:
[in]objThe object.
[in]speedSpeed factor. Default value is 1.0
Returns:
true when it's successful. false otherwise.
Since (EFL) :
1.23
Since :
5.5
Elm_Animation_View_State elm_animation_view_state_get ( Elm_Animation_View *  obj)

Get current animation view state.

Returns:
Current animation view state
See also:
Elm_Animation_View_State
Since (EFL) :
1.23
Since :
5.5
Eina_Bool elm_animation_view_stop ( Elm_Animation_View *  obj)

Stop playing animation.

Stop animation instatly regardless of it's status and reset to show first frame of animation. Even though current animation is paused, the animation status will be stopped.

Parameters:
[in]objThe object.
Returns:
true when it's successful. false otherwise.
Since (EFL) :
1.23
Since :
5.5