From: Taehyub Kim Date: Mon, 14 May 2018 06:52:18 +0000 (+0900) Subject: wearable/rotary_selector: apply edit mode dnd UX X-Git-Tag: submit/tizen/20190424.060632~38 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=73573741a998d43a0bb49e863eba71bb820cba2f;p=platform%2Fcore%2Fuifw%2Fefl-ext.git wearable/rotary_selector: apply edit mode dnd UX Change-Id: I044345240b521a5979d3e13e13da1c4eff11a3ce --- diff --git a/inc/wearable/efl_extension_common_private.h b/inc/wearable/efl_extension_common_private.h index 68b9c56..364756f 100644 --- a/inc/wearable/efl_extension_common_private.h +++ b/inc/wearable/efl_extension_common_private.h @@ -88,6 +88,13 @@ typedef enum EEXT_ROTARY_SELECTOR_DIRECTION_CCW } Eext_Rotary_Selector_Direction; +typedef enum +{ + EEXT_ROTARY_SELECTOR_NORMAL_ITEM = 0, + EEXT_ROTARY_SELECTOR_ADD_ITEM, + EEXT_ROTARY_SELECTOR_EMPTY_ITEM +} Eext_Rotary_Selector_Item_Type; + //for accessibility typedef enum { diff --git a/src/wearable/efl_extension_rotary_selector.c b/src/wearable/efl_extension_rotary_selector.c index d1c25b7..90cfc68 100644 --- a/src/wearable/efl_extension_rotary_selector.c +++ b/src/wearable/efl_extension_rotary_selector.c @@ -209,7 +209,7 @@ static void _layer_items_invalidate(Eext_Rotary_Selector_Data *rsd); static void _item_rearrange(Eext_Rotary_Selector_Data *rsd, int selected_index); static void _item_select(Eext_Rotary_Selector_Data *rsd, int index); static void _item_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info); -static Eext_Rotary_Selector_Item *_item_create(Eext_Rotary_Selector_Data *rsd, Eina_Bool is_add_item); +static Eext_Rotary_Selector_Item *_item_create(Eext_Rotary_Selector_Data *rsd, Eext_Rotary_Selector_Item_Type item_type); static void _item_selected_signal_send(Eext_Rotary_Selector_Data *rsd, int previous_item_index, int current_item_index); static void _item_touched_signal_send(Eext_Rotary_Selector_Data *rsd, int index, Eina_Bool pressed, Eina_Bool sound); @@ -712,7 +712,7 @@ _image_create_icon(void *data, Evas_Object *parent, Evas_Coord *xoff, Evas_Coord if (yoff) *yoff = rsd->item_height / 2; - tmp_item = _item_create(rsd, EINA_FALSE); + tmp_item = _item_create(rsd, EEXT_ROTARY_SELECTOR_EMPTY_ITEM); if (!tmp_item) return NULL; evas_object_show(tmp_item->base.obj); @@ -768,7 +768,7 @@ _image_create_icon(void *data, Evas_Object *parent, Evas_Coord *xoff, Evas_Coord ERR("Cannot get image file path. Item icon only supports elm image"); } elm_object_part_content_set(icon, "item,icon", clone_img); - + elm_object_signal_emit(icon, "elm,action,button,longpressed", ""); evas_object_hide(item->base.obj); _item_rearrange(rsd, rsd->selected_index); @@ -1814,7 +1814,7 @@ _add_item_create(Eext_Rotary_Selector_Data *rsd) { if (rsd->add_item) return; - Eext_Rotary_Selector_Item *add_item = _item_create(rsd, EINA_TRUE); + Eext_Rotary_Selector_Item *add_item = _item_create(rsd, EEXT_ROTARY_SELECTOR_ADD_ITEM); if (!add_item) return; @@ -2238,7 +2238,7 @@ _item_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) } static Eext_Rotary_Selector_Item * -_item_create(Eext_Rotary_Selector_Data *rsd, Eina_Bool is_add_item) +_item_create(Eext_Rotary_Selector_Data *rsd, Eext_Rotary_Selector_Item_Type item_type) { Eext_Rotary_Selector_Item *item = NULL; Evas_Object *button = NULL; @@ -2261,16 +2261,19 @@ _item_create(Eext_Rotary_Selector_Data *rsd, Eina_Bool is_add_item) evas_object_size_hint_weight_set(button,EVAS_HINT_EXPAND,EVAS_HINT_EXPAND); evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL); - if (!is_add_item) + if (item_type == EEXT_ROTARY_SELECTOR_NORMAL_ITEM) elm_object_style_set(button, "rotary_selector_item"); - else + else if (item_type == EEXT_ROTARY_SELECTOR_ADD_ITEM) elm_object_style_set(button, "rotary_selector_add_item"); + else + elm_object_style_set(button, "rotary_selector_empty_item"); + evas_object_move(button, -_ROTARY_SELECTOR_SCREEN_WIDTH, -_ROTARY_SELECTOR_SCREEN_HEIGHT); evas_object_resize(button, rsd->item_width, rsd->item_height); evas_object_smart_member_add(button, rotary_selector); _eext_rotary_selector_color_class_parent_set(button, rotary_selector); - if (!is_add_item) + if (item_type == EEXT_ROTARY_SELECTOR_NORMAL_ITEM) { Evas_Object *action_bg = elm_layout_add(button); elm_layout_theme_set(action_bg, "rotary_selector", "item", "bg_image"); @@ -3206,7 +3209,7 @@ eext_rotary_selector_item_append(Evas_Object *obj) return NULL; } - item = _item_create(rsd, EINA_FALSE); + item = _item_create(rsd, EEXT_ROTARY_SELECTOR_NORMAL_ITEM); if (!item) { ERR("item is NULL!!"); @@ -3278,7 +3281,7 @@ eext_rotary_selector_item_prepend(Evas_Object *obj) return NULL; } - item = _item_create(rsd, EINA_FALSE); + item = _item_create(rsd, EEXT_ROTARY_SELECTOR_NORMAL_ITEM); if (!item) { ERR("item is NULL!!"); @@ -3349,7 +3352,7 @@ eext_rotary_selector_item_insert_after(Evas_Object *obj, Eext_Object_Item *after return NULL; } - item = _item_create(rsd, EINA_FALSE); + item = _item_create(rsd, EEXT_ROTARY_SELECTOR_NORMAL_ITEM); if (!item) { ERR("item is NULL!!"); @@ -3437,7 +3440,7 @@ eext_rotary_selector_item_insert_before(Evas_Object *obj, Eext_Object_Item *befo return NULL; } - item = _item_create(rsd, EINA_FALSE); + item = _item_create(rsd, EEXT_ROTARY_SELECTOR_NORMAL_ITEM); if (!item) { ERR("item is NULL!!");