Add status icon 44/44744/1 accepted/tizen/tv/20150728.070558 submit/tizen/20150728.063352
authorjinwoo.shin <jw0227.shin@samsung.com>
Mon, 27 Jul 2015 09:42:48 +0000 (18:42 +0900)
committerjinwoo.shin <jw0227.shin@samsung.com>
Mon, 27 Jul 2015 09:42:48 +0000 (18:42 +0900)
Change-Id: If34c36a43a57856a004ddfcb3432e9907e6911c2
Signed-off-by: jinwoo.shin <jw0227.shin@samsung.com>
data/view/channelinfo.edc
data/view/error.edc
include/define.h
src/view_channelinfo.c

index 3beca20..2c4b716 100644 (file)
@@ -219,6 +219,34 @@ group {
 
 group {
        name, GRP_CHANNELINFO;
+       images {
+               image, "ic_thumbnail_favorite_01.png" COMP;
+               image, "ic_thumbnail_lock_01_foc.png" COMP;
+               image, "ic_thumbnail_lock_01_nor.png" COMP;
+       }
+       script {
+               public is_locked=0, is_favorite=0, is_focused=0;
+
+               public set_states() {
+                       new focused;
+                       new locked;
+                       new favorite;
+
+                       focused = get_int(is_focused);
+                       locked = get_int(is_locked);
+                       favorite = get_int(is_favorite);
+
+                       if (locked == 1) {
+                               if (focused == 1)
+                                       run_program(PROGRAM:"do_focus_locked");
+                               else
+                                       run_program(PROGRAM:"do_locked");
+                       }
+
+                       if (favorite == 1)
+                               run_program(PROGRAM:"do_favorite");
+               }
+       }
        parts {
                part {
                        name, "bg";
@@ -405,7 +433,7 @@ group {
                }
                part {
                        name, PART_CHANNELINFO_STATUS;
-                       type, SWALLOW;
+                       type, SPACER;
                        scale, 1;
                        description {
                                state, "default" 0.0;
@@ -421,6 +449,115 @@ group {
                                align, 1.0 0.0;
                                fixed, 1 1;
                        }
+
+                       part {
+                               name, PART_CHANNELINFO_LOCKED;
+                               type, IMAGE;
+                               scale, 1;
+                               description {
+                                       state, "default" 0.0;
+                                       image.normal, "ic_thumbnail_lock_01_nor.png";
+                                       rel1.relative, 1.0 0.0;
+                                       rel2.relative, 1.0 0.0;
+                                       min, 0 0;
+                                       align, 1.0 0.0;
+                                       fixed, 1 1;
+                                       visible, 0;
+                               }
+                               description {
+                                       state, "visible" 0.0;
+                                       inherit, "default" 0.0;
+                                       min, 28 28;
+                                       visible, 1;
+                               }
+                               description {
+                                       state, "focused" 0.0;
+                                       inherit, "default" 0.0;
+                                       image.normal, "ic_thumbnail_lock_01_foc.png";
+                                       min, 28 28;
+                                       visible, 1;
+                               }
+                       }
+                       part {
+                               name, "padding.channelinfo.locked";
+                               type, SPACER;
+                               scale, 1;
+                               description {
+                                       state, "default" 0.0;
+                                       rel1 {
+                                               to, PART_CHANNELINFO_LOCKED;
+                                               relative, 0.0 0.0;
+                                       }
+                                       rel2 {
+                                               to, PART_CHANNELINFO_LOCKED;
+                                               relative, 0.0 0.0;
+                                       }
+                                       min, 0 0;
+                                       align, 1.0 0.0;
+                                       fixed, 1 1;
+                               }
+                               description {
+                                       state, "visible" 0.0;
+                                       inherit, "default" 0.0;
+                                       min, 10 0;
+                               }
+                               description {
+                                       state, "focused" 0.0;
+                                       inherit, "default" 0.0;
+                                       min, 10 0;
+                               }
+                       }
+                       part {
+                               name, PART_CHANNELINFO_FAVORITE;
+                               type, IMAGE;
+                               scale, 1;
+                               description {
+                                       state, "default" 0.0;
+                                       image.normal, "ic_thumbnail_favorite_01.png";
+                                       rel1 {
+                                               to, "padding.channelinfo.locked";
+                                               relative, 0.0 0.0;
+                                       }
+                                       rel2 {
+                                               to, "padding.channelinfo.locked";
+                                               relative, 0.0 0.0;
+                                       }
+                                       min, 0 0;
+                                       align, 1.0 0.0;
+                                       fixed, 1 1;
+                                       visible, 0;
+                               }
+                               description {
+                                       state, "visible" 0.0;
+                                       inherit, "default" 0.0;
+                                       min, 28 28;
+                                       visible, 1;
+                               }
+                       }
+                       part {
+                               name, "padding.channelinfo.favorite";
+                               type, SPACER;
+                               scale, 1;
+                               description {
+                                       state, "default" 0.0;
+                                       rel1 {
+                                               to, PART_CHANNELINFO_FAVORITE;
+                                               relative, 0.0 0.0;
+                                       }
+                                       rel2 {
+                                               to, PART_CHANNELINFO_FAVORITE;
+                                               relative, 0.0 0.0;
+                                       }
+                                       min, 0 0;
+                                       align, 1.0 0.0;
+                                       fixed, 1 1;
+                               }
+                               description {
+                                       state, "visible" 0.0;
+                                       inherit, "default" 0.0;
+                                       min, 10 0;
+                               }
+                       }
                }
        }
        programs {
@@ -428,6 +565,14 @@ group {
                        name, "focused";
                        signal, SIGNAL_FOCUSED;
                        source, SOURCE_ELM;
+                       script {
+                               set_int(is_focused, 1);
+                               set_states();
+                               run_program(PROGRAM:"do_focused");
+                       }
+               }
+               program {
+                       name, "do_focused";
                        action, STATE_SET "focused" 0.0;
                        target, "bg";
                        target, PART_CHANNELINFO_CHANNEL;
@@ -438,12 +583,74 @@ group {
                        name, "unfocused";
                        signal, SIGNAL_UNFOCUSED;
                        source, SOURCE_ELM;
+                       script {
+                               set_int(is_focused, 0);
+                               set_states();
+                               run_program(PROGRAM:"do_unfocused");
+                       }
+               }
+               program {
+                       name, "do_unfocused";
                        action, STATE_SET "default" 0.0;
                        target, "bg";
                        target, PART_CHANNELINFO_CHANNEL;
                        target, PART_CHANNELINFO_TITLE;
                        target, PART_CHANNELINFO_TIME;
                }
+               program {
+                       name, "reset";
+                       signal, SIGNAL_RESET;
+                       source, SOURCE_PROGRAM;
+                       script {
+                               set_int(is_locked, 0);
+                               set_int(is_favorite, 0);
+                               run_program(PROGRAM:"do_reset");
+                       }
+               }
+               program {
+                       name, "do_reset";
+                       action, STATE_SET "default" 0.0;
+                       target, PART_CHANNELINFO_FAVORITE;
+                       target, "padding.channelinfo.favorite";
+                       target, PART_CHANNELINFO_LOCKED;
+                       target, "padding.channelinfo.locked";
+               }
+               program {
+                       name, "set_locked";
+                       signal, SIGNAL_LOCKED;
+                       source, SOURCE_PROGRAM;
+                       script {
+                               set_int(is_locked, 1);
+                               set_states();
+                       }
+               }
+               program {
+                       name, "set_favorite";
+                       signal, SIGNAL_FAVORITE;
+                       source, SOURCE_PROGRAM;
+                       script {
+                               set_int(is_favorite, 1);
+                               set_states();
+                       }
+               }
+               program {
+                       name, "do_favorite";
+                       action, STATE_SET "visible" 0.0;
+                       target, PART_CHANNELINFO_FAVORITE;
+                       target, "padding.channelinfo.favorite";
+               }
+               program {
+                       name, "do_locked";
+                       action, STATE_SET "visible" 0.0;
+                       target, PART_CHANNELINFO_LOCKED;
+                       target, "padding.channelinfo.locked";
+               }
+               program {
+                       name, "do_focus_locked";
+                       action, STATE_SET "focused" 0.0;
+                       target, PART_CHANNELINFO_LOCKED;
+                       target, "padding.channelinfo.locked";
+               }
        }
 }
 
@@ -551,15 +758,6 @@ group {
                        }
                }
                part {
-                       name, PART_CHANNELINFO_STATUS;
-                       type, SWALLOW;
-                       scale, 1;
-                       description {
-                               state, "default" 0.0;
-                               visible, 0;
-                       }
-               }
-               part {
                        name, PART_CHANNELINFO_TIME;
                        type, TEXT;
                        scale, 1;
index 2d1b3e9..18d4bf6 100644 (file)
@@ -50,12 +50,12 @@ group {
                                        rel2.relative, 1.0 0.0;
                                        text {
                                                font, FONT_LIGHT;
-                                               size, 28;
+                                               size, 36;
                                                align, 0.5 0.5;
                                                min, 1 0;
                                                ellipsis, -1;
                                        }
-                                       color, 103 103 103 255;
+                                       color, 228 51 51 255;
                                        min, 0 36;
                                        align, 0.5 0.0;
                                        fixed, 1 1;
@@ -71,12 +71,12 @@ group {
                                        text {
                                                font, FONT_LIGHT;
                                                size, 28;
-                                               align, 0.5 0.5;
+                                               align, 0.5 1.0;
                                                min, 1 0;
                                                ellipsis, -1;
                                        }
                                        color, 116 116 116 255;
-                                       min, 0 36;
+                                       min, 0 48;
                                        align, 0.5 1.0;
                                        fixed, 1 1;
                                }
index aedb0e9..94c2c4b 100644 (file)
 
 #define SIGNAL_FOCUSED "elm,action,focus"
 #define SIGNAL_UNFOCUSED "elm,action,unfocus"
+#define SIGNAL_RESET "elm,action,reset"
 #define SIGNAL_FIRST "elm,state,first"
 #define SIGNAL_LAST "elm,state,last"
+#define SIGNAL_LOCKED "elm,state,locked"
+#define SIGNAL_FAVORITE "elm,state,favorite"
 
 #define FONT_REGULAR "TizenSans"
 #define FONT_LIGHT "TizenSans:style=Light"
 #define COLOR_OPTION_TEXT_FOCUSED 255 255 255 255
 #define COLOR_OPTION_BORDER 154 154 154 255
 
-#define IMG_LOCKED_NOR IMAGEDIR"ic_thumbnail_lock_01_nor.png"
-#define IMG_LOCKED_FOC IMAGEDIR"ic_thumbnail_lock_01_foc.png"
-#define IMG_FAVORITE_NOR IMAGEDIR"ic_thumbnail_favorite_01.png"
-#define IMG_FAVORITE_FOC IMG_FAVORITE_NOR
-
 #define VIEW_CHANNELINFO "VIEW_CHANNELINFO"
 #define LAYOUT_CHANNELINFO "LAYOUT_CHANNELINFO"
 #define LAYOUT_CHANNELINFO_LIST "LAYOUT_CHANNELINFO_LIST"
@@ -68,6 +66,8 @@
 #define PART_CHANNELINFO_TITLE "part.channelinfo.title"
 #define PART_CHANNELINFO_TIME "part.channelinfo.time"
 #define PART_CHANNELINFO_STATUS "part.channelinfo.status"
+#define PART_CHANNELINFO_LOCKED "part.channelinfo.locked"
+#define PART_CHANNELINFO_FAVORITE "part.channelinfo.favorite"
 
 #define VIEW_CHANNELNUMBER "VIEW_CHANNELNUMBER"
 #define GRP_VIEW_CHANNELNUMBER "grp.view.channelnumber"
index a9fb0cd..0bd6426 100644 (file)
@@ -159,45 +159,15 @@ static void _stop_hide_timer(struct _priv *priv)
        }
 }
 
-static void _add_icon(Evas_Object *box, const char *file)
-{
-       Evas_Object *ic;
-
-       ic = elm_icon_add(box);
-       if (!ic) {
-               _ERR("failed to create icon");
-               return;
-       }
-
-       elm_image_file_set(ic, file, NULL);
-       elm_image_resizable_set(ic, EINA_FALSE, EINA_FALSE);
-       elm_image_no_scale_set(ic, EINA_TRUE);
-       evas_object_show(ic);
-
-       elm_box_pack_end(box, ic);
-}
-
-static void _pack_icon_box(Evas_Object *obj,
+static void _set_icon_box(Evas_Object *obj,
                const struct tv_channel_info *channel_info)
 {
-       Evas_Object *box;
-
-       box = elm_box_add(obj);
-       if (!box) {
-               _ERR("failed to create box");
-               return;
-       }
-       evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND,
-                       EVAS_HINT_EXPAND);
-       elm_box_horizontal_set(box, EINA_TRUE);
-       elm_box_padding_set(box, STATUS_BOX_PADDING, 0);
-       elm_box_align_set(box, 1.0, 0.5);
-       elm_object_part_content_set(obj, PART_CHANNELINFO_STATUS, box);
+       elm_object_signal_emit(obj, SIGNAL_RESET, SOURCE_PROGRAM);
 
        if (channel_info->locked)
-               _add_icon(box, IMG_LOCKED_NOR);
+               elm_object_signal_emit(obj, SIGNAL_LOCKED, SOURCE_PROGRAM);
        if (channel_info->favorite)
-               _add_icon(box, IMG_FAVORITE_NOR);
+               elm_object_signal_emit(obj, SIGNAL_FAVORITE, SOURCE_PROGRAM);
 }
 
 static void _load_channel_text(Evas_Object *obj,
@@ -290,7 +260,7 @@ void draw_channel_info(Evas_Object *obj,
                        UPDATE_TYPE_TIMER, (void *)STOP_HIDE_TIMER);
 
        _load_channel_text(obj, channel_info);
-       _pack_icon_box(obj, channel_info);
+       _set_icon_box(obj, channel_info);
 
        prog_req = calloc(1, sizeof(*prog_req));
        prog_req->tv_program_cb = _tv_program_cb;