Page MenuHomePhabricator

efl_ui_animation_view : Change transit facade sequence.
ClosedPublic

Authored by jsuya on Apr 26 2019, 12:44 AM.

Details

Reviewers
Hermet
kimcinoo
Summary
Call PLAY_START smart callback first. before call tansit_go.
Because PLAY_UPDATE smart callback is called when transit_go is called
and transit_cb is called.
Test Plan

refer to comment this revision

Diff Detail

Repository
rEFL core/efl
Branch
devs/hermet/lottie
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 11054
Build 8556: arc lint + arc unit
jsuya created this revision.Apr 26 2019, 12:44 AM
jsuya requested review of this revision.Apr 26 2019, 12:44 AM

Compile with: gcc -o animation_view_example animation_view_example.c -g pkg-config --cflags --libs elementary`

#include <Elementary.h>
static void _play_start_cb(void *data, Evas_Object *obj, void *event_info)
{

Evas_Object *anim_view = data;
Elm_Animation_View_State ret_animation_view_state_get;
ret_animation_view_state_get = elm_animation_view_state_get(anim_view);
printf( "[%s] state:%d ELM_ANIMATION_VIEW_STATE_PLAY:%d\n",__FUNCTION__, ret_animation_view_state_get, ELM_ANIMATION_VIEW_STATE_PLAY);

}

static void _play_pause_cb(void *data, Evas_Object *obj, void *event_info)
{

Evas_Object *anim_view = data;
Elm_Animation_View_State ret_animation_view_state_get;
ret_animation_view_state_get = elm_animation_view_state_get(anim_view);
printf( "[%s] state:%d ELM_ANIMATION_VIEW_STATE_PAUSE:%d\n",__FUNCTION__, ret_animation_view_state_get, ELM_ANIMATION_VIEW_STATE_PAUSE);
elm_animation_view_resume(anim_view);

}

static void _play_resume_cb(void *data, Evas_Object *obj, void *event_info)
{

Evas_Object *anim_view = data;
Elm_Animation_View_State ret_animation_view_state_get;
ret_animation_view_state_get = elm_animation_view_state_get(anim_view);
printf( "[%s] state:%d ELM_ANIMATION_VIEW_STATE_PLAY:%d\n",__FUNCTION__, ret_animation_view_state_get, ELM_ANIMATION_VIEW_STATE_PLAY);

}

static void _play_stop_cb(void *data, Evas_Object *obj, void *event_info)
{

Evas_Object *anim_view = data;
Elm_Animation_View_State ret_animation_view_state_get;
ret_animation_view_state_get = elm_animation_view_state_get(anim_view);
printf( "[%s] state:%d ELM_ANIMATION_VIEW_STATE_STOP:%d\n",__FUNCTION__, ret_animation_view_state_get, ELM_ANIMATION_VIEW_STATE_STOP);
elm_exit();

}

static void _play_update_cb(void *data, Evas_Object *obj, void *event_info)
{

Evas_Object *anim_view = data;
printf( "[%s] progress(%f) frame(%d)\n",__FUNCTION__, elm_animation_view_progress_get(anim_view), elm_animation_view_frame_get(anim_view));
//elm_exit();

}

EAPI_MAIN int
elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
{

Evas_Object *win, *anim_view;

elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
elm_win_autodel_set(win, EINA_TRUE);

anim_view = elm_animation_view_add(win);

Eina_Bool ret_animation_view_file_set = EINA_FALSE;
ret_animation_view_file_set = elm_animation_view_file_set(anim_view, "./lottie_animationview/watchface/snow.json", NULL);

//printf( "[%s] frame count(%d)\n", elm_animation_view_frame_count_get(anim_view));
//elm_animation_view_max_frame_set(anim_view, 20);
//printf( "[%s] max frame(%d)\n", elm_animation_view_max_frame_get(anim_view));
elm_animation_view_min_progress_set(anim_view, 0.5);
printf( "[%s] progress min(%f) max(%f)\n",__FUNCTION__, elm_animation_view_min_progress_get(anim_view), elm_animation_view_max_progress_get(anim_view));

evas_object_smart_callback_add(anim_view, "play,start", _play_start_cb, anim_view);
evas_object_smart_callback_add(anim_view, "play,pause", _play_pause_cb, anim_view);
evas_object_smart_callback_add(anim_view, "play,resume", _play_resume_cb, anim_view);
evas_object_smart_callback_add(anim_view, "play,stop", _play_stop_cb, anim_view);
evas_object_smart_callback_add(anim_view, "play,update", _play_update_cb, anim_view);

//elm_animation_view_auto_repeat_set(anim_view, EINA_TRUE);
evas_object_show(anim_view);
elm_animation_view_play(anim_view);

elm_win_resize_object_add(win, anim_view);
evas_object_resize(win, 320, 320);
evas_object_show(win);

elm_run(); /* and run the program now, starting to handle all
            * events, etc. */

/* exit code */
return 0;

}
ELM_MAIN()

Hermet accepted this revision.Apr 26 2019, 1:47 AM
This revision is now accepted and ready to land.Apr 26 2019, 1:47 AM
Hermet closed this revision.May 8 2019, 1:05 AM