From: Jeong Seong-moon Date: Thu, 18 Aug 2016 08:35:36 +0000 (+0900) Subject: Add Gradation Background Color Feature X-Git-Tag: accepted/tizen/mobile/20160905.065953^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7d0b305782fec7c42a4686224829087c004c7f90;p=profile%2Fmobile%2Fapps%2Fnative%2Fquickpanel.git Add Gradation Background Color Feature Change-Id: I043f79f280fc17f55f00dd25f587f37e412fb726 --- diff --git a/inc/noti_listbox.h b/inc/noti_listbox.h index 608213f..eb31c7e 100755 --- a/inc/noti_listbox.h +++ b/inc/noti_listbox.h @@ -36,5 +36,5 @@ extern int quickpanel_noti_listbox_get_item_count(Evas_Object *listbox); extern void quickpanel_noti_listbox_items_visibility_set(Evas_Object *listbox, int is_visible); extern int quickpanel_noti_listbox_get_geometry(Evas_Object *listbox, int *limit_h, int *limit_partial_h, int *limit_partial_w); extern void quickpanel_noti_listbox_closing_trigger_set(Evas_Object *listbox); - +extern void quickpanel_noti_listbox_update_item_background_color(void); #endif diff --git a/res/edje/quickpanel_listitem_noti.edc b/res/edje/quickpanel_listitem_noti.edc index fa6cde5..0c581cd 100755 --- a/res/edje/quickpanel_listitem_noti.edc +++ b/res/edje/quickpanel_listitem_noti.edc @@ -67,7 +67,7 @@ state: "default" 0.0; rel1.to:"base"; rel2.to:"base"; - color_class: QP_THEME_BANDED_COLOR; + color: 61 185 204 11; visible: 1; } description { @@ -76,8 +76,24 @@ color_class: QP_THEME_BG_COLOR; color: 255 255 255 128; } - } + #define BGCOLOR_DESC(NAME, COLOR) \ + description {\ + state: NAME 0.0;\ + inherit: "default" 0.0;\ + color: COLOR;\ + } + BGCOLOR_DESC("bgcolor.step1", 61 185 204 11); + BGCOLOR_DESC("bgcolor.step2", 61 185 204 21); + BGCOLOR_DESC("bgcolor.step3", 61 185 204 31); + BGCOLOR_DESC("bgcolor.step4", 61 185 204 41); + BGCOLOR_DESC("bgcolor.step5", 61 185 204 51); + BGCOLOR_DESC("bgcolor.step6", 61 185 204 62); + BGCOLOR_DESC("bgcolor.step7", 61 185 204 72); + BGCOLOR_DESC("bgcolor.step8", 61 185 204 82); + BGCOLOR_DESC("bgcolor.step9", 61 185 204 92); + BGCOLOR_DESC("bgcolor.step10", 61 185 204 102); + } part { name: "elm.padding.right"; type: SPACER; @@ -705,6 +721,9 @@ } programs { + script{ + public current_background; + } program{ name: "listbox.touch.down"; signal: "mouse,clicked,1"; @@ -723,10 +742,36 @@ name: "effect,mouse,up"; signal: "mouse,up,1"; source: "object.layer.touch.background"; - action: STATE_SET "default" 0.0; + script { + new tmp[64]; + get_str(current_background, tmp, 64); + set_state(PART:"bgcolor", tmp, 0.0); + } transition: ACCELERATE 0.20; - target: "bgcolor"; } + +#define BGCOLOR_PROG(NAME, SIG) \ + program{\ + name: NAME;\ + signal: SIG;\ + source: "bgcolor";\ + transition: ACCELERATE 0.20;\ + script {\ + set_str(current_background, SIG);\ + set_state(PART:"bgcolor", SIG, 0.0);\ + }\ + } + + BGCOLOR_PROG("bgcolor.step1", "bgcolor.step1"); + BGCOLOR_PROG("bgcolor.step2", "bgcolor.step2"); + BGCOLOR_PROG("bgcolor.step3", "bgcolor.step3"); + BGCOLOR_PROG("bgcolor.step4", "bgcolor.step4"); + BGCOLOR_PROG("bgcolor.step5", "bgcolor.step5"); + BGCOLOR_PROG("bgcolor.step6", "bgcolor.step6"); + BGCOLOR_PROG("bgcolor.step7", "bgcolor.step7"); + BGCOLOR_PROG("bgcolor.step8", "bgcolor.step8"); + BGCOLOR_PROG("bgcolor.step9", "bgcolor.step9"); + program{ name: "title.long"; signal: "title.long"; diff --git a/res/edje/quickpanel_listitem_ongoing.edc b/res/edje/quickpanel_listitem_ongoing.edc index 0474b9e..e8b7b14 100755 --- a/res/edje/quickpanel_listitem_ongoing.edc +++ b/res/edje/quickpanel_listitem_ongoing.edc @@ -130,7 +130,7 @@ state: "default" 0.0; rel1.to:"base"; rel2.to:"base"; - color_class: QP_THEME_BANDED_COLOR; + color: 61 185 204 11; visible: 1; } description { @@ -140,6 +140,23 @@ color: 255 255 255 128; visible:1; } +#define BGCOLOR_DESC(NAME, COLOR) \ + description {\ + state: NAME 0.0;\ + inherit: "default" 0.0;\ + color: COLOR;\ + } + + BGCOLOR_DESC("bgcolor.step1", 61 185 204 11); + BGCOLOR_DESC("bgcolor.step2", 61 185 204 21); + BGCOLOR_DESC("bgcolor.step3", 61 185 204 31); + BGCOLOR_DESC("bgcolor.step4", 61 185 204 41); + BGCOLOR_DESC("bgcolor.step5", 61 185 204 51); + BGCOLOR_DESC("bgcolor.step6", 61 185 204 62); + BGCOLOR_DESC("bgcolor.step7", 61 185 204 72); + BGCOLOR_DESC("bgcolor.step8", 61 185 204 82); + BGCOLOR_DESC("bgcolor.step9", 61 185 204 92); + BGCOLOR_DESC("bgcolor.step10", 61 185 204 102); } part { @@ -689,6 +706,9 @@ } programs { + script{ + public current_background; + } program{ name: "effect,mouse,down"; signal: "mouse,down,1"; @@ -701,10 +721,35 @@ name: "effect,mouse,up"; signal: "mouse,up,1"; source: "object.layer.touch.background"; - action: STATE_SET "default" 0.0; + script { + new tmp[64]; + get_str(current_background, tmp, 64); + set_state(PART:"bgcolor", tmp, 0.0); + } transition: ACCELERATE 0.20; - target: "bgcolor"; } +#define BGCOLOR_PROG(NAME, SIG) \ + program{\ + name: NAME;\ + signal: SIG;\ + source: "bgcolor";\ + transition: ACCELERATE 0.20;\ + script {\ + set_str(current_background, SIG);\ + set_state(PART:"bgcolor", SIG, 0.0);\ + }\ + } + + BGCOLOR_PROG("bgcolor.step1", "bgcolor.step1"); + BGCOLOR_PROG("bgcolor.step2", "bgcolor.step2"); + BGCOLOR_PROG("bgcolor.step3", "bgcolor.step3"); + BGCOLOR_PROG("bgcolor.step4", "bgcolor.step4"); + BGCOLOR_PROG("bgcolor.step5", "bgcolor.step5"); + BGCOLOR_PROG("bgcolor.step6", "bgcolor.step6"); + BGCOLOR_PROG("bgcolor.step7", "bgcolor.step7"); + BGCOLOR_PROG("bgcolor.step8", "bgcolor.step8"); + BGCOLOR_PROG("bgcolor.step9", "bgcolor.step9"); + BGCOLOR_PROG("bgcolor.step10", "bgcolor.step10"); #ifdef TBD program{ name: "listbox.touch.down"; @@ -902,7 +947,6 @@ max: -1 QP_THEME_LIST_ITEM_ONGOING_EVENT_LINE3_HEIGHT; } } - part { name: "bgcolor"; type: "RECT"; @@ -911,7 +955,7 @@ state: "default" 0.0; rel1.to:"base"; rel2.to:"base"; - color_class: QP_THEME_BANDED_COLOR; + color: 61 185 204 11; visible: 1; } description { @@ -920,6 +964,23 @@ color_class: QP_THEME_BG_COLOR; color: 255 255 255 128; } +#define BGCOLOR_DESC(NAME, COLOR) \ + description {\ + state: NAME 0.0;\ + inherit: "default" 0.0;\ + color: COLOR;\ + } + + BGCOLOR_DESC("bgcolor.step1", 61 185 204 11); + BGCOLOR_DESC("bgcolor.step2", 61 185 204 21); + BGCOLOR_DESC("bgcolor.step3", 61 185 204 31); + BGCOLOR_DESC("bgcolor.step4", 61 185 204 41); + BGCOLOR_DESC("bgcolor.step5", 61 185 204 51); + BGCOLOR_DESC("bgcolor.step6", 61 185 204 62); + BGCOLOR_DESC("bgcolor.step7", 61 185 204 72); + BGCOLOR_DESC("bgcolor.step8", 61 185 204 82); + BGCOLOR_DESC("bgcolor.step9", 61 185 204 92); + BGCOLOR_DESC("bgcolor.step10", 61 185 204 102); } part { @@ -1355,6 +1416,9 @@ } programs { + script{ + public current_background; + } program{ name: "listbox.touch.down"; signal: "mouse,clicked,1"; @@ -1373,10 +1437,36 @@ name: "effect,mouse,up"; signal: "mouse,up,1"; source: "object.layer.touch.background"; - action: STATE_SET "default" 0.0; + script { + new tmp[64]; + get_str(current_background, tmp, 64); + set_state(PART:"bgcolor", tmp, 0.0); + } transition: ACCELERATE 0.20; - target: "bgcolor"; } +#define BGCOLOR_PROG(NAME, SIG) \ + program{\ + name: NAME;\ + signal: SIG;\ + source: "bgcolor";\ + transition: ACCELERATE 0.20;\ + script {\ + set_str(current_background, SIG);\ + set_state(PART:"bgcolor", SIG, 0.0);\ + }\ + } + + BGCOLOR_PROG("bgcolor.step1", "bgcolor.step1"); + BGCOLOR_PROG("bgcolor.step2", "bgcolor.step2"); + BGCOLOR_PROG("bgcolor.step3", "bgcolor.step3"); + BGCOLOR_PROG("bgcolor.step4", "bgcolor.step4"); + BGCOLOR_PROG("bgcolor.step5", "bgcolor.step5"); + BGCOLOR_PROG("bgcolor.step6", "bgcolor.step6"); + BGCOLOR_PROG("bgcolor.step7", "bgcolor.step7"); + BGCOLOR_PROG("bgcolor.step8", "bgcolor.step8"); + BGCOLOR_PROG("bgcolor.step9", "bgcolor.step9"); + BGCOLOR_PROG("bgcolor.step10", "bgcolor.step10"); + program{ name: "line1.set"; signal: "line1.set"; diff --git a/src/notifications/noti_listbox.c b/src/notifications/noti_listbox.c index 9c9fdee..3a13c4f 100755 --- a/src/notifications/noti_listbox.c +++ b/src/notifications/noti_listbox.c @@ -79,7 +79,6 @@ static int _listbox_layout_item_valid(Evas_Object *container, Evas_Object *item) return ret; } - static void _listbox_layout_get_coord(Evas_Object *container, int insert_position, int *coord_x, int *coord_y, Evas_Object *noti_section) { int x, y, h; @@ -349,6 +348,8 @@ static void _anim_done_delete_all(void *data) if (item_list != NULL) { eina_list_free(item_list); } + + quickpanel_noti_listbox_update_item_background_color(); } HAPI void quickpanel_noti_listbox_remove_all_item(Evas_Object *listbox, int with_animation) @@ -402,6 +403,40 @@ HAPI void quickpanel_noti_listbox_update_item(Evas_Object *listbox, Evas_Object } } +HAPI void quickpanel_noti_listbox_update_item_background_color(void) +{ + struct appdata *ad = quickpanel_get_app_data(); + int i = 0; + + DBG("quickpanel_noti_listbox_update_item_background_color"); + + retif(ad == NULL, , "invalid data."); + + Eina_List *l; + Eina_List *l_next; + Evas_Object *obj = NULL; + Eina_List *item_list = elm_box_children_get(ad->list); + + EINA_LIST_FOREACH_SAFE(item_list, l, l_next, obj) { + char signal[64] = {0, }; + if (i == 0) { //1st item is clear all section. It should not be changed. + i++; + continue; + } else if (i < 10) { + snprintf(signal, sizeof(signal), "%s%d", "bgcolor.step", i); + } else { + snprintf(signal, sizeof(signal), "%s", "bgcolor.step10"); + } + + elm_object_signal_emit(obj, signal, "bgcolor"); + i++; + } + + if (item_list != NULL) { + eina_list_free(item_list); + } +} + HAPI void quickpanel_noti_listbox_rotation(Evas_Object *listbox, int angle) { int h = 0; @@ -666,6 +701,8 @@ static void _anim_done_insert(void *data) elm_box_pack_after(container, item, before); } } + + quickpanel_noti_listbox_update_item_background_color(); } static void _anim_job_delete(void *data) @@ -773,6 +810,8 @@ static void _anim_done_delete(void *data) _listbox_layout_size_get(container, &w, &h); evas_object_resize(container, w, h); } + + quickpanel_noti_listbox_update_item_background_color(); } static Eina_Bool _anim_init_cb(void *data)