diff options
author | Minkyu Kang <mk7.kang@samsung.com> | 2015-09-09 19:16:33 +0900 |
---|---|---|
committer | Minkyu Kang <mk7.kang@samsung.com> | 2015-09-10 13:32:21 +0900 |
commit | 3905646642911a77906c7b5aef18a098bee99d96 (patch) | |
tree | 1b998275b810708be55b433df3fd31cb472bd573 | |
parent | 5845e8b22134c9893d3058f9b6c7e82d5a954f6e (diff) | |
download | air_mediahub-3905646642911a77906c7b5aef18a098bee99d96.tar.gz air_mediahub-3905646642911a77906c7b5aef18a098bee99d96.tar.bz2 air_mediahub-3905646642911a77906c7b5aef18a098bee99d96.zip |
action_menu: add show/hide animation
Change-Id: I7528e186cde25b09c2674362dd1ca2bc0952c07d
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
-rw-r--r-- | include/define.h | 4 | ||||
-rw-r--r-- | res/edc/view/action_menu.edc | 37 | ||||
-rw-r--r-- | src/view/action_menu.c | 46 |
3 files changed, 81 insertions, 6 deletions
diff --git a/include/define.h b/include/define.h index a299ea1..50a55fe 100644 --- a/include/define.h +++ b/include/define.h @@ -89,6 +89,8 @@ #define SIG_SOURCE_SRC "src" #define SIG_SHOW_VIEW "show,view" #define SIG_HIDE_VIEW "hide,view" +#define SIG_HIDE_DONE "hide,done" +#define SIG_HIDE_SET "hide,set" #define SIG_DISMISSED "dismissed" #define SIG_TIMEOUT "timeout" #define SIG_SCROLL "scroll" @@ -103,5 +105,7 @@ #define TRANSITION_SHOW_ICON LINEAR 0.35 #define TRANSITION_SHOW_VIEW SINUSOIDAL 0.20 #define TRANSITION_SHOW_BASE_VIEW DECELERATE 0.01 +#define TRANSITION_SHOW_MENU SINUSOIDAL 0.45 +#define TRANSITION_HIDE_MENU DECELERATE 0.30 #endif /* __AIR_MEDIAHUB_DEFINE_H__ */ diff --git a/res/edc/view/action_menu.edc b/res/edc/view/action_menu.edc index d5f594b..770132e 100644 --- a/res/edc/view/action_menu.edc +++ b/res/edc/view/action_menu.edc @@ -34,6 +34,13 @@ group { state: "default" 0.0; rel1.relative: 1.0 0.0; min: 500 0; + align: 0.0 0.5; + color: COLOR_ITEM_BG; + fixed: 1 0; + } + description { + state: "show" 0.0; + inherit: "default" 0.0; align: 1.0 0.5; color: COLOR_ITEM_BG; fixed: 1 0; @@ -278,6 +285,36 @@ group { } } } + programs { + program { + name: SIG_SHOW_VIEW; + signal: SIG_SHOW_VIEW; + source: SIG_SOURCE_SRC; + action: STATE_SET "show" 0.0; + target: "menu_area"; + transition: TRANSITION_SHOW_MENU; + } + program { + name: SIG_HIDE_VIEW; + signal: SIG_HIDE_VIEW; + source: SIG_SOURCE_SRC; + action: STATE_SET "default" 0.0; + target: "menu_area"; + transition: TRANSITION_HIDE_MENU; + after: SIG_HIDE_DONE; + } + program { + name: SIG_HIDE_DONE; + action: SIGNAL_EMIT SIG_HIDE_DONE SIG_SOURCE_EDC; + } + program { + name: SIG_HIDE_SET; + signal: SIG_HIDE_SET; + source: SIG_SOURCE_SRC; + action: STATE_SET "default" 0.0; + target: "menu_area"; + } + } } group { diff --git a/src/view/action_menu.c b/src/view/action_menu.c index 6366c0a..6925459 100644 --- a/src/view/action_menu.c +++ b/src/view/action_menu.c @@ -138,6 +138,22 @@ struct _content_info content_info[] = { } }; +static void _hide_done(void *data, Evas_Object *obj, + const char *emmision, const char *source) +{ + viewmgr_hide_view(VIEW_ACTION_MENU); +} + +static void _hide_view(struct _priv *priv, bool anim) +{ + if (anim) { + elm_object_signal_emit(priv->base, + SIG_HIDE_VIEW, SIG_SOURCE_SRC); + } else { + viewmgr_hide_view(VIEW_ACTION_MENU); + } +} + static bool _livetv_clicked(struct _priv *priv) { app_control_h app_ctrl; @@ -172,7 +188,7 @@ static bool _livetv_clicked(struct _priv *priv) app_control_destroy(app_ctrl); - viewmgr_hide_view(VIEW_ACTION_MENU); + _hide_view(priv, false); return true; } @@ -223,7 +239,7 @@ static bool _favorite_clicked(struct _priv *priv, Evas_Object *obj) viewmgr_update_view(VIEW_BASE, UPDATE_CONTENT_ITEM, NULL); viewmgr_update_view(VIEW_BASE, UPDATE_TOAST_SHOW, &vdata); - viewmgr_hide_view(VIEW_ACTION_MENU); + _hide_view(priv, true); media_content_disconnect(); @@ -244,12 +260,16 @@ static bool _delete_clicked(struct _priv *priv, Evas_Object *obj) static void _key_down_cb(int id, void *data, Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev) { - if (!ev) + struct _priv *priv; + + if (!ev | !data) return; + priv = data; + if (!strcmp(ev->keyname, KEY_BACK) || !strcmp(ev->keyname, KEY_BACK_REMOTE)) - viewmgr_hide_view(VIEW_ACTION_MENU); + _hide_view(priv, true); } static void _mouse_move_cb(int id, void *data, Evas *e, Evas_Object *obj, @@ -328,7 +348,7 @@ static void _grid_selected(void *data) vdata.list = priv->favorite_list; vdata.index = util_get_media_index(vdata.list, am); - viewmgr_hide_view(VIEW_ACTION_MENU); + _hide_view(priv, false); switch (priv->content_type) { case E_CONTENT_MOVIE: @@ -868,6 +888,9 @@ static Evas_Object *_create(Evas_Object *win, void *data) return NULL; } + elm_object_signal_callback_add(base, SIG_HIDE_DONE, SIG_SOURCE_EDC, + _hide_done, priv); + return base; } @@ -887,6 +910,7 @@ static void _show(void *view_data) viewmgr_update_view(VIEW_BASE, UPDATE_TOAST_HIDE, NULL); elm_object_focus_set(priv->tv_btn, EINA_TRUE); + elm_object_signal_emit(priv->base, SIG_SHOW_VIEW, SIG_SOURCE_SRC); } static void _hide(void *view_data) @@ -900,6 +924,7 @@ static void _hide(void *view_data) priv = view_data; + elm_object_signal_emit(priv->base, SIG_HIDE_SET, SIG_SOURCE_SRC); evas_object_hide(priv->base); } @@ -930,7 +955,16 @@ static void _update(void *view_data, int update_type, void *data) static void _pause(void *view_data) { - viewmgr_hide_view(VIEW_ACTION_MENU); + struct _priv *priv; + + if (!view_data) { + _ERR("failed to get view data"); + return; + } + + priv = view_data; + + _hide_view(priv, false); } static void _destroy(void *view_data) |