summaryrefslogtreecommitdiff
path: root/src/bin/elementary
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-12-04 17:45:25 +0100
committerXavi Artigas <xavierartigas@yahoo.es>2019-12-04 17:52:51 +0100
commit76fa7184a4a4568dabdd76fa44e287415c18c11f (patch)
treedd242c95fbf38ae24c5a4763687590e07abf888f /src/bin/elementary
parentb179e397d66c29712a7c38254b8c67daa6a77dc0 (diff)
efl_canvas_animation_group: show that playing backwards is also working
Summary: playing backwards is also working, this is simply shown here, the handcrafted backwards animation wasnt showing the correct animation either. Depends on D10799 Reviewers: segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10802
Diffstat (limited to 'src/bin/elementary')
-rw-r--r--src/bin/elementary/test_efl_anim_group_parallel.c27
-rw-r--r--src/bin/elementary/test_efl_anim_group_sequential.c33
2 files changed, 2 insertions, 58 deletions
diff --git a/src/bin/elementary/test_efl_anim_group_parallel.c b/src/bin/elementary/test_efl_anim_group_parallel.c
index ed319e5..728c54e 100644
--- a/src/bin/elementary/test_efl_anim_group_parallel.c
+++ b/src/bin/elementary/test_efl_anim_group_parallel.c
@@ -5,7 +5,6 @@
5 5
6typedef struct _App_Data 6typedef struct _App_Data
7{ 7{
8 Efl_Canvas_Animation *parallel_show_anim;
9 Efl_Canvas_Animation *parallel_hide_anim; 8 Efl_Canvas_Animation *parallel_hide_anim;
10 Elm_Button *button; 9 Elm_Button *button;
11 10
@@ -49,7 +48,7 @@ _btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
49 if (ad->is_btn_visible) 48 if (ad->is_btn_visible)
50 { 49 {
51 //Create Animation Object from Animation 50 //Create Animation Object from Animation
52 efl_canvas_object_animation_start(ad->button, ad->parallel_show_anim, 1.0, 0.0); 51 efl_canvas_object_animation_start(ad->button, ad->parallel_hide_anim, -1.0, 0.0);
53 efl_text_set(obj, "Start Parallel Group Animation to hide button"); 52 efl_text_set(obj, "Start Parallel Group Animation to hide button");
54 } 53 }
55 else 54 else
@@ -88,29 +87,6 @@ test_efl_anim_group_parallel(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSE
88 evas_object_show(btn); 87 evas_object_show(btn);
89 efl_event_callback_array_add(btn, animation_stats_cb(), ad); 88 efl_event_callback_array_add(btn, animation_stats_cb(), ad);
90 89
91 //Show Animation
92 Efl_Canvas_Animation *show_anim = efl_add(EFL_CANVAS_ANIMATION_ALPHA_CLASS, win);
93 efl_animation_alpha_set(show_anim, 0.0, 1.0);
94
95 //Rotate from 45 to 0 degrees Animation
96 Efl_Canvas_Animation *ccw_45_degrees_anim = efl_add(EFL_CANVAS_ANIMATION_ROTATE_CLASS, win);
97 efl_animation_rotate_set(ccw_45_degrees_anim, 45.0, 0.0, NULL, EINA_VECTOR2(0.5, 0.5));
98
99 //Scale Animation to zoom out
100 Efl_Canvas_Animation *scale_half_anim = efl_add(EFL_CANVAS_ANIMATION_SCALE_CLASS, win);
101 efl_animation_scale_set(scale_half_anim, EINA_VECTOR2(2.0, 2.0), EINA_VECTOR2(1.0, 1.0), NULL, EINA_VECTOR2(0.5, 0.5));
102
103 //Show Parallel Group Animation
104 Efl_Canvas_Animation *parallel_show_anim = efl_add(EFL_CANVAS_ANIMATION_GROUP_PARALLEL_CLASS, win);
105 efl_animation_duration_set(parallel_show_anim, 1.0);
106 efl_animation_final_state_keep_set(parallel_show_anim, EINA_TRUE);
107
108 //Add animations to group animation
109 efl_animation_group_animation_add(parallel_show_anim, show_anim);
110 efl_animation_group_animation_add(parallel_show_anim, ccw_45_degrees_anim);
111 efl_animation_group_animation_add(parallel_show_anim, scale_half_anim);
112
113
114 //Hide Animation 90 //Hide Animation
115 Efl_Canvas_Animation *hide_anim = efl_add(EFL_CANVAS_ANIMATION_ALPHA_CLASS, win); 91 Efl_Canvas_Animation *hide_anim = efl_add(EFL_CANVAS_ANIMATION_ALPHA_CLASS, win);
116 efl_animation_alpha_set(hide_anim, 1.0, 0.0); 92 efl_animation_alpha_set(hide_anim, 1.0, 0.0);
@@ -135,7 +111,6 @@ test_efl_anim_group_parallel(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSE
135 111
136 112
137 //Initialize App Data 113 //Initialize App Data
138 ad->parallel_show_anim = parallel_show_anim;
139 ad->parallel_hide_anim = parallel_hide_anim; 114 ad->parallel_hide_anim = parallel_hide_anim;
140 ad->button = btn; 115 ad->button = btn;
141 116
diff --git a/src/bin/elementary/test_efl_anim_group_sequential.c b/src/bin/elementary/test_efl_anim_group_sequential.c
index 37b4e53..60b3a83 100644
--- a/src/bin/elementary/test_efl_anim_group_sequential.c
+++ b/src/bin/elementary/test_efl_anim_group_sequential.c
@@ -5,7 +5,6 @@
5 5
6typedef struct _App_Data 6typedef struct _App_Data
7{ 7{
8 Efl_Canvas_Animation *sequential_show_anim;
9 Efl_Canvas_Animation *sequential_hide_anim; 8 Efl_Canvas_Animation *sequential_hide_anim;
10 Elm_Button *button; 9 Elm_Button *button;
11 10
@@ -49,7 +48,7 @@ _btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
49 if (ad->is_btn_visible) 48 if (ad->is_btn_visible)
50 { 49 {
51 //Create Animation Object from Animation 50 //Create Animation Object from Animation
52 efl_canvas_object_animation_start(ad->button, ad->sequential_show_anim, 1.0, 0.0); 51 efl_canvas_object_animation_start(ad->button, ad->sequential_hide_anim, -1.0, 0.0);
53 efl_text_set(obj, "Start Sequential Group Animation to hide button"); 52 efl_text_set(obj, "Start Sequential Group Animation to hide button");
54 } 53 }
55 else 54 else
@@ -111,37 +110,7 @@ test_efl_anim_group_sequential(void *data EINA_UNUSED, Evas_Object *obj EINA_UNU
111 efl_animation_group_animation_add(sequential_hide_anim, scale_double_anim); 110 efl_animation_group_animation_add(sequential_hide_anim, scale_double_anim);
112 efl_animation_group_animation_add(sequential_hide_anim, hide_anim); 111 efl_animation_group_animation_add(sequential_hide_anim, hide_anim);
113 112
114
115 /* Animations to show button */
116 //Show Animation
117 Efl_Canvas_Animation *show_anim = efl_add(EFL_CANVAS_ANIMATION_ALPHA_CLASS, win);
118 efl_animation_alpha_set(show_anim, 0.0, 1.0);
119 efl_animation_duration_set(show_anim, 1.0);
120
121 //Scale Animation to zoom out
122 Efl_Canvas_Animation *scale_half_anim = efl_add(EFL_CANVAS_ANIMATION_SCALE_CLASS, win);
123 efl_animation_scale_set(scale_half_anim, EINA_VECTOR2(2.0, 2.0), EINA_VECTOR2(1.0, 1.0), NULL, EINA_VECTOR2(0.5, 0.5));
124 efl_animation_duration_set(scale_half_anim, 1.0);
125
126 //Rotate from 45 to 0 degrees Animation
127 Efl_Canvas_Animation *ccw_45_degrees_anim = efl_add(EFL_CANVAS_ANIMATION_ROTATE_CLASS, win);
128 efl_animation_rotate_set(ccw_45_degrees_anim, 45.0, 0.0, NULL, EINA_VECTOR2(0.5, 0.5));
129 efl_animation_duration_set(ccw_45_degrees_anim, 1.0);
130
131 //Show Sequential Group Animation
132 Efl_Canvas_Animation *sequential_show_anim = efl_add(EFL_CANVAS_ANIMATION_GROUP_SEQUENTIAL_CLASS, win);
133 efl_animation_final_state_keep_set(sequential_show_anim, EINA_TRUE);
134 //efl_animation_duration_set() is called for each animation not to set the same duration
135
136 //Add animations to group animation
137 //First, parallel_hide_anim is added with duration 0 to set the initial state
138 efl_animation_group_animation_add(sequential_show_anim, show_anim);
139 efl_animation_group_animation_add(sequential_show_anim, scale_half_anim);
140 efl_animation_group_animation_add(sequential_show_anim, ccw_45_degrees_anim);
141
142
143 //Initialize App Data 113 //Initialize App Data
144 ad->sequential_show_anim = sequential_show_anim;
145 ad->sequential_hide_anim = sequential_hide_anim; 114 ad->sequential_hide_anim = sequential_hide_anim;
146 ad->button = btn; 115 ad->button = btn;
147 116