diff options
author | Lee jaeyoung <jy4710.lee@samsung.com> | 2013-02-15 13:57:32 +0900 |
---|---|---|
committer | Lee jaeyoung <jy4710.lee@samsung.com> | 2013-02-15 13:57:32 +0900 |
commit | b96f6afc338d7a5653e0558f9ef41f1e94fe9583 (patch) | |
tree | 2d86cdf312be52532f0f21f5742525c0f98a2838 | |
parent | 1802defc88b204b8676fba5a200367958d4d2d42 (diff) | |
download | message-app-b96f6afc338d7a5653e0558f9ef41f1e94fe9583.tar.gz message-app-b96f6afc338d7a5653e0558f9ef41f1e94fe9583.tar.bz2 message-app-b96f6afc338d7a5653e0558f9ef41f1e94fe9583.zip |
fix N_SE-25203: bubble position issue & date_line issue
Change-Id: I01e0468a16e3ec73b6f972a3dd4c7a1e57118af4
-rwxr-xr-x | composer/include/msg-ui-composer-bubble.h | 1 | ||||
-rwxr-xr-x | composer/src/bubble/msg-ui-composer-bubble-list.c | 49 |
2 files changed, 49 insertions, 1 deletions
diff --git a/composer/include/msg-ui-composer-bubble.h b/composer/include/msg-ui-composer-bubble.h index c2ed392..caf2cdb 100755 --- a/composer/include/msg-ui-composer-bubble.h +++ b/composer/include/msg-ui-composer-bubble.h @@ -195,6 +195,7 @@ typedef struct _MSG_BUBBLE_DATA { Eina_List *chk_list; Eina_List *added_list; Eina_List *media_list; + Eina_List *date_line_list; Eina_Bool sel_all_checked; diff --git a/composer/src/bubble/msg-ui-composer-bubble-list.c b/composer/src/bubble/msg-ui-composer-bubble-list.c index d526878..1eaafeb 100755 --- a/composer/src/bubble/msg-ui-composer-bubble-list.c +++ b/composer/src/bubble/msg-ui-composer-bubble-list.c @@ -1829,9 +1829,12 @@ Eina_Bool msg_ui_bubble_item_load_cb(void *data) elm_object_part_text_set(layout, "elm.text.date", item_data->displayDate); evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(layout,EVAS_HINT_FILL,EVAS_HINT_FILL); + + evas_object_data_set(layout, "bubble_info", item_data); evas_object_show(layout); elm_box_pack_start(bubble_data->box, layout); + bubble_data->date_line_list = eina_list_append(bubble_data->date_line_list, layout); } bubble_data->realized_list = eina_list_append(bubble_data->realized_list, item_data); @@ -2031,9 +2034,27 @@ Eina_Bool msg_ui_bubble_item_add_cb(void *data) elm_scroller_gravity_set(bubble_data->scrl, 0.0, 1.0); if (pack_info) { + PMSG_APP_CONV_DATA_S prev_data = NULL; + prev_data = (PMSG_APP_CONV_DATA_S) eina_list_nth(bubble_data->realized_list, 0); + + if((!prev_data || g_strcmp0(prev_data->displayDate, pack_info->add_item->displayDate) != 0)) { + Evas_Object * layout = NULL; + layout = elm_layout_add(bubble_data->box); + elm_layout_file_set(layout, MSGC_UI_DEFAULT_EDJ, "composer/content/bubble/date_line"); + elm_object_part_text_set(layout, "elm.text.date", pack_info->add_item->displayDate); + evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(layout,EVAS_HINT_FILL,EVAS_HINT_FILL); + + evas_object_data_set(layout, "bubble_info", pack_info->add_item); + evas_object_show(layout); + + elm_box_pack_end(bubble_data->box, layout); + bubble_data->date_line_list = eina_list_prepend(bubble_data->date_line_list, layout); + } + __add_bubble_item(bubble_data, pack_info->add_item, pack_info->pack_type, pack_info->rel_obj); - bubble_data->realized_list = eina_list_append(bubble_data->realized_list, pack_info->add_item); + bubble_data->realized_list = eina_list_prepend(bubble_data->realized_list, pack_info->add_item); bubble_data->added_list = eina_list_remove(bubble_data->added_list, pack_info); @@ -2112,6 +2133,7 @@ void msg_ui_bubble_list_item_move(PMSG_BUBBLE_DATA bubble_data, msg_struct_t msg MSG_UI_RET_IF(MSG_UI_LEVEL_DEBUG, !bubble_data); int msg_id = 0; + Evas_Object *date_line_layout = NULL; PMSG_APP_CONV_DATA_S prev_data = NULL; PMSG_APP_CONV_DATA_S insert_data = NULL; BUBBLE_PACK_INFO *add_pack_info = NULL; @@ -2133,9 +2155,34 @@ void msg_ui_bubble_list_item_move(PMSG_BUBBLE_DATA bubble_data, msg_struct_t msg if (prev_data) { if (prev_data->msgId == msg_id) { if (eina_list_data_find(bubble_data->realized_list, (const void *)prev_data)) { + EINA_LIST_FOREACH(bubble_data->date_line_list, l, date_line_layout) { + if (date_line_layout) { + PMSG_APP_CONV_DATA_S bubble_info = NULL; + PMSG_APP_CONV_DATA_S next_bubble = NULL; + bubble_info = (PMSG_APP_CONV_DATA_S)evas_object_data_get(date_line_layout, "bubble_info"); + + if (bubble_info && (bubble_info == prev_data)) { + Eina_List *temp_list = NULL; + temp_list = eina_list_data_find_list(bubble_data->realized_list, prev_data); + temp_list = eina_list_prev(temp_list); + next_bubble = (PMSG_APP_CONV_DATA_S)eina_list_nth(temp_list, 0); + + if (!next_bubble || (g_strcmp0(next_bubble->displayDate, bubble_info->displayDate) != 0)) { + bubble_data->date_line_list = eina_list_remove(bubble_data->date_line_list, date_line_layout); + elm_box_unpack(bubble_data->box, date_line_layout); + evas_object_del(date_line_layout); + } else { + evas_object_data_del(date_line_layout, "bubble_info"); + evas_object_data_set(date_line_layout, "bubble_info", next_bubble); + } + break; + } + } + } elm_box_unpack(bubble_data->box, prev_data->ly); evas_object_hide(prev_data->ly); evas_object_del(prev_data->ly); + elm_box_recalculate(bubble_data->box); bubble_data->realized_list = eina_list_remove(bubble_data->realized_list, (const void *)prev_data); } |