add action menu view 44/46044/1
authorSoohye Shin <soohye.shin@samsung.com>
Thu, 13 Aug 2015 11:04:02 +0000 (20:04 +0900)
committerSoohye Shin <soohye.shin@samsung.com>
Thu, 13 Aug 2015 11:04:02 +0000 (20:04 +0900)
Change-Id: I95bb9bdf12d83c2346267c3c14735fb45ed9f9e3
Signed-off-by: Soohye Shin <soohye.shin@samsung.com>
CMakeLists.txt
edje/home.edc
edje/view/actionmenu.edc [new file with mode: 0644]
edje/widget/label.edc
images/btn_menu_reset_foc.png [new file with mode: 0644]
images/btn_menu_reset_nor.png [new file with mode: 0644]
include/defs.h
include/view.h
src/view/view_action_menu.c [new file with mode: 0644]
src/view/view_user_edit.c

index 54bddcc..3e97035 100644 (file)
@@ -52,7 +52,8 @@ SET(SRCS
                src/view/view_user_edit.c
                src/view/view_user.c
                src/view/view_recent.c
-               src/view/view_home.c)
+               src/view/view_home.c
+               src/view/view_action_menu.c)
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
 ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE_NAME}\"")
 ADD_DEFINITIONS("-DEDJEDIR=\"${EDJEDIR}\"")
index 1d06e76..456c1a4 100644 (file)
@@ -23,4 +23,5 @@ collections {
        #include "view/user.edc"
        #include "view/useredit.edc"
        #include "view/photo.edc"
+       #include "view/actionmenu.edc"
 }
diff --git a/edje/view/actionmenu.edc b/edje/view/actionmenu.edc
new file mode 100644 (file)
index 0000000..c3f33ec
--- /dev/null
@@ -0,0 +1,385 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "../../include/defs.h"
+group {
+       name, GRP_ACTION_MENU;
+       parts {
+               part {
+                       name, "bg";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               color, 0 0 0 150;
+                       }
+               }
+               part {
+                       name, "bar";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               rel1.relative, 1.0 0.0;
+                               min, 500 0;
+                               fixed, 1 0;
+                               align, 1.0 0.5;
+                       }
+               }
+               part {
+                       name, "divider.left";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               rel1.to, "bar";
+                               rel2 {
+                                       to, "bar";
+                                       relative, 0.0 1.0;
+                               }
+                               min, 1 0;
+                               align, 1.0 0.5;
+                               fixed, 1 0;
+                               color, 224 224 224 255;
+                       }
+               }
+               part {
+                       name, "livetv";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               rel1.to, "bar";
+                               rel2 {
+                                       to, "bar";
+                                       relative, 1.0 0.0;
+                               }
+                               min, 0 118;
+                               align, 0.5 0.0;
+                               fixed, 0 1;
+                       }
+               }
+               part {
+                       name, PART_ACTION_MENU_LIVETV;
+                       type, SWALLOW;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               rel1 {
+                                       to, "livetv";
+                                       relative, 0.5 0.5;
+                               }
+                               rel2 {
+                                       to, "livetv";
+                                       relative, 0.5 0.5;
+                               }
+                               min, 372 64;
+                               fixed, 1 1;
+                       }
+               }
+               part {
+                       name, "divider.up";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               rel1 {
+                                       to, "livetv";
+                                       relative, 0.0 1.0;
+                               }
+                               rel2.to, "livetv";
+                               color, 224 224 224 255;
+                               min, 0 1;
+                               align, 0.5 0.0;
+                               fixed, 0 1;
+                       }
+               }
+               part {
+                       name, PART_ACTION_MENU_TABLE;
+                       type, SWALLOW;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               rel1 {
+                                       to, "divider.up";
+                                       relative, 0.0 1.0;
+                               }
+                               rel2.to, "divider.up";
+                               min, 0 124;
+                               align, 0.5 0.0;
+                               fixed, 0 1;
+                       }
+               }
+               part {
+                       name, "divider.down";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               rel1 {
+                                       to, PART_ACTION_MENU_TABLE;
+                                       relative, 0.0 1.0;
+                               }
+                               rel2.to, PART_ACTION_MENU_TABLE;
+                               color, 224 224 224 255;
+                               min, 0 1;
+                               align, 0.5 0.0;
+                               fixed, 0 1;
+                       }
+               }
+       }
+}
+group {
+       name, GRP_ACTION_MENU_LIVETV;
+       parts {
+               part {
+                       name, "bg";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 372 64;
+                               color, 194 194 194 255;
+                       }
+                       description {
+                               state, "focus" 0.0;
+                               inherit, "default" 0.0;
+                               color, 0 119 246 255;
+                       }
+               }
+               part {
+                       name, "area";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 370 62;
+                               rel1.relative, 0.5 0.5;
+                               rel2.relative, 0.5 0.5;
+                               fixed, 1 1;
+                               color, 255 255 255 255;
+                       }
+                       description {
+                               state, "focus" 0.0;
+                               inherit, "default" 0.0;
+                               color, 0 119 246 255;
+                       }
+               }
+               part {
+                       name, "text";
+                       type, TEXT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               text {
+                                       font, "TizenSans";
+                                       size, 28;
+                                       text, "Live TV";
+                               }
+                               color, 87 87 87 255;
+                               fixed, 1 1;
+                       }
+                       description {
+                               state, "focus" 0.0;
+                               inherit, "default" 0.0;
+                               color, 255 255 255 255;
+                       }
+               }
+       }
+       programs {
+               program {
+                       name, "sig,focus";
+                       signal, SIG_FOCUS;
+                       source, SRC_PROG;
+                       action, STATE_SET "focus" 0.0;
+                       target, "text";
+                       target, "area";
+                       target, "bg";
+               }
+               program {
+                       name, "sig,unfocus";
+                       signal, SIG_UNFOCUS;
+                       source, SRC_PROG;
+                       action, STATE_SET "default" 0.0;
+                       target, "text";
+                       target, "area";
+                       target, "bg";
+               }
+       }
+}
+group {
+       name, GRP_ACTION_MENU_TABLE_ITEM;
+       parts {
+               part {
+                       name, "bg";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 125 124;
+                       }
+               }
+               part {
+                       name, "divider";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               rel1.relative, 1.0 0.0;
+                               min, 1 0;
+                               fixed, 1 0;
+                               color, 224 224 224 255;
+                               align, 1.0 0.5;
+                       }
+               }
+               part {
+                       name, "pad.icon";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 0 14;
+                               rel1.relative, 0.5 0.0;
+                               rel2.relative, 0.5 0.0;
+                               fixed, 1 1;
+                               align, 0.0 0.0;
+                       }
+               }
+               part {
+                       name, "clip";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               color, 0 0 0 0;
+                       }
+                       description {
+                               state, "focus" 0.0;
+                               inherit, "default" 0.0;
+                               color, 255 255 255 255;
+                       }
+               }
+               part {
+                       name, PART_ACTION_MENU_TABLE_ITEM_BG;
+                       type, SWALLOW;
+                       scale, 1;
+                       clip_to, "clip";
+                       description {
+                               state, "default" 0.0;
+                               fixed, 1 1;
+                       }
+               }
+               part {
+                       name, PART_ACTION_MENU_TABLE_ITEM_ICON;
+                       type, SWALLOW;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               rel1 {
+                                       to, "pad.icon";
+                                       relative, 1.0 1.0;
+                               }
+                               rel2 {
+                                       to, "pad.icon";
+                                       relative, 1.0 1.0;
+                               }
+                               min, 60 60;
+                               align, 0.5 0.0;
+                               fixed, 1 1;
+                       }
+               }
+               part {
+                       name, PART_ACTION_MENU_TABLE_ITEM_ICON_FOCUS;
+                       type, SWALLOW;
+                       scale, 1;
+                       clip_to, "clip";
+                       description {
+                               state, "default" 0.0;
+                               rel1.to, PART_ACTION_MENU_TABLE_ITEM_ICON;
+                               rel2.to, PART_ACTION_MENU_TABLE_ITEM_ICON;
+                               fixed, 1 1;
+                       }
+               }
+               part {
+                       name, "pad.text";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               rel1 {
+                                       to, PART_ACTION_MENU_TABLE_ITEM_ICON;
+                                       relative, 0.5 1.0;
+                               }
+                               rel2 {
+                                       to, PART_ACTION_MENU_TABLE_ITEM_ICON;
+                                       relative, 0.5 1.0;
+                               }
+                               min, 0 6;
+                               fixed, 1 1;
+                               align, 0.5 0.0;
+                       }
+               }
+               part {
+                       name, PART_ACTION_MENU_TABLE_ITEM_TEXT;
+                       type, SWALLOW;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               rel1 {
+                                       to, "pad.text";
+                                       relative, 1.0 1.0;
+                               }
+                               rel2 {
+                                       to, "pad.text";
+                                       relative, 1.0 1.0;
+                               }
+                               min, 80 20;
+                               align, 0.5 0.0;
+                               fixed, 1 1;
+                       }
+               }
+               part {
+                       name, PART_ACTION_MENU_TABLE_ITEM_TEXT_FOCUS;
+                       type, SWALLOW;
+                       scale, 1;
+                       clip_to, "clip";
+                       description {
+                               state, "default" 0.0;
+                               rel1.to, PART_ACTION_MENU_TABLE_ITEM_TEXT;
+                               rel2.to, PART_ACTION_MENU_TABLE_ITEM_TEXT;
+                               fixed, 1 1;
+                       }
+               }
+       }
+       programs {
+               program {
+                       name, "sig,focus";
+                       signal, SIG_FOCUS;
+                       source, SRC_PROG;
+                       action, STATE_SET "focus" 0.0;
+                       transition, TRANSITION_DECEL;
+                       target, "clip";
+               }
+               program {
+                       name, "sig,unfocus";
+                       signal, SIG_UNFOCUS;
+                       source, SRC_PROG;
+                       action, STATE_SET "default" 0.0;
+                       transition, TRANSITION_DECEL;
+                       target, "clip";
+               }
+       }
+}
index f29473d..9d1d8d8 100644 (file)
@@ -31,6 +31,14 @@ styles {
                name, "recent_label_subtitle";
                base, "font=TizenSans font_size=20 color=#cdcdcd align=left";
        }
+       style {
+               name, "action_menu_title";
+               base, "font=TizenSans font_size=20 color=#686868 align=center";
+       }
+       style {
+               name, "action_menu_title_focus";
+               base, "font=TizenSans font_size=20 color=#ffffff align=center";
+       }
 }
 
 group {
@@ -311,3 +319,101 @@ group {
                }
        }
 }
+group {
+       name, "elm/label/base/slide_action_menu_title";
+       inherit, "elm/label/base/slide_home_title";
+       parts {
+               part {
+                       name, "elm.text";
+                       type, TEXTBLOCK;
+                       scale, 1;
+                       clip_to, "label.text.clip";
+                       description {
+                               state, "default" 0.0;
+                               rel1.relative, 0.0 0.0;
+                               rel2.relative, 1.0 1.0;
+                               align, 0.0 0.5;
+                               text {
+                                       style, "action_menu_title";
+                                       align, 0.0 1.0;
+                                       min, 0 1;
+                               }
+                       }
+                       description {
+                               state, "slide_end" 0.0;
+                               inherit, "default" 0.0;
+                               rel1.relative, 1.0 0.0;
+                               rel2.relative, 1.0 1.0;
+                               align, 1.0 0.5;
+                               text {
+                                       style, "action_menu_title";
+                                       align, 0.0 0.0;
+                                       min, 1 1;
+                                       ellipsis, -1.0;
+                               }
+                       }
+                       description {
+                               state, "slide_begin" 0.0;
+                               inherit, "default" 0.0;
+                               rel1.relative, 0.0 0.0;
+                               rel2.relative, 0.0 1.0;
+                               align, 0.0 0.5;
+                               text {
+                                       style, "action_menu_title";
+                                       align, 0.0 0.0;
+                                       min, 1 1;
+                                       ellipsis, -1.0;
+                               }
+                       }
+               }
+       }
+}
+group {
+       name, "elm/label/base/slide_action_menu_title_focus";
+       inherit, "elm/label/base/slide_home_title";
+       parts {
+               part {
+                       name, "elm.text";
+                       type, TEXTBLOCK;
+                       scale, 1;
+                       clip_to, "label.text.clip";
+                       description {
+                               state, "default" 0.0;
+                               rel1.relative, 0.0 0.0;
+                               rel2.relative, 1.0 1.0;
+                               align, 0.0 0.5;
+                               text {
+                                       style, "action_menu_title_focus";
+                                       align, 0.0 1.0;
+                                       min, 0 1;
+                               }
+                       }
+                       description {
+                               state, "slide_end" 0.0;
+                               inherit, "default" 0.0;
+                               rel1.relative, 1.0 0.0;
+                               rel2.relative, 1.0 1.0;
+                               align, 1.0 0.5;
+                               text {
+                                       style, "action_menu_title_focus";
+                                       align, 0.0 0.0;
+                                       min, 1 1;
+                                       ellipsis, -1.0;
+                               }
+                       }
+                       description {
+                               state, "slide_begin" 0.0;
+                               inherit, "default" 0.0;
+                               rel1.relative, 0.0 0.0;
+                               rel2.relative, 0.0 1.0;
+                               align, 0.0 0.5;
+                               text {
+                                       style, "action_menu_title_focus";
+                                       align, 0.0 0.0;
+                                       min, 1 1;
+                                       ellipsis, -1.0;
+                               }
+                       }
+               }
+       }
+}
diff --git a/images/btn_menu_reset_foc.png b/images/btn_menu_reset_foc.png
new file mode 100644 (file)
index 0000000..f53e996
Binary files /dev/null and b/images/btn_menu_reset_foc.png differ
diff --git a/images/btn_menu_reset_nor.png b/images/btn_menu_reset_nor.png
new file mode 100644 (file)
index 0000000..dd5804f
Binary files /dev/null and b/images/btn_menu_reset_nor.png differ
index 3d76b6c..5132e63 100644 (file)
@@ -22,6 +22,7 @@
 #define VIEW_USER "VIEW_USER"
 #define VIEW_USER_EDIT "VIEW_USER_EDIT"
 #define VIEW_PHOTO "VIEW_PHOTO"
+#define VIEW_ACTION_MENU "VIEW_ACTION_MENU"
 
 #define SRC_PROG "prog"
 #define SRC_EDJE "edje"
@@ -50,6 +51,9 @@
 #define GRP_PHOTO "group.photo"
 #define GRP_PHOTO_VIEWER "group.photo.viewer"
 #define GRP_PHOTO_NO_CONTENT "group.photo.no.content"
+#define GRP_ACTION_MENU "group.action.menu"
+#define GRP_ACTION_MENU_LIVETV "group.action.menu.livetv"
+#define GRP_ACTION_MENU_TABLE_ITEM "group.action.menu.table.item"
 
 #define PART_HOME_MENU_BAR "part.home.menu.bar"
 #define PART_HOME_UP_ARROW "part.home.up.arrow"
 #define PART_POPUP_BUTTON_2 "button2"
 #define PART_SWALLOW_ICON "elm.swallow.icon"
 #define PART_SWALLOW_CONTENT "elm.swallow.content"
+#define PART_ACTION_MENU_LIVETV "part.action.menu.livetv"
+#define PART_ACTION_MENU_TABLE "part.action.menu.table"
+#define PART_ACTION_MENU_TABLE_ITEM_BG "part.action.menu.table.bg"
+#define PART_ACTION_MENU_TABLE_ITEM_ICON "part.action.menu.table.item.icon"
+#define PART_ACTION_MENU_TABLE_ITEM_ICON_FOCUS "part.action.menu.table.item.icon.focus"
+#define PART_ACTION_MENU_TABLE_ITEM_TEXT "part.action.menu.table.item.text"
+#define PART_ACTION_MENU_TABLE_ITEM_TEXT_FOCUS "part.action.menu.table.item.text.focus"
 
 #define SIG_SHOW_NAVIGATION "sig.show.navigation"
 #define SIG_HIDE_NAVIGATION "sig.hide.navigation"
 #define STYLE_LABEL_RECENT_SUBTITLE "slide_recent_subtitle"
 #define STYLE_INPUT "input.field"
 #define STYLE_GENGRID_ITEM "gengrid_item"
+#define STYLE_LABEL_ACTION_MENU_TITLE "slide_action_menu_title"
+#define STYLE_LABEL_ACTION_MENU_TITLE_FOCUS "slide_action_menu_title_focus"
 
 #define COLOR_DEFAULT_R 0
 #define COLOR_DEFAULT_G 119
 #define IMAGE_RECENT_THUMB_APP IMAGEDIR"/ic_default_app.png"
 #define IMAGE_RECENT_THUMB_CHANNEL IMAGEDIR"/ic_default_tv.png"
 #define IMAGE_RECENT_THUMB_SETTING IMAGEDIR"/ic_default_setting"
+#define IMAGE_ACTION_MENU_ICON_RESET IMAGEDIR"/btn_menu_reset_nor.png"
+#define IMAGE_ACTION_MENU_ICON_RESET_FOCUS IMAGEDIR"/btn_menu_reset_foc.png"
 
 #define MAX_ITEM_COUNT 8
 #define MAX_USER_COUNT 9
index b4559a5..de827f5 100644 (file)
@@ -29,5 +29,6 @@ view_class *view_user_get_vclass(void);
 view_class *view_user_edit_get_vclass(void);
 view_class *view_photo_get_vclass(void);
 view_class *view_recent_get_vclass(void);
+view_class *view_action_menu_get_vclass(void);
 
 #endif /* __AIR_HOME_VIEW_H__ */
diff --git a/src/view/view_action_menu.c b/src/view/view_action_menu.c
new file mode 100644 (file)
index 0000000..b392b13
--- /dev/null
@@ -0,0 +1,274 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <Elementary.h>
+#include <app_debug.h>
+#include <viewmgr.h>
+#include <inputmgr.h>
+
+#include "defs.h"
+#include "view.h"
+#include "utils.h"
+
+#define ACTION_MENU_TITLE_RESET "Reset"
+
+enum input_handler_type {
+       INPUT_HANDLER_BTN,
+       INPUT_HANDLER_ITEM
+};
+
+struct _priv {
+       Evas_Object *win;
+       Evas_Object *base;
+       Evas_Object *btn;
+       Evas_Object *item;
+};
+
+static void _focused(int id, void *data, Evas_Object *obj,
+               Elm_Object_Item *item)
+{
+       elm_object_signal_emit(obj, SIG_FOCUS, SRC_PROG);
+}
+
+static void _unfocused(int id, void *data, Evas_Object *obj,
+               Elm_Object_Item *item)
+{
+       elm_object_signal_emit(obj, SIG_UNFOCUS, SRC_PROG);
+}
+
+static void _select(int id, void *data, Evas_Object *obj)
+{
+       /* It should be implemented later */
+
+       switch (id) {
+       case INPUT_HANDLER_BTN:
+               break;
+       case INPUT_HANDLER_ITEM:
+               break;
+       default:
+               return;
+       }
+}
+
+static void _key_down(int id, void *data, Evas *e, Evas_Object *obj,
+               Evas_Event_Key_Down *ev)
+{
+       if (!strcmp(ev->keyname, KEY_BACK) ||
+                       !strcmp(ev->keyname, KEY_BACK_REMOTE)) {
+               viewmgr_hide_view(VIEW_ACTION_MENU);
+       } else if (!strcmp(ev->keyname, KEY_ENTER) ||
+                       !strcmp(ev->keyname, KEY_ENTER_REMOTE)) {
+               _select(id, data, obj);
+       }
+}
+
+static void _mouse_down(int id, void *data, Evas *e, Evas_Object *obj,
+               Evas_Event_Mouse_Down *ev)
+{
+       _select(id, data, obj);
+}
+
+static void _mouse_move(int id, void *data, Evas *e, Evas_Object *obj,
+               Evas_Event_Mouse_Move *ev)
+{
+       if (!elm_object_focus_get(obj))
+               elm_object_focus_set(obj, EINA_TRUE);
+}
+
+static input_handler handler = {
+       .focused = _focused,
+       .unfocused = _unfocused,
+       .key_down = _key_down,
+       .mouse_down = _mouse_down,
+       .mouse_move = _mouse_move
+};
+
+static Evas_Object *_add_item(Evas_Object *box, struct _priv *priv)
+{
+       Evas_Object *item, *ic, *focus_ic, *lbl, *focus_lbl, *bg;
+
+       item = utils_add_layout(box, GRP_ACTION_MENU_TABLE_ITEM, true, NULL);
+       if (!item) {
+               _ERR("failed to add item");
+               evas_object_del(box);
+               return false;
+       }
+
+       ic = utils_add_icon(item, IMAGE_ACTION_MENU_ICON_RESET,
+                       PART_ACTION_MENU_TABLE_ITEM_ICON);
+       if (!ic)
+               goto err;
+
+       focus_ic = utils_add_icon(item, IMAGE_ACTION_MENU_ICON_RESET_FOCUS,
+                       PART_ACTION_MENU_TABLE_ITEM_ICON_FOCUS);
+       if (!focus_ic)
+               goto err;
+
+       lbl = utils_add_label(item, ACTION_MENU_TITLE_RESET,
+                       STYLE_LABEL_ACTION_MENU_TITLE,
+                       PART_ACTION_MENU_TABLE_ITEM_TEXT);
+       if (!lbl)
+               goto err;
+
+       focus_lbl = utils_add_label(item, ACTION_MENU_TITLE_RESET,
+                       STYLE_LABEL_ACTION_MENU_TITLE_FOCUS,
+                       PART_ACTION_MENU_TABLE_ITEM_TEXT_FOCUS);
+       if (!focus_lbl)
+               goto err;
+
+       bg = utils_add_bg(item, COLOR_DEFAULT_R, COLOR_DEFAULT_G,
+                       COLOR_DEFAULT_B, COLOR_DEFAULT_A,
+                       PART_ACTION_MENU_TABLE_ITEM_BG);
+       if (!bg)
+               goto err;
+
+       evas_object_show(item);
+       inputmgr_add_callback(item, INPUT_HANDLER_ITEM, &handler, priv);
+
+       return item;
+err:
+       evas_object_del(item);
+       return NULL;
+}
+
+static bool _add_menu(struct _priv *priv)
+{
+       Evas_Object *btn, *box, *item;
+
+       btn = utils_add_layout(priv->base, GRP_ACTION_MENU_LIVETV, true,
+                       PART_ACTION_MENU_LIVETV);
+       if (!btn) {
+               _ERR("failed to add btn");
+               return false;
+       }
+       inputmgr_add_callback(btn, INPUT_HANDLER_BTN, &handler, priv);
+       priv->btn = btn;
+
+       box = utils_add_box(priv->base, true);
+       if (!box) {
+               _ERR("failed to add box");
+               return false;
+       }
+       elm_object_part_content_set(priv->base, PART_ACTION_MENU_TABLE, box);
+       elm_box_align_set(box, 0.0, 0.5);
+
+       item = _add_item(box, priv);
+       if (!item) {
+               _ERR("failed to add item");
+               evas_object_del(box);
+               return false;
+       }
+
+       elm_box_pack_start(box, item);
+       priv->item = item;
+
+       return true;
+}
+
+static Evas_Object *_create(Evas_Object *win, void *data)
+{
+       struct _priv *priv;
+       Evas_Object *base;
+
+       priv = calloc(1, sizeof(*priv));
+       if (!priv) {
+               _ERR("failed to calloc priv");
+               return NULL;
+       }
+
+       base = utils_add_layout(win, GRP_ACTION_MENU, false, NULL);
+       if (!base) {
+               _ERR("failed to create base");
+               free(priv);
+               return NULL;
+       }
+       evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND,
+                       EVAS_HINT_EXPAND);
+       elm_win_resize_object_add(win, base);
+
+       priv->win = win;
+       priv->base = base;
+
+       if (!_add_menu(priv)) {
+               _ERR("failed to add menu");
+               free(priv);
+               evas_object_del(base);
+               return NULL;
+       }
+
+       viewmgr_set_view_data(VIEW_ACTION_MENU, priv);
+
+       return base;
+}
+
+static void _show(void *data)
+{
+       struct _priv *priv;
+
+       if (!data) {
+               _ERR("Invalid argument");
+               return;
+       }
+
+       priv = data;
+
+       evas_object_show(priv->base);
+
+       if (priv->btn)
+               elm_object_focus_set(priv->btn, EINA_TRUE);
+}
+
+static void _hide(void *data)
+{
+       struct _priv *priv;
+
+       if (!data) {
+               _ERR("Invalid argument");
+               return;
+       }
+
+       priv = data;
+
+       evas_object_hide(priv->base);
+}
+
+static void _destroy(void *data)
+{
+       struct _priv *priv;
+
+       if (!data) {
+               _ERR("Invalid argument");
+               return;
+       }
+
+       priv = data;
+
+       evas_object_del(priv->base);
+       free(priv);
+}
+
+static view_class vclass = {
+       .view_id = VIEW_ACTION_MENU,
+       .create = _create,
+       .show = _show,
+       .hide = _hide,
+       .destroy = _destroy,
+};
+
+view_class *view_action_menu_get_vclass(void)
+{
+       return &vclass;
+}
index d3c067c..a0f2d22 100644 (file)
@@ -456,6 +456,7 @@ static Evas_Object *_create(Evas_Object *win, void *data)
 
        viewmgr_set_view_data(VIEW_USER_EDIT, priv);
        viewmgr_add_view(view_photo_get_vclass(), NULL);
+       viewmgr_add_view(view_action_menu_get_vclass(), NULL);
 
        return base;
 }
@@ -639,6 +640,9 @@ static void _key_down(int id, void *data, Evas *e, Evas_Object *obj,
        } else if (!strcmp(ev->keyname, KEY_RIGHT)) {
                if (id == INPUT_HANDLER_TYPE_PHOTO && priv->del)
                        elm_object_focus_set(priv->del, EINA_TRUE);
+       } else if (!strcmp(ev->keyname, KEY_MENU) ||
+                       !strcmp(ev->keyname, KEY_MENU_REMOTE)) {
+               viewmgr_show_view(VIEW_ACTION_MENU);
        }
 }