From acdcc0df92ff48133968820d4bc105f1178b1dfb Mon Sep 17 00:00:00 2001 From: "jin0.kim" Date: Sun, 18 Oct 2015 19:17:50 +0830 Subject: [PATCH 01/16] update setting screen Change-Id: Idf3e4e7db6d4d6320944bd49b1ee817a7a1304b5 --- TelegramTizen/src/tg_settings_view.c | 38 ++++++++++++++++++++---------------- TelegramTizen/tg_utils/tg_common.c | 38 ++++++++++++++++++++++++++++-------- TelegramTizen/tg_utils/tg_common.h | 3 +++ 3 files changed, 54 insertions(+), 25 deletions(-) diff --git a/TelegramTizen/src/tg_settings_view.c b/TelegramTizen/src/tg_settings_view.c index 11b5514..c0d050f 100644 --- a/TelegramTizen/src/tg_settings_view.c +++ b/TelegramTizen/src/tg_settings_view.c @@ -290,7 +290,7 @@ void on_image_request_option_selected_cb(void *data, Evas_Object *obj, void *eve return; } - if (id == 0) { + if (id == 1) { app_control_set_operation(app_control, APP_CONTROL_OPERATION_CREATE_CONTENT); app_control_set_mime(app_control, "image/jpg"); app_control_send_launch_request(app_control, &on_image_select_result_cb, ad); @@ -308,30 +308,35 @@ char* on_camera_load_text_get_cb(void *data, Evas_Object *obj, const char *part) { int id = (int) data; if (id == 0) { - return strdup("Camera"); + return strdup(_("IDS_TGRAM_OPT_FROM_GALLERY_ABB2")); } else { - return strdup("Gallery"); + return strdup(_("IDS_TGRAM_OPT_TAKE_PICTURE_ABB")); } } void on_camera_button_clicked(void *data, Evas_Object *obj, void *event_info) { Evas_Object* cam_icon = data; - appdata_s* ad = evas_object_data_get(data, "app_data"); + static Elm_Genlist_Item_Class itc; Evas_Object *popup; Evas_Object *box; Evas_Object *genlist; int i; + + appdata_s* ad = evas_object_data_get(obj, "app_data"); Evas_Object *win = ad->win; + Elm_Object_Item *it = event_info; + elm_genlist_item_selected_set(it, EINA_FALSE); + popup = elm_popup_add(win); elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0); eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, eext_popup_back_cb, NULL); elm_object_part_text_set(popup, "title,text", "Load image from"); evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_data_set(popup, "cam_icon", cam_icon); + //evas_object_data_set(popup, "cam_icon", cam_icon); evas_object_data_set(popup, "app_data", ad); /* box */ box = elm_box_add(popup); @@ -426,7 +431,7 @@ void on_chat_bg_change_option_selected_cb(void *data, Evas_Object *obj, void *ev show_toast(ad, "Error: Can not load image picker"); return; } - if (id == 0) { + /*if (id == 0) { if (ad->chat_background) { free(ad->chat_background); ad->chat_background = NULL; @@ -437,7 +442,7 @@ void on_chat_bg_change_option_selected_cb(void *data, Evas_Object *obj, void *ev if (chat_bg) { elm_image_file_set(chat_bg, ad->chat_background, NULL); } - }else if (id == 1) { + }else */if (id == 1) { app_control_set_operation(app_control, APP_CONTROL_OPERATION_CREATE_CONTENT); app_control_set_mime(app_control, "image/jpg"); app_control_send_launch_request(app_control, &on_chat_bg_select_result_cb, ad); @@ -457,15 +462,12 @@ char* on_chat_bg_load_text_get_cb(void *data, Evas_Object *obj, const char *part { int id = (int) data; if (id == 0) { - return strdup("Set default"); - } else if (id == 1) { - return strdup("Camera"); + return strdup(_("IDS_TGRAM_OPT_FROM_GALLERY_ABB2")); } else { - return strdup("Gallery"); + return strdup(_("IDS_TGRAM_OPT_TAKE_PICTURE_ABB")); } } - void on_settings_info_item_clicked(void *data, Evas_Object *obj, void *event_info) { Elm_Object_Item *it = event_info; @@ -486,16 +488,19 @@ void on_settings_info_item_clicked(void *data, Evas_Object *obj, void *event_inf elm_object_part_text_set(popup, "title,text", "Load image from"); evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_data_set(popup, "app_data", ad); /* box */ box = elm_box_add(popup); + elm_box_horizontal_set(box, EINA_FALSE); evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL); /* genlist */ genlist = elm_genlist_add(box); + elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS); evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_scroller_content_min_limit(genlist, EINA_TRUE, EINA_TRUE); itc.item_style = "default"; itc.func.text_get = on_chat_bg_load_text_get_cb; @@ -503,14 +508,12 @@ void on_settings_info_item_clicked(void *data, Evas_Object *obj, void *event_inf itc.func.state_get = NULL; itc.func.del = NULL; - for (i = 0; i < 3; i++) { + for (i = 0; i < 2; i++) { elm_genlist_item_append(genlist, &itc, (void *) i, NULL, ELM_GENLIST_ITEM_NONE, on_chat_bg_change_option_selected_cb, popup); } evas_object_show(genlist); elm_box_pack_end(box, genlist); - evas_object_size_hint_min_set(box, -1, 350); elm_object_content_set(popup, box); - evas_object_show(popup); } @@ -729,6 +732,7 @@ Evas_Object* _content_requested_cb(void *data, Evas_Object *obj, const char *par evas_object_size_hint_align_set(user_pic_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(user_pic_layout); elm_object_part_content_set(user_pic_layout, "content", profile_pic); + evas_object_data_set(ad->nf, "user_profile_pic", profile_pic); eo = elm_layout_add(obj); elm_layout_theme_set(eo, "layout", "list/B/type.1", "default"); @@ -767,7 +771,7 @@ void launch_settings_screen(appdata_s* ad) itc.func.state_get = NULL; itc.func.del = NULL; - elm_genlist_item_append(list, &itc, (void*) 0, NULL, ELM_GENLIST_ITEM_NONE, NULL, (void*) 0); + elm_genlist_item_append(list, &itc, (void*) 0, NULL, ELM_GENLIST_ITEM_NONE, on_camera_button_clicked, (void*) 0); elm_genlist_item_append(list, &itc, (void*) 1, NULL, ELM_GENLIST_ITEM_NONE, on_settings_info_item_clicked, (void*)1); Elm_Object_Item* navi_item = elm_naviframe_item_push(ad->nf, "Settings", NULL, NULL, list, NULL); diff --git a/TelegramTizen/tg_utils/tg_common.c b/TelegramTizen/tg_utils/tg_common.c index b892a85..2d7d493 100644 --- a/TelegramTizen/tg_utils/tg_common.c +++ b/TelegramTizen/tg_utils/tg_common.c @@ -429,6 +429,7 @@ void on_floating_icon_clicked(void *data, Evas_Object *obj, void *event_info) case TG_PEER_SEARCH_VIEW_STATE: elm_image_file_set(image, ui_utils_get_resource(TG_ICON_FLOATING_PENCIL), NULL); launch_settings_screen(ad); + delete_floating_button(ad); break; case TG_USER_MAIN_VIEW_STATE: elm_image_file_set(image, ui_utils_get_resource(TG_ICON_FLOATING_ADD), NULL); @@ -454,6 +455,7 @@ void create_floating_button(appdata_s* ad) { if (!ad) return; + if (ad->floating_btn) return; @@ -479,20 +481,40 @@ void delete_floating_button(appdata_s* ad) return; if (ad->floating_btn){ - evas_object_hide(ad->floating_btn); + elm_layout_signal_emit(ad->floating_btn, "elm,state,floatingbutton,hidden", "elm"); + } +} + +void show_floating_button(appdata_s* ad) +{ + if (!ad) + return; + + if (ad->floating_btn){ + elm_layout_signal_emit(ad->floating_btn, "elm,state,floatingbutton,visible", "elm"); } } void update_floating_button(appdata_s* ad, int mode) { - Evas_Object *plus_icon = elm_image_add(ad->nf); - elm_image_file_set(plus_icon, ui_utils_get_resource(TG_ICON_FLOATING_ADD), NULL); - evas_object_show(plus_icon); + // To do thi function + if (!ad->floating_btn) + return; - Evas_Object *new_msg_btn = elm_button_add(ad->floating_btn); - evas_object_smart_callback_add(new_msg_btn, "clicked", on_add_contact_clicked, ad); - elm_object_part_content_set(new_msg_btn, "icon", plus_icon); + Evas_Object* image = (Evas_Object*)evas_object_data_get(ad->floating_btn, "image"); + + switch(mode) { + case TG_PEER_SEARCH_VIEW_STATE: + elm_image_file_set(image, ui_utils_get_resource(TG_ICON_FLOATING_ADD), NULL); + break; + case TG_USER_MAIN_VIEW_STATE: + elm_image_file_set(image, ui_utils_get_resource(TG_ICON_FLOATING_ADD), NULL); + break; + default : + elm_image_file_set(image, ui_utils_get_resource(TG_ICON_FLOATING_PENCIL), NULL); + break; + } - elm_object_part_content_set(ad->floating_btn, "button1", new_msg_btn); + elm_layout_signal_emit(ad->floating_btn, "elm,state,floatingbutton,visible", "elm"); } diff --git a/TelegramTizen/tg_utils/tg_common.h b/TelegramTizen/tg_utils/tg_common.h index 72c7496..6f0f965 100644 --- a/TelegramTizen/tg_utils/tg_common.h +++ b/TelegramTizen/tg_utils/tg_common.h @@ -145,6 +145,7 @@ } \ } while (0) +#define _(str) gettext(str) #define SAFE_STRCMP(str1, str2) ((str1 && str2) ? strcmp(str1, str2) : -1) #define SAFE_STRDUP(text) (text == NULL ? NULL : strdup(text)) //what to use for strcpy? #define SAFE_STRLEN(src) \ @@ -1091,6 +1092,8 @@ extern void create_floating_button(appdata_s* ad); extern void delete_floating_button(appdata_s* ad); +extern void show_floating_button(appdata_s* ad); + extern void update_floating_button(appdata_s* ad, int mode); extern void on_new_message_clicked(void *data, Evas_Object *obj, void *event_info); -- 2.7.4 From c29154c7380ec1162b9d247d6a8e43c57f5f4296 Mon Sep 17 00:00:00 2001 From: "moon87.park" Date: Mon, 19 Oct 2015 10:28:05 +0900 Subject: [PATCH 02/16] [Telegram] Create ctxpopup in main view Change-Id: Ib09f6f475fb46bae5715d8a4e12a6db500b9f1d5 --- TelegramTizen/src/telegramtizen.c | 6 ++- TelegramTizen/src/tg_messaging_view.c | 5 ++- TelegramTizen/src/tg_user_main_view.c | 82 ++++++++++++++++++++++++++++++++++- TelegramTizen/tg_utils/tg_common.h | 1 + 4 files changed, 88 insertions(+), 6 deletions(-) diff --git a/TelegramTizen/src/telegramtizen.c b/TelegramTizen/src/telegramtizen.c index 6dceaa0..d9e0632 100644 --- a/TelegramTizen/src/telegramtizen.c +++ b/TelegramTizen/src/telegramtizen.c @@ -2509,8 +2509,10 @@ void app_nf_back_cb(void *data, Evas_Object *obj, void *event_info) elm_exit(); break; case TG_USER_MAIN_VIEW_STATE: - elm_win_lower(ad->win); - elm_exit(); + if (!ad->menu_popup) { + elm_win_lower(ad->win); + elm_exit(); + } break; case TG_CHAT_MESSAGING_VIEW_STATE: // to be handled diff --git a/TelegramTizen/src/tg_messaging_view.c b/TelegramTizen/src/tg_messaging_view.c index 76bd776..e6cf0d4 100644 --- a/TelegramTizen/src/tg_messaging_view.c +++ b/TelegramTizen/src/tg_messaging_view.c @@ -10,6 +10,7 @@ #include "server_requests.h" #include #include +#include #include "tg_user_info_view.h" #include "tg_chat_info_view.h" @@ -880,7 +881,7 @@ Evas_Object *on_message_item_content_get_cb(void *data, Evas_Object *obj, const //elm_entry_magnifier_disabled_set(entry, EINA_TRUE); // FIXME: Deprecated API - elm_entry_selection_handler_disabled_set(entry, EINA_TRUE); + //elm_entry_selection_handler_disabled_set(entry, EINA_TRUE); //elm_object_theme_set(layout, ad->theme); @@ -2566,7 +2567,7 @@ void launch_messaging_view_cb(appdata_s* ad, int user_id) evas_object_size_hint_weight_set(chat_conv_list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(chat_conv_list, EVAS_HINT_FILL, EVAS_HINT_FILL); // FIXME: Deprecated API - elm_genlist_realization_mode_set(chat_conv_list, EINA_TRUE); + //elm_genlist_realization_mode_set(chat_conv_list, EINA_TRUE); //evas_object_color_set(chat_conv_list, 255 , 255, 255, 255); evas_object_show(chat_conv_list); diff --git a/TelegramTizen/src/tg_user_main_view.c b/TelegramTizen/src/tg_user_main_view.c index 401d204..950d150 100644 --- a/TelegramTizen/src/tg_user_main_view.c +++ b/TelegramTizen/src/tg_user_main_view.c @@ -1031,6 +1031,82 @@ static void on_search_icon_unpressed(void *data, Evas_Object *obj, void *event_i elm_image_file_set(data, ui_utils_get_resource(TG_SEARCH_ICON), NULL); } +static void _more_popup_rotate(void *data, Evas_Object *obj, void *event_info) +{ + int pos; + Evas_Coord w, h; + appdata_s *ad = data; + + elm_win_screen_size_get(ad->win, NULL, NULL, &w, &h); + pos = elm_win_rotation_get(ad->win); + + switch (pos) { + case 90: + evas_object_move(ad->menu_popup, 0, w); + break; + case 270: + evas_object_move(ad->menu_popup, h, w); + break; + case 180: + default: + evas_object_move(ad->menu_popup, 0, h); + break; + } +} + +static void _ctxpopup_back_cb(void *data, Evas_Object *obj, void *event_info) +{ + appdata_s *ad = data; + + if (!ad->menu_popup || !ad->win) { + return; + } + evas_object_smart_callback_del(ad->win, "rotation,changed", _more_popup_rotate); + evas_object_smart_callback_del(ad->menu_popup, "dismissed", _ctxpopup_back_cb); + evas_object_del(ad->menu_popup); + ad->menu_popup = NULL; + +} + + +static void _create_more_popup(void *data, Evas_Object *obj, void *event_info) +{ + Elm_Object_Item *it; + Evas_Object *ctxpopup; + appdata_s *ad = data; + + if (ad->current_app_state != TG_USER_MAIN_VIEW_STATE) { + return; + } + + ctxpopup = elm_ctxpopup_add(ad->nf); + elm_object_style_set(ctxpopup, "more/default"); + elm_ctxpopup_auto_hide_disabled_set(ctxpopup, EINA_TRUE); + eext_object_event_callback_add(ctxpopup, EEXT_CALLBACK_BACK, eext_ctxpopup_back_cb, NULL); + eext_object_event_callback_add(ctxpopup, EEXT_CALLBACK_MORE, eext_ctxpopup_back_cb, NULL); + + evas_object_smart_callback_add(ctxpopup, "dismissed", _ctxpopup_back_cb, ad); + evas_object_smart_callback_add(ad->win, "rotation,changed", _more_popup_rotate, ad); + + it = elm_ctxpopup_item_append(ctxpopup, i18n_get_text("IDS_TGRAM_OPT_DELETE"), NULL, NULL, ad); + it = elm_ctxpopup_item_append(ctxpopup, i18n_get_text("IDS_TGRAM_OPT_SEARCH"), NULL, NULL, ad); + it = elm_ctxpopup_item_append(ctxpopup, i18n_get_text("IDS_TGRAM_OPT_CONTACTS"), NULL, NULL, ad); + it = elm_ctxpopup_item_append(ctxpopup, i18n_get_text("IDS_TGRAM_OPT_SETTINGS"), NULL, NULL, ad); + //elm_object_item_domain_text_translatable_set(it, SETTING_PACKAGE, EINA_TRUE); + elm_ctxpopup_direction_priority_set(ctxpopup, ELM_CTXPOPUP_DIRECTION_UP, ELM_CTXPOPUP_DIRECTION_UNKNOWN, ELM_CTXPOPUP_DIRECTION_UNKNOWN, ELM_CTXPOPUP_DIRECTION_UNKNOWN); + + if (ad->menu_popup) { + evas_object_del(ad->menu_popup); + } + + ad->menu_popup = ctxpopup; + + _more_popup_rotate(ad, NULL, NULL); + + evas_object_show(ctxpopup); + +} + void launch_user_main_view_cb(appdata_s* ad) { if (!ad) @@ -1150,7 +1226,7 @@ void launch_user_main_view_cb(appdata_s* ad) evas_object_smart_callback_add(search_btn, "unpressed", on_search_icon_unpressed, search_icon); #endif - elm_naviframe_item_push(ad->nf, "Telegram", NULL, NULL, scroller, NULL); + Elm_Object_Item *it = elm_naviframe_item_push(ad->nf, i18n_get_text("IDS_TGRAM_HEADER_TELEGRAM"), NULL, NULL, scroller, NULL); #if 0 Elm_Object_Item* navi_item = elm_naviframe_item_push(ad->nf, "Telegram", NULL, NULL, scroller, NULL); @@ -1161,7 +1237,9 @@ void launch_user_main_view_cb(appdata_s* ad) elm_object_item_part_content_set(navi_item, "title_left_btn", panel_btn); #endif - eext_object_event_callback_add(ad->nf, EEXT_CALLBACK_MORE, on_side_panel_requested, ad); +// eext_object_event_callback_add(ad->nf, EEXT_CALLBACK_MORE, on_messaging_menu_button_clicked, ad); + + eext_object_event_callback_add(ad->nf, EEXT_CALLBACK_MORE, _create_more_popup, ad); } diff --git a/TelegramTizen/tg_utils/tg_common.h b/TelegramTizen/tg_utils/tg_common.h index 6f0f965..0aedfd9 100644 --- a/TelegramTizen/tg_utils/tg_common.h +++ b/TelegramTizen/tg_utils/tg_common.h @@ -556,6 +556,7 @@ typedef struct appdata { Evas_Object *floating_btn; Elm_Theme *theme; int screen_mode_for_fb; // for floating button icon + Evas_Object *menu_popup; } appdata_s; extern void show_toast(appdata_s* ad, char* value); -- 2.7.4 From 927fbfbfc770911964944a06373cf526223ab5a5 Mon Sep 17 00:00:00 2001 From: "moon87.park" Date: Mon, 19 Oct 2015 11:40:18 +0900 Subject: [PATCH 03/16] [Telegram] Link the setting view with menu popup Change-Id: I4c368ef08aad3c0c3b515b1716cf57629a95ff8b --- TelegramTizen/src/tg_user_main_view.c | 50 ++++++++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 9 deletions(-) diff --git a/TelegramTizen/src/tg_user_main_view.c b/TelegramTizen/src/tg_user_main_view.c index 950d150..5111254 100644 --- a/TelegramTizen/src/tg_user_main_view.c +++ b/TelegramTizen/src/tg_user_main_view.c @@ -1054,20 +1054,46 @@ static void _more_popup_rotate(void *data, Evas_Object *obj, void *event_info) } } -static void _ctxpopup_back_cb(void *data, Evas_Object *obj, void *event_info) +static void _ctxpopup_dismiss_cb(void *data, Evas_Object *obj, void *event_info) +{ + appdata_s *ad = data; + evas_object_del(ad->menu_popup); + ad->menu_popup = NULL; +} + +static void _ctxpopup_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) { appdata_s *ad = data; - if (!ad->menu_popup || !ad->win) { + if (!ad) { + LOGE("ad is NULL"); + return; + } + + if (!ad->win) { + LOGE("window is NULL"); return; } evas_object_smart_callback_del(ad->win, "rotation,changed", _more_popup_rotate); - evas_object_smart_callback_del(ad->menu_popup, "dismissed", _ctxpopup_back_cb); - evas_object_del(ad->menu_popup); - ad->menu_popup = NULL; - + if (ad->menu_popup) { + evas_object_smart_callback_del(ad->menu_popup, "dismissed", _ctxpopup_dismiss_cb); + evas_object_del(ad->menu_popup); + ad->menu_popup = NULL; + } } +static void ctxpopup_settings_select_cb(void *data, Evas_Object *obj, void *event_info) +{ + appdata_s *ad = data; + if (!ad) { + LOGE("ad is NULL"); + return; + } + + _ctxpopup_dismiss_cb(ad, NULL, NULL); + + launch_settings_screen(ad); +} static void _create_more_popup(void *data, Evas_Object *obj, void *event_info) { @@ -1075,6 +1101,11 @@ static void _create_more_popup(void *data, Evas_Object *obj, void *event_info) Evas_Object *ctxpopup; appdata_s *ad = data; + if (!ad) { + LOGE("ad is NULL"); + return; + } + if (ad->current_app_state != TG_USER_MAIN_VIEW_STATE) { return; } @@ -1084,14 +1115,15 @@ static void _create_more_popup(void *data, Evas_Object *obj, void *event_info) elm_ctxpopup_auto_hide_disabled_set(ctxpopup, EINA_TRUE); eext_object_event_callback_add(ctxpopup, EEXT_CALLBACK_BACK, eext_ctxpopup_back_cb, NULL); eext_object_event_callback_add(ctxpopup, EEXT_CALLBACK_MORE, eext_ctxpopup_back_cb, NULL); + evas_object_event_callback_add(ctxpopup, EVAS_CALLBACK_DEL, _ctxpopup_del_cb, ad); - evas_object_smart_callback_add(ctxpopup, "dismissed", _ctxpopup_back_cb, ad); + evas_object_smart_callback_add(ctxpopup, "dismissed", _ctxpopup_dismiss_cb, ad); evas_object_smart_callback_add(ad->win, "rotation,changed", _more_popup_rotate, ad); it = elm_ctxpopup_item_append(ctxpopup, i18n_get_text("IDS_TGRAM_OPT_DELETE"), NULL, NULL, ad); it = elm_ctxpopup_item_append(ctxpopup, i18n_get_text("IDS_TGRAM_OPT_SEARCH"), NULL, NULL, ad); it = elm_ctxpopup_item_append(ctxpopup, i18n_get_text("IDS_TGRAM_OPT_CONTACTS"), NULL, NULL, ad); - it = elm_ctxpopup_item_append(ctxpopup, i18n_get_text("IDS_TGRAM_OPT_SETTINGS"), NULL, NULL, ad); + it = elm_ctxpopup_item_append(ctxpopup, i18n_get_text("IDS_TGRAM_OPT_SETTINGS"), NULL, ctxpopup_settings_select_cb, ad); //elm_object_item_domain_text_translatable_set(it, SETTING_PACKAGE, EINA_TRUE); elm_ctxpopup_direction_priority_set(ctxpopup, ELM_CTXPOPUP_DIRECTION_UP, ELM_CTXPOPUP_DIRECTION_UNKNOWN, ELM_CTXPOPUP_DIRECTION_UNKNOWN, ELM_CTXPOPUP_DIRECTION_UNKNOWN); @@ -1226,7 +1258,7 @@ void launch_user_main_view_cb(appdata_s* ad) evas_object_smart_callback_add(search_btn, "unpressed", on_search_icon_unpressed, search_icon); #endif - Elm_Object_Item *it = elm_naviframe_item_push(ad->nf, i18n_get_text("IDS_TGRAM_HEADER_TELEGRAM"), NULL, NULL, scroller, NULL); + elm_naviframe_item_push(ad->nf, i18n_get_text("IDS_TGRAM_HEADER_TELEGRAM"), NULL, NULL, scroller, NULL); #if 0 Elm_Object_Item* navi_item = elm_naviframe_item_push(ad->nf, "Telegram", NULL, NULL, scroller, NULL); -- 2.7.4 From 7b6673b1042e6ea8aa1ae81f7555bd787382908c Mon Sep 17 00:00:00 2001 From: "moon87.park" Date: Mon, 19 Oct 2015 12:16:34 +0900 Subject: [PATCH 04/16] [Telegram] Create the ctxpopup and Add the STMS in setting view Change-Id: I793016833161cd39ace0f4f0ba0b1b1efa8f9e8b --- TelegramTizen/src/tg_settings_view.c | 157 ++++++++++++++++++++++++++++++++-- TelegramTizen/src/tg_user_main_view.c | 49 +++++++++-- 2 files changed, 195 insertions(+), 11 deletions(-) diff --git a/TelegramTizen/src/tg_settings_view.c b/TelegramTizen/src/tg_settings_view.c index c0d050f..55207a5 100644 --- a/TelegramTizen/src/tg_settings_view.c +++ b/TelegramTizen/src/tg_settings_view.c @@ -333,7 +333,7 @@ void on_camera_button_clicked(void *data, Evas_Object *obj, void *event_info) popup = elm_popup_add(win); elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0); eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, eext_popup_back_cb, NULL); - elm_object_part_text_set(popup, "title,text", "Load image from"); + elm_object_part_text_set(popup, "title,text", i18n_get_text("IDS_TGRAM_HEADER_SELECT_IMAGE_ABB2")); evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); //evas_object_data_set(popup, "cam_icon", cam_icon); @@ -485,7 +485,7 @@ void on_settings_info_item_clicked(void *data, Evas_Object *obj, void *event_inf popup = elm_popup_add(win); elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0); eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, eext_popup_back_cb, NULL); - elm_object_part_text_set(popup, "title,text", "Load image from"); + elm_object_part_text_set(popup, "title,text", i18n_get_text("IDS_TGRAM_HEADER_SELECT_IMAGE_ABB2")); evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_data_set(popup, "app_data", ad); @@ -686,7 +686,7 @@ char* _text_requested_cb(void *data, Evas_Object *obj, const char *part) case 0: return strdup(ad->current_user_data->print_name); case 1: - return strdup("Set Background image"); + return strdup(i18n_get_text("IDS_TGRAM_OPT_SET_BACKGROUND_IMAGE_ABB")); default: break; } @@ -696,7 +696,7 @@ char* _text_requested_cb(void *data, Evas_Object *obj, const char *part) switch(id) { case 0: if (ad->current_user_data->online) { - return strdup("online"); + return strdup(i18n_get_text("IDS_TGRAM_SBODY_ONLINE")); } else { return strdup("offine"); } @@ -743,6 +743,151 @@ Evas_Object* _content_requested_cb(void *data, Evas_Object *obj, const char *par return eo; } +static void _more_popup_rotate(void *data, Evas_Object *obj, void *event_info) +{ + int pos; + Evas_Coord w, h; + appdata_s *ad = data; + + elm_win_screen_size_get(ad->win, NULL, NULL, &w, &h); + pos = elm_win_rotation_get(ad->win); + + switch (pos) { + case 90: + case 270: + evas_object_move(ad->menu_popup, 0, w); + break; + case 180: + default: + evas_object_move(ad->menu_popup, 0, h); + break; + } +} + +static void _ctxpopup_dismiss_cb(void *data, Evas_Object *obj, void *event_info) +{ + appdata_s *ad = data; + evas_object_del(ad->menu_popup); + ad->menu_popup = NULL; +} + +static void _ctxpopup_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + appdata_s *ad = data; + + if (!ad) { + LOGE("ad is NULL"); + return; + } + + if (!ad->win) { + LOGE("window is NULL"); + return; + } + evas_object_smart_callback_del(ad->win, "rotation,changed", _more_popup_rotate); + if (ad->menu_popup) { + evas_object_smart_callback_del(ad->menu_popup, "dismissed", _ctxpopup_dismiss_cb); + evas_object_del(ad->menu_popup); + ad->menu_popup = NULL; + } +} + +static void ctxpopup_profile_select_cb(void *data, Evas_Object *obj, void *event_info) +{ + appdata_s *ad = data; + if (!ad) { + LOGE("ad is NULL"); + return; + } + + _ctxpopup_dismiss_cb(ad, NULL, NULL); + + /* please input here when set profile picture menu is clicked */ +} + +static void ctxpopup_edit_name_select_cb(void *data, Evas_Object *obj, void *event_info) +{ + appdata_s *ad = data; + if (!ad) { + LOGE("ad is NULL"); + return; + } + + _ctxpopup_dismiss_cb(ad, NULL, NULL); + + /* please input here when edit name menu is clicked */ +} + +static void ctxpopup_logout_select_cb(void *data, Evas_Object *obj, void *event_info) +{ + appdata_s *ad = data; + if (!ad) { + LOGE("ad is NULL"); + return; + } + + _ctxpopup_dismiss_cb(ad, NULL, NULL); + + /* please input here when logout menu is clicked */ +} + +static void _create_more_popup(void *data, Evas_Object *obj, void *event_info) +{ + Elm_Object_Item *it; + Evas_Object *ctxpopup; + appdata_s *ad = data; + + if (!ad) { + LOGE("ad is NULL"); + return; + } + + if (ad->current_app_state != TG_SETTINGS_SCREEN_STATE) { + return; + } + + ctxpopup = elm_ctxpopup_add(ad->nf); + elm_object_style_set(ctxpopup, "more/default"); + elm_ctxpopup_auto_hide_disabled_set(ctxpopup, EINA_TRUE); + eext_object_event_callback_add(ctxpopup, EEXT_CALLBACK_BACK, eext_ctxpopup_back_cb, NULL); + eext_object_event_callback_add(ctxpopup, EEXT_CALLBACK_MORE, eext_ctxpopup_back_cb, NULL); + evas_object_event_callback_add(ctxpopup, EVAS_CALLBACK_DEL, _ctxpopup_del_cb, ad); + + evas_object_smart_callback_add(ctxpopup, "dismissed", _ctxpopup_dismiss_cb, ad); + evas_object_smart_callback_add(ad->win, "rotation,changed", _more_popup_rotate, ad); + + it = elm_ctxpopup_item_append(ctxpopup, i18n_get_text("IDS_TGRAM_OPT_SET_PROFILE_PICTURE_ABB"), NULL, ctxpopup_profile_select_cb, ad); + it = elm_ctxpopup_item_append(ctxpopup, i18n_get_text("IDS_TGRAM_OPT_EDIT_NAME"), NULL, ctxpopup_edit_name_select_cb, ad); + it = elm_ctxpopup_item_append(ctxpopup, i18n_get_text("IDS_TGRAM_OPT_LOG_OUT"), NULL, ctxpopup_logout_select_cb, ad); + //elm_object_item_domain_text_translatable_set(it, SETTING_PACKAGE, EINA_TRUE); + elm_ctxpopup_direction_priority_set(ctxpopup, ELM_CTXPOPUP_DIRECTION_UP, ELM_CTXPOPUP_DIRECTION_UNKNOWN, ELM_CTXPOPUP_DIRECTION_UNKNOWN, ELM_CTXPOPUP_DIRECTION_UNKNOWN); + + if (ad->menu_popup) { + evas_object_del(ad->menu_popup); + } + + ad->menu_popup = ctxpopup; + + _more_popup_rotate(ad, NULL, NULL); + + evas_object_show(ctxpopup); + +} + +static Eina_Bool _pop_cb(void *data, Elm_Object_Item *it) +{ + appdata_s* ad = data; + + if (!ad) { + LOGE("ad is NULL"); + return EINA_FALSE; + } + + eext_object_event_callback_del(ad->nf, EEXT_CALLBACK_MORE, _create_more_popup); + + return EINA_TRUE; +} + void launch_settings_screen(appdata_s* ad) { if (!ad) { @@ -774,7 +919,9 @@ void launch_settings_screen(appdata_s* ad) elm_genlist_item_append(list, &itc, (void*) 0, NULL, ELM_GENLIST_ITEM_NONE, on_camera_button_clicked, (void*) 0); elm_genlist_item_append(list, &itc, (void*) 1, NULL, ELM_GENLIST_ITEM_NONE, on_settings_info_item_clicked, (void*)1); - Elm_Object_Item* navi_item = elm_naviframe_item_push(ad->nf, "Settings", NULL, NULL, list, NULL); + Elm_Object_Item* navi_item = elm_naviframe_item_push(ad->nf, i18n_get_text("IDS_TGRAM_OPT_SETTINGS"), NULL, NULL, list, NULL); + elm_naviframe_item_pop_cb_set(navi_item, _pop_cb, ad); + eext_object_event_callback_add(ad->nf, EEXT_CALLBACK_MORE, _create_more_popup, ad); } diff --git a/TelegramTizen/src/tg_user_main_view.c b/TelegramTizen/src/tg_user_main_view.c index 5111254..4896460 100644 --- a/TelegramTizen/src/tg_user_main_view.c +++ b/TelegramTizen/src/tg_user_main_view.c @@ -1042,10 +1042,8 @@ static void _more_popup_rotate(void *data, Evas_Object *obj, void *event_info) switch (pos) { case 90: - evas_object_move(ad->menu_popup, 0, w); - break; case 270: - evas_object_move(ad->menu_popup, h, w); + evas_object_move(ad->menu_popup, 0, w); break; case 180: default: @@ -1082,6 +1080,45 @@ static void _ctxpopup_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_ } } +static void ctxpopup_delete_select_cb(void *data, Evas_Object *obj, void *event_info) +{ + appdata_s *ad = data; + if (!ad) { + LOGE("ad is NULL"); + return; + } + + _ctxpopup_dismiss_cb(ad, NULL, NULL); + + /* please input here when delete menu is clicked */ +} + +static void ctxpopup_search_select_cb(void *data, Evas_Object *obj, void *event_info) +{ + appdata_s *ad = data; + if (!ad) { + LOGE("ad is NULL"); + return; + } + + _ctxpopup_dismiss_cb(ad, NULL, NULL); + + /* please input here when search menu is clicked */ +} + +static void ctxpopup_contact_select_cb(void *data, Evas_Object *obj, void *event_info) +{ + appdata_s *ad = data; + if (!ad) { + LOGE("ad is NULL"); + return; + } + + _ctxpopup_dismiss_cb(ad, NULL, NULL); + + /* please input here when contact menu is clicked */ +} + static void ctxpopup_settings_select_cb(void *data, Evas_Object *obj, void *event_info) { appdata_s *ad = data; @@ -1120,9 +1157,9 @@ static void _create_more_popup(void *data, Evas_Object *obj, void *event_info) evas_object_smart_callback_add(ctxpopup, "dismissed", _ctxpopup_dismiss_cb, ad); evas_object_smart_callback_add(ad->win, "rotation,changed", _more_popup_rotate, ad); - it = elm_ctxpopup_item_append(ctxpopup, i18n_get_text("IDS_TGRAM_OPT_DELETE"), NULL, NULL, ad); - it = elm_ctxpopup_item_append(ctxpopup, i18n_get_text("IDS_TGRAM_OPT_SEARCH"), NULL, NULL, ad); - it = elm_ctxpopup_item_append(ctxpopup, i18n_get_text("IDS_TGRAM_OPT_CONTACTS"), NULL, NULL, ad); + it = elm_ctxpopup_item_append(ctxpopup, i18n_get_text("IDS_TGRAM_OPT_DELETE"), NULL, ctxpopup_delete_select_cb, ad); + it = elm_ctxpopup_item_append(ctxpopup, i18n_get_text("IDS_TGRAM_OPT_SEARCH"), NULL, ctxpopup_search_select_cb, ad); + it = elm_ctxpopup_item_append(ctxpopup, i18n_get_text("IDS_TGRAM_OPT_CONTACTS"), NULL, ctxpopup_contact_select_cb, ad); it = elm_ctxpopup_item_append(ctxpopup, i18n_get_text("IDS_TGRAM_OPT_SETTINGS"), NULL, ctxpopup_settings_select_cb, ad); //elm_object_item_domain_text_translatable_set(it, SETTING_PACKAGE, EINA_TRUE); elm_ctxpopup_direction_priority_set(ctxpopup, ELM_CTXPOPUP_DIRECTION_UP, ELM_CTXPOPUP_DIRECTION_UNKNOWN, ELM_CTXPOPUP_DIRECTION_UNKNOWN, ELM_CTXPOPUP_DIRECTION_UNKNOWN); -- 2.7.4 From a4822edd17972fe55cf7ec241cc390b3c1212508 Mon Sep 17 00:00:00 2001 From: "polu.sandeep" Date: Mon, 19 Oct 2015 21:52:53 +0900 Subject: [PATCH 05/16] Implemented chat selection view Change-Id: I43a91042afa60544dac24bab67bea08e461fcb00 --- TelegramTizen/inc/tg_main_item_deletion_view.h | 17 ++ TelegramTizen/res/edje/telegram_init_screen.edc | 62 ++++++- TelegramTizen/src/telegramtizen.c | 6 +- TelegramTizen/src/tg_main_item_deletion_view.c | 209 ++++++++++++++++++++++ TelegramTizen/src/tg_search_peer_view.c | 225 ++++++------------------ TelegramTizen/src/tg_user_main_view.c | 16 +- TelegramTizen/tg_utils/tg_common.c | 14 +- TelegramTizen/tg_utils/tg_common.h | 3 + tg-engine-service/src/tg-engine-service.c | 18 +- tg-engine-service/tg_engine/tg_engine.c | 122 +++++++++---- tg-engine-service/tg_engine/tg_engine.h | 5 + 11 files changed, 461 insertions(+), 236 deletions(-) create mode 100644 TelegramTizen/inc/tg_main_item_deletion_view.h create mode 100644 TelegramTizen/src/tg_main_item_deletion_view.c diff --git a/TelegramTizen/inc/tg_main_item_deletion_view.h b/TelegramTizen/inc/tg_main_item_deletion_view.h new file mode 100644 index 0000000..d9a7ceb --- /dev/null +++ b/TelegramTizen/inc/tg_main_item_deletion_view.h @@ -0,0 +1,17 @@ +/* + * tg_main_item_deletion_view.h + * + * Created on: Oct 19, 2015 + * Author: sandeep + */ + +#ifndef TG_MAIN_ITEM_DELETION_VIEW_H_ +#define TG_MAIN_ITEM_DELETION_VIEW_H_ + + +#include "tg_common.h" + +extern void launch_main_item_deletion_view_cb(appdata_s* ad); + + +#endif /* TG_MAIN_ITEM_DELETION_VIEW_H_ */ diff --git a/TelegramTizen/res/edje/telegram_init_screen.edc b/TelegramTizen/res/edje/telegram_init_screen.edc index dc1af3b..578f629 100644 --- a/TelegramTizen/res/edje/telegram_init_screen.edc +++ b/TelegramTizen/res/edje/telegram_init_screen.edc @@ -113,9 +113,6 @@ collections { } \ } - - - images { image: "camera_btn_gallery_mask.png" COMP; image: "telegram_date_divider.#.png" COMP; @@ -814,8 +811,8 @@ collections { precise_is_inside: 1; description { state: default 0.0; - rel1.relative: 0.0 0.05; - rel2.relative: 1.0 0.95; + rel1.relative: 0.0 0.08; + rel2.relative: 1.0 0.92; color: 250 250 250 0; } } @@ -825,8 +822,8 @@ collections { precise_is_inside: 1; description { state: default 0.0; - rel1.relative: 0.0 0.05; - rel2.relative: 1.0 0.95; + rel1.relative: 0.0 0.08; + rel2.relative: 1.0 0.92; image.normal: camera_btn_gallery_mask.png; } } @@ -1886,7 +1883,7 @@ group type: SWALLOW; description { state: default 0.0; - min: 0 130; + min: 0 135; rel1.relative: 0.0 0.0; rel2.relative: 1.0 1.0; color: 0 0 0 0; @@ -2996,4 +2993,53 @@ group } } + group { + name: "search_circle_layout"; + parts { + part { + name: masking_bg; + type: RECT; + precise_is_inside: 1; + description { + state: default 0.0; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + color: 250 250 250 0; + } + } + part { + name: masking; + type: IMAGE; + precise_is_inside: 1; + description { + state: default 0.0; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + image.normal: camera_btn_gallery_mask.png; + } + } + part { + name: content_bg; + type: RECT; + clip_to: masking; + description { + state: default 0.0; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + color: 250 250 250 0; + } + } + part { + name: content; + type: SWALLOW; + clip_to: masking; + description { + state: default 0.0; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + } + } + } + } + } diff --git a/TelegramTizen/src/telegramtizen.c b/TelegramTizen/src/telegramtizen.c index d9e0632..3dafa96 100644 --- a/TelegramTizen/src/telegramtizen.c +++ b/TelegramTizen/src/telegramtizen.c @@ -1347,7 +1347,6 @@ static int _on_service_client_msg_received_cb(void *data, bundle *const rec_msg) return SVC_RES_OK; } - // update profile pic if buddy list view is present. if(user_id == app->user_id.id) { // registerd user. @@ -2563,7 +2562,7 @@ void app_nf_back_cb(void *data, Evas_Object *obj, void *event_info) ad->buddy_in_cahtting_data = NULL; ad->peer_in_cahtting_data = NULL; elm_naviframe_item_pop(ad->nf); - create_floating_button(ad); + show_floating_button(ad); ad->current_app_state = TG_USER_MAIN_VIEW_STATE; break; case TG_SELECT_BUDDY_VIEW: @@ -2583,12 +2582,13 @@ void app_nf_back_cb(void *data, Evas_Object *obj, void *event_info) elm_naviframe_item_pop(ad->nf); ad->current_app_state = TG_CHAT_MESSAGING_VIEW_STATE; break; + case TG_USER_MAIN_VIEW_SELECTION_STATE: case TG_PEER_SEARCH_VIEW_STATE: case TG_START_MESSAGING_VIEW_STATE: case TG_SETTINGS_SCREEN_STATE: elm_naviframe_item_pop(ad->nf); ad->current_app_state = TG_USER_MAIN_VIEW_STATE; - create_floating_button(ad); + show_floating_button(ad); //evas_object_show(ad->panel); //elm_panel_hidden_set(ad->panel, EINA_FALSE); break; diff --git a/TelegramTizen/src/tg_main_item_deletion_view.c b/TelegramTizen/src/tg_main_item_deletion_view.c new file mode 100644 index 0000000..3d5acf1 --- /dev/null +++ b/TelegramTizen/src/tg_main_item_deletion_view.c @@ -0,0 +1,209 @@ +/* + * tg_main_item_deletion_view.c + * + * Created on: Oct 19, 2015 + * Author: sandeep + */ + + +#include "tg_main_item_deletion_view.h" + +static Evas_Object* create_image_object_from_file(const char *icon_name, Evas_Object *parent) +{ + Evas_Object *icon = elm_image_add(parent); + evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(icon, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_image_file_set(icon, icon_name, NULL); + evas_object_show(icon); + return icon; +} + +static Evas_Object* create_check(Evas_Object *parent) +{ + Evas_Object *check; + check = elm_check_add(parent); + return check; +} + +char* on_mainlist_title_requested(void *data, Evas_Object *obj, const char *part) +{ + + int org_id = (int) data; + if (org_id == 0) { + if (!strcmp(part,"elm.text.main.left.top") || !strcmp(part,"elm.text")){ + return strdup(i18n_get_text("IDS_TGRAM_MBODY_SELECT_ALL")); + } + return NULL; + } + + int id = org_id - 1; + + appdata_s* ad = evas_object_data_get(obj, "app_data"); + + if (ad->main_list == NULL || eina_list_count(ad->main_list) <= 0) { + return NULL; + } + tg_main_list_item_s* item = eina_list_nth(ad->main_list, id); + if (!item) { + return NULL; + } + if (!strcmp(part,"elm.text.main.left.top") || !strcmp(part,"elm.text")){ + char *full_name = replace(item->peer_print_name, '_', " "); + return full_name; + } else if (!strcmp(part, "elm.text.sub.left.bottom") || !strcmp(part,"elm.text.sub")) { + char* org_msg = NULL; + if (item->last_message) { + org_msg = item->last_message; + } else { + org_msg = ""; + } + return strdup(org_msg); + } else { + return NULL; + } +} + +Evas_Object* on_mainlist_content_requested(void *data, Evas_Object *obj, const char *part) +{ + int org_id = (int) data; + + if (!strcmp("elm.swallow.end", part)) { + return create_check(obj); + } + + if (org_id == 0) { + return NULL; + } + + int id = org_id - 1; + + appdata_s* ad = evas_object_data_get(obj, "app_data"); + + if (ad->main_list == NULL || eina_list_count(ad->main_list) <= 0) { + return NULL; + } + tg_main_list_item_s* item = eina_list_nth(ad->main_list, id); + if (!item) { + return NULL; + } + + + Evas_Object *eo = NULL; + if (!strcmp(part, "elm.icon.left") || !strcmp(part, "elm.icon.1") || !strcmp(part, "elm.swallow.icon")) { + //if (item->profile_pic == NULL) { + Evas_Object *profile_pic = NULL; + if (item->profile_pic_path && strcmp(item->profile_pic_path, "") != 0) { + profile_pic = elm_image_add(obj); + evas_object_size_hint_weight_set(profile_pic, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(profile_pic, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_object_focus_set(profile_pic, EINA_FALSE); + + Eina_Bool is_success = elm_image_file_set(profile_pic, item->profile_pic_path, NULL); + + if (!is_success) { + if (item->peer_type == TGL_PEER_USER) { + profile_pic = create_image_object_from_file(ui_utils_get_resource(DEFAULT_LIST_THUMB_SINGLE_PIC), obj); + // send download request again To-Do + } else if (item->peer_type == TGL_PEER_CHAT) { + profile_pic = create_image_object_from_file(ui_utils_get_resource(DEFAULT_LIST_THUMB_MULTI_PIC), obj); + // send download request again To-Do + } else { + + } + evas_object_color_set(profile_pic, 45, 165, 224, 255); + } + evas_object_show(profile_pic); + } else { + + if (item->peer_type == TGL_PEER_USER) { + profile_pic = create_image_object_from_file(ui_utils_get_resource(DEFAULT_LIST_THUMB_SINGLE_PIC), obj); + } else if (item->peer_type == TGL_PEER_CHAT) { + profile_pic = create_image_object_from_file(ui_utils_get_resource(DEFAULT_LIST_THUMB_MULTI_PIC), obj); + } else { + + } + evas_object_color_set(profile_pic, 45, 165, 224, 255); + } + //} + char edj_path[PATH_MAX] = {0, }; + app_get_resource(TELEGRAM_INIT_VIEW_EDJ, edj_path, (int)PATH_MAX); + Evas_Object* user_pic_layout = elm_layout_add(ad->nf); + elm_layout_file_set(user_pic_layout, edj_path, "search_circle_layout"); + evas_object_size_hint_weight_set(user_pic_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(user_pic_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(user_pic_layout); + elm_object_part_content_set(user_pic_layout, "content", profile_pic); + + eo = elm_layout_add(obj); + elm_layout_theme_set(eo, "layout", "list/B/type.2", "default"); + elm_layout_content_set(eo, "elm.swallow.content", user_pic_layout); + } + return eo; +} + + +void launch_main_item_deletion_view_cb(appdata_s* ad) +{ + if (!ad) + return; + + ad->current_app_state = TG_USER_MAIN_VIEW_SELECTION_STATE; + delete_floating_button(ad); + ad->is_tg_initilized = EINA_TRUE; + char edj_path[PATH_MAX] = {0, }; + app_get_resource(TELEGRAM_INIT_VIEW_EDJ, edj_path, (int)PATH_MAX); + + Evas_Object* scroller = elm_scroller_add(ad->nf); + elm_scroller_bounce_set(scroller, EINA_FALSE, EINA_TRUE); + elm_scroller_policy_set(scroller,ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO); + + Evas_Object* layout = elm_layout_add(ad->nf); + elm_layout_file_set(layout, edj_path, "user_main_screen_new"); + 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_show(layout); + elm_object_content_set(scroller, layout); + + Evas_Object *buddy_list = NULL; + Evas_Object* bg_box = elm_box_add(layout); + evas_object_size_hint_weight_set(bg_box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(bg_box, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(bg_box); + elm_object_part_content_set(layout, "main_box", bg_box); + + if (ad->main_list == NULL || eina_list_count(ad->main_list) <= 0) { + return; + } else { + int i; + static Elm_Genlist_Item_Class itc; + buddy_list = elm_genlist_add(ad->nf); + elm_list_mode_set(buddy_list, ELM_LIST_COMPRESS); + elm_genlist_mode_set(buddy_list, ELM_LIST_COMPRESS); + evas_object_size_hint_weight_set(buddy_list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(buddy_list, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_data_set(buddy_list, "app_data", ad); + elm_genlist_homogeneous_set(buddy_list, EINA_TRUE); + + itc.item_style = "type1"; + itc.func.text_get = on_mainlist_title_requested; + itc.func.content_get = on_mainlist_content_requested; + itc.func.state_get = NULL; + itc.func.del = NULL; + + int size = eina_list_count(ad->main_list); + if(size > 0) { + for (i = 0; i <= size; i++) { + elm_genlist_item_append(buddy_list, &itc, (void *) i, NULL, ELM_GENLIST_ITEM_NONE, NULL, (void*) i); + } + } else { + i = 1; + elm_genlist_item_append(buddy_list, &itc, (void *) i, NULL, ELM_GENLIST_ITEM_NONE, NULL, (void*) i); + } + evas_object_show(buddy_list); + elm_box_pack_end(bg_box, buddy_list); + } + evas_object_data_set(ad->nf, "main_list_box", bg_box); + elm_naviframe_item_push(ad->nf, i18n_get_text("IDS_TGRAM_HEADER_SELECT_CHATS_ABB"), NULL, NULL, scroller, NULL); + +} + diff --git a/TelegramTizen/src/tg_search_peer_view.c b/TelegramTizen/src/tg_search_peer_view.c index 284004f..4803e4c 100755 --- a/TelegramTizen/src/tg_search_peer_view.c +++ b/TelegramTizen/src/tg_search_peer_view.c @@ -90,12 +90,6 @@ char* on_peer_list_name_requested(void *data, Evas_Object *obj, const char *part if (!strcmp(part,"elm.text.main.left.top") || !strcmp(part,"elm.text")){ char *full_name = replace(user->print_name, '_', " "); return full_name; -#if 0 - char temp_full_name[256]; - sprintf(temp_full_name, "%s", full_name); - free(full_name); - return strdup(temp_full_name); -#endif } else if (!strcmp(part, "elm.text.sub.left.bottom") || !strcmp(part,"elm.text.sub")) { char* last_seen = get_budy_state(ad, user->user_id.id); if (last_seen) { @@ -127,25 +121,6 @@ Evas_Object* _on_command_name_image_requested(void *data, Evas_Object *obj, cons if (!strcmp(part, "elm.icon.left") || !strcmp(part, "elm.icon.1") || !strcmp(part, "elm.swallow.icon") ) { - -#if 0 - Evas_Object *profile_pic = create_image_object_from_file(ui_utils_get_resource(contact_screen_command_item_list[row].image_path), obj); - evas_object_color_set(profile_pic, 155, 216, 226, 255); - - char edj_path[PATH_MAX] = {0, }; - app_get_resource(TELEGRAM_INIT_VIEW_EDJ, edj_path, (int)PATH_MAX); - - Evas_Object* user_pic_layout = elm_layout_add(obj); - elm_layout_file_set(user_pic_layout, edj_path, "circle_layout"); - evas_object_size_hint_weight_set(user_pic_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(user_pic_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_show(user_pic_layout); - elm_object_part_content_set(user_pic_layout, "content", profile_pic); - - eo = elm_layout_add(obj); - elm_layout_theme_set(eo, "layout", "list/B/type.2", "default"); - elm_layout_content_set(eo, "elm.swallow.content", user_pic_layout); -#else Evas_Object *profile_pic = NULL; profile_pic = create_image_object_from_file(ui_utils_get_resource(contact_screen_command_item_list[row].image_path), obj); //evas_object_color_set(profile_pic, 45, 165, 224, 255); @@ -159,12 +134,10 @@ Evas_Object* _on_command_name_image_requested(void *data, Evas_Object *obj, cons evas_object_show(user_pic_layout); elm_object_part_content_set(user_pic_layout, "content", profile_pic); - - eo = elm_layout_add(obj); elm_layout_theme_set(eo, "layout", "list/B/type.2", "default"); elm_layout_content_set(eo, "elm.swallow.content", user_pic_layout); -#endif + } return eo; } @@ -180,39 +153,6 @@ Evas_Object* on_peer_list_image_requested(void *data, Evas_Object *obj, const ch { Evas_Object *eo = NULL; if (!strcmp(part, "elm.icon.left") || !strcmp(part, "elm.icon.1") || !strcmp(part, "elm.swallow.icon") ) { -#if 0 - int id = (int) data; - appdata_s* ad = evas_object_data_get(obj, "app_data"); - int size = eina_list_count(ad->search_peer_list); - if (size <= 0) { - return eo; - } - user_data_with_pic_s* item = eina_list_nth(ad->search_peer_list, id); - tg_peer_info_s* user = item->use_data; - Evas_Object *profile_pic = NULL; - if (user->photo_path && strcmp(user->photo_path, "") != 0) { - profile_pic = create_image_object_from_file(user->photo_path, obj); - } else { - profile_pic = create_image_object_from_file(ui_utils_get_resource(DEFAULT_PROFILE_PIC), obj); - } - - - item->contact_icon = profile_pic; - evas_object_event_callback_add(item->contact_icon, EVAS_CALLBACK_DEL, on_peer_icon_deleted, item); - - char edj_path[PATH_MAX] = {0, }; - app_get_resource(TELEGRAM_INIT_VIEW_EDJ, edj_path, (int)PATH_MAX); - Evas_Object* user_pic_layout = elm_layout_add(ad->nf); - elm_layout_file_set(user_pic_layout, edj_path, "circle_layout"); - evas_object_size_hint_weight_set(user_pic_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(user_pic_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_show(user_pic_layout); - elm_object_part_content_set(user_pic_layout, "content", profile_pic); - - eo = elm_layout_add(obj); - elm_layout_theme_set(eo, "layout", "list/B/type.2", "default"); - elm_layout_content_set(eo, "elm.swallow.content", user_pic_layout); -#else int id = (int) data; appdata_s* ad = evas_object_data_get(obj, "app_data"); int size = eina_list_count(ad->search_peer_list); @@ -236,7 +176,7 @@ Evas_Object* on_peer_list_image_requested(void *data, Evas_Object *obj, const ch char edj_path[PATH_MAX] = {0, }; app_get_resource(TELEGRAM_INIT_VIEW_EDJ, edj_path, (int)PATH_MAX); Evas_Object* user_pic_layout = elm_layout_add(ad->nf); - elm_layout_file_set(user_pic_layout, edj_path, "circle_layout"); + elm_layout_file_set(user_pic_layout, edj_path, "search_circle_layout"); evas_object_size_hint_weight_set(user_pic_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(user_pic_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(user_pic_layout); @@ -245,7 +185,7 @@ Evas_Object* on_peer_list_image_requested(void *data, Evas_Object *obj, const ch eo = elm_layout_add(obj); elm_layout_theme_set(eo, "layout", "list/B/type.2", "default"); elm_layout_content_set(eo, "elm.swallow.content", user_pic_layout); -#endif + } return eo; } @@ -306,6 +246,55 @@ static void clear_search_list(appdata_s *ad) } + + +void on_new_contact_creation_reply_cb(app_control_h request, app_control_h reply, app_control_result_e result, void *user_data) +{ + if (result == APP_CONTROL_RESULT_SUCCEEDED) { + appdata_s* ad = user_data; + char* file_path = NULL; + char** path_arryay = NULL; + int array_length = 0; + int status; + char* mime_type = NULL; + status = app_control_get_extra_data_array(reply, APP_CONTROL_DATA_SELECTED, &path_arryay, &array_length); + if (status != APP_CONTROL_ERROR_NONE) { + status = app_control_get_extra_data_array(reply, APP_CONTROL_DATA_PATH, &path_arryay, &array_length); + if (status != APP_CONTROL_ERROR_NONE) { + if (ad) { + show_toast(ad, "Unable to get the result from attach panel"); + } + return; + } + } + + status = app_control_get_mime(reply, &mime_type); + if (status != APP_CONTROL_ERROR_NONE) { + if (ad) { + show_toast(ad, "Unable to get the mime type from attach panel"); + } + return; + } + + for(int i = 0 ; i < array_length ; i++) { + file_path = strdup(path_arryay[i]); + free(file_path); + } + } +} + +int on_create_new_contact(appdata_s* ad) +{ + app_control_h request; + app_control_create(&request); + app_control_set_operation(request, "http://tizen.org/appcontrol/operation/add"); + app_control_set_mime(request, "application/vnd.tizen.contact"); + int result = app_control_send_launch_request(request, &on_new_contact_creation_reply_cb, ad); + app_control_destroy(request); + return result; +} + + static void on_invite_friends_clicked(void *data, Evas_Object *obj, void *event_info) { Elm_Object_Item *it = event_info; @@ -330,6 +319,7 @@ static void on_group_chat_clicked(void *data, Evas_Object *obj, void *event_info Elm_Object_Item *it = event_info; elm_genlist_item_selected_set(it, EINA_FALSE); appdata_s* ad = evas_object_data_get(obj, "app_data"); + delete_floating_button(ad); launch_contact_selction_view(ad); } @@ -343,58 +333,6 @@ static void on_secret_chat_clicked(void *data, Evas_Object *obj, void *event_inf static void on_peer_item_clicked(void *data, Evas_Object *obj, void *event_info) { -#if 0 - Elm_Object_Item *it = event_info; - elm_genlist_item_selected_set(it, EINA_FALSE); - - int item_id = (int) data; - appdata_s* ad = evas_object_data_get(obj, "app_data"); - - user_data_with_pic_s* sel_pic_item = eina_list_nth(ad->search_peer_list, item_id); - user_data_s* sel_item = sel_pic_item->use_data; - - - ad->buddy_in_cahtting_data = NULL; - ad->peer_in_cahtting_data = NULL; - int buddy_id = -1; - if (sel_item) { - if (sel_item->peer_type == TGL_PEER_USER) { - for (int i = 0; i < eina_list_count(ad->search_peer_list); i++) { - user_data_with_pic_s *item = eina_list_nth(ad->search_peer_list, i); - user_data_s* user_data = item->use_data; - - if (user_data->user_id.id == sel_item->peer_id) { - ad->buddy_in_cahtting_data = item; - break; - } - } - } - - for (int i = 0; i < eina_list_count(ad->peer_list); i++) { - user_data_with_pic_s* pic_item = eina_list_nth(ad->peer_list, i); - tg_peer_info_s* item = pic_item->use_data; - - if (item->peer_id == sel_item->peer_id) { - ad->peer_in_cahtting_data = pic_item; - buddy_id = i; - break; - } - } - - for (int i = 0; i < eina_list_count(ad->main_list); i++) { - tg_main_list_item_s* item = eina_list_nth(ad->main_list, i); - - if (item->peer_id == sel_item->peer_id) { - ad->main_item_in_cahtting_data = item; - break; - } - } - - elm_naviframe_item_pop(ad->nf); - clear_search_list(ad); - launch_messaging_view_cb(ad, buddy_id); - } -#else Elm_Object_Item *it = event_info; elm_genlist_item_selected_set(it, EINA_FALSE); @@ -443,7 +381,6 @@ static void on_peer_item_clicked(void *data, Evas_Object *obj, void *event_info) elm_naviframe_item_pop(ad->nf); launch_messaging_view_cb(ad, peer_id); -#endif } static void _update_index_item(void *data, void *item_data, int id) @@ -635,19 +572,16 @@ static void _on_search_entry_changed(void *data, Evas_Object *obj, void *event_i static void _on_search_entry_focused(void *data, Evas_Object *obj, void *event_info) { Evas_Object *layout = data; - if (elm_object_focus_get(layout)) { elm_object_signal_emit(layout, "elm,state,focused", ""); } else{ elm_object_signal_emit(layout, "elm,state,unfocused", ""); } - } Evas_Object *_create_searchbar(Evas_Object* parent, void* data) { - char edj_path[PATH_MAX] = {0, }; app_get_resource(TELEGRAM_INIT_VIEW_EDJ, edj_path, (int)PATH_MAX); @@ -745,7 +679,6 @@ static Evas_Object* create_fastscroll(appdata_s *ad) /* 1. Special character & Numbers */ elm_index_item_append(index, "#", NULL, NULL); -#if 1 /* 2. Local language */ str = dgettext("efl-extension", "IDS_EA_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ"); len = strlen(str); @@ -758,7 +691,6 @@ static Evas_Object* create_fastscroll(appdata_s *ad) elm_index_item_append(index, buf, NULL, NULL); } -#endif elm_index_level_go(index, 0); evas_object_smart_callback_add(index, "selected", _index_selected_cb, ad); @@ -830,55 +762,4 @@ void launch_start_peer_search_view(appdata_s* ad) elm_naviframe_item_push(ad->nf, "Contacts", NULL, NULL, layout, NULL); -#if 0 - - clear_search_list(ad); - ad->search_peer_list = load_buddy_data_by_name(NULL); - - /* main layout */ - Evas_Object* layout = elm_layout_add(ad->nf); - elm_layout_theme_set(layout, "layout", "application", "searchbar_base"); - 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_show(layout); - //evas_object_data_set(ad->nf, "main_layout", layout); - - /* search field */ - Evas_Object* searchbar_layout = _create_searchbar(layout, ad); - elm_object_part_content_set(layout, "searchbar", searchbar_layout); - _util_get_first_char - /* fastscroll layout */ - Evas_Object* fs_layout = elm_layout_add(layout); - elm_layout_theme_set(fs_layout, "layout", "application", "fastscroll"); - elm_object_part_content_set(layout, "elm.swallow.content", fs_layout); - evas_object_data_set(ad->nf, "fs_layout", fs_layout); - - /* fastscroll */ - Evas_Object* index = create_fastscroll(ad); - elm_object_part_content_set(fs_layout, "elm.swallow.fastscroll", index); - evas_object_data_set(ad->nf, "fs_index", index); - - /* peer list - Genlist */ - Evas_Object* peer_list = create_genlist(ad, fs_layout); - - _append_command_item(peer_list, ad); - _append_peer_item(peer_list, ad, ad->search_peer_list); - //evas_object_data_set(ad->nf, "search_list", peer_list); - - /* no contents */ - Evas_Object *nocontents = elm_layout_add(ad->nf); - elm_layout_theme_set(nocontents, "layout", "nocontents", "default"); - evas_object_size_hint_weight_set(nocontents, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(nocontents, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_object_part_text_set(nocontents, "elm.text", "No Items"); - evas_object_data_set(ad->nf, "no_contents_layout", nocontents); - - Elm_Object_Item* navi_item = elm_naviframe_item_push(ad->nf, "Telegram", NULL, NULL, layout, NULL); - //elm_naviframe_prev_btn_auto_pushed_set(ad->nf, EINA_FALSE); - //eext_object_event_callback_add(ad->nf, EEXT_CALLBACK_BACK, eext_naviframe_back_cb, NULL); - - - //elm_naviframe_item_simple_push(ad->nf, scroller); - //elm_naviframe_item_simple_push(ad->nf, layout); -#endif } diff --git a/TelegramTizen/src/tg_user_main_view.c b/TelegramTizen/src/tg_user_main_view.c index 4896460..b233535 100644 --- a/TelegramTizen/src/tg_user_main_view.c +++ b/TelegramTizen/src/tg_user_main_view.c @@ -14,6 +14,7 @@ #include "tg_db_manager.h" #include "server_requests.h" #include "tg_db_wrapper.h" +#include "tg_main_item_deletion_view.h" static Evas_Object *create_image_object_from_file(const char *icon_name, Evas_Object *parent) { @@ -734,7 +735,7 @@ Evas_Object* on_chat_item_load_requested(void *data, Evas_Object *obj, const cha char* user_name = replace(item->peer_print_name, '_', ""); char buf[512] = {'\0'}; - snprintf(buf, 512, "%s", user_name); + snprintf(buf, 512, "%s", user_name); free(user_name); Evas_Object* name_lbl = elm_label_add(ad->nf); @@ -766,15 +767,15 @@ Evas_Object* on_chat_item_load_requested(void *data, Evas_Object *obj, const cha if(len_org_str > 30) { strncpy(res, org_msg, 29); if(item->last_msg_service) { - sprintf(status_buf,"%s", res); + sprintf(status_buf,"%s", res); } else { - sprintf(status_buf,"%s", res); + sprintf(status_buf,"%s", res); } } else { if(item->last_msg_service) { - sprintf(status_buf, "%s", org_msg); + sprintf(status_buf, "%s", org_msg); } else { - sprintf(status_buf, "%s", org_msg); + sprintf(status_buf, "%s", org_msg); } } @@ -1090,7 +1091,7 @@ static void ctxpopup_delete_select_cb(void *data, Evas_Object *obj, void *event_ _ctxpopup_dismiss_cb(ad, NULL, NULL); - /* please input here when delete menu is clicked */ + launch_main_item_deletion_view_cb(ad); } static void ctxpopup_search_select_cb(void *data, Evas_Object *obj, void *event_info) @@ -1115,7 +1116,7 @@ static void ctxpopup_contact_select_cb(void *data, Evas_Object *obj, void *event } _ctxpopup_dismiss_cb(ad, NULL, NULL); - + on_floating_icon_clicked(data, obj, event_info); /* please input here when contact menu is clicked */ } @@ -1237,7 +1238,6 @@ void launch_user_main_view_cb(appdata_s* ad) evas_object_size_hint_weight_set(buddy_list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(buddy_list, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_data_set(buddy_list, "app_data", ad); - elm_genlist_block_count_set(buddy_list, 14); elm_genlist_homogeneous_set(buddy_list, EINA_TRUE); diff --git a/TelegramTizen/tg_utils/tg_common.c b/TelegramTizen/tg_utils/tg_common.c index 2d7d493..55508d0 100644 --- a/TelegramTizen/tg_utils/tg_common.c +++ b/TelegramTizen/tg_utils/tg_common.c @@ -423,13 +423,18 @@ void on_floating_icon_clicked(void *data, Evas_Object *obj, void *event_info) { appdata_s* ad = data; + if (ad->menu_popup) { + evas_object_del(ad->menu_popup); + ad->menu_popup = NULL; + } + Evas_Object* image = (Evas_Object*)evas_object_data_get(ad->floating_btn, "image"); switch(ad->current_app_state) { case TG_PEER_SEARCH_VIEW_STATE: - elm_image_file_set(image, ui_utils_get_resource(TG_ICON_FLOATING_PENCIL), NULL); - launch_settings_screen(ad); - delete_floating_button(ad); + //elm_image_file_set(image, ui_utils_get_resource(TG_ICON_FLOATING_PENCIL), NULL); + on_create_new_contact(ad); + //delete_floating_button(ad); break; case TG_USER_MAIN_VIEW_STATE: elm_image_file_set(image, ui_utils_get_resource(TG_ICON_FLOATING_ADD), NULL); @@ -491,6 +496,7 @@ void show_floating_button(appdata_s* ad) return; if (ad->floating_btn){ + update_floating_button(ad, ad->current_app_state); elm_layout_signal_emit(ad->floating_btn, "elm,state,floatingbutton,visible", "elm"); } } @@ -508,7 +514,7 @@ void update_floating_button(appdata_s* ad, int mode) elm_image_file_set(image, ui_utils_get_resource(TG_ICON_FLOATING_ADD), NULL); break; case TG_USER_MAIN_VIEW_STATE: - elm_image_file_set(image, ui_utils_get_resource(TG_ICON_FLOATING_ADD), NULL); + elm_image_file_set(image, ui_utils_get_resource(TG_ICON_FLOATING_PENCIL), NULL); break; default : elm_image_file_set(image, ui_utils_get_resource(TG_ICON_FLOATING_PENCIL), NULL); diff --git a/TelegramTizen/tg_utils/tg_common.h b/TelegramTizen/tg_utils/tg_common.h index 0aedfd9..3a1a797 100644 --- a/TelegramTizen/tg_utils/tg_common.h +++ b/TelegramTizen/tg_utils/tg_common.h @@ -279,6 +279,7 @@ typedef enum state_of_app { TG_BUDDY_CHAT_STATE, TG_BUDDY_CHAT_CONV_STATE, TG_USER_MAIN_VIEW_STATE, + TG_USER_MAIN_VIEW_SELECTION_STATE, TG_START_MESSAGING_VIEW_STATE, TG_CHAT_MESSAGING_VIEW_STATE, TG_PEER_SEARCH_VIEW_STATE, @@ -1099,4 +1100,6 @@ extern void update_floating_button(appdata_s* ad, int mode); extern void on_new_message_clicked(void *data, Evas_Object *obj, void *event_info); +extern void on_floating_icon_clicked(void *data, Evas_Object *obj, void *event_info); + #endif /* TG_COMMON_H_ */ diff --git a/tg-engine-service/src/tg-engine-service.c b/tg-engine-service/src/tg-engine-service.c index a4a2e8f..80e0549 100644 --- a/tg-engine-service/src/tg-engine-service.c +++ b/tg-engine-service/src/tg-engine-service.c @@ -491,6 +491,10 @@ bool service_app_create(void *data) tg_data->mhash = NULL; tg_data->lazy_init_idler = NULL; tg_data->s_notififcation = NULL; + tg_data->chat_list = NULL; + tg_data->current_chat_index = 0; + tg_data->buddy_list = NULL; + tg_data->current_buddy_index = 0; //tg_data->is_loading_completed = EINA_FALSE; RETVM_IF(!tg_data->tg_server, SVC_RES_FAIL, "Failed to create proxy client"); @@ -506,9 +510,6 @@ bool service_app_create(void *data) result = _tg_server_set_remote_data(tg_data->tg_server, TELEGRAM_CLIENT_APP_NAME, TELEGRAM_CLIENT_PORT_NAME); result = tg_server_register_msg_receive_callback(tg_data->tg_server, _on_tg_server_msg_received_cb, tg_data); - // if wi-fi or data is on - create_data_base_tables(); - int err = badge_new(TELEGRAM_APP_ID); if (BADGE_ERROR_NONE != err) { @@ -578,6 +579,17 @@ void free_connection(tg_engine_data_s* tg_data) free_contact_data(tg_data->contact_list_to_add); tg_data->contact_list_to_add = NULL; } + + if (tg_data->chat_list) { + eina_list_free(tg_data->chat_list); + tg_data->chat_list = NULL; + } + + if (tg_data->buddy_list) { + eina_list_free(tg_data->buddy_list); + tg_data->buddy_list = NULL; + } + tgl_engine_var_free(); tg_db_fini(); diff --git a/tg-engine-service/tg_engine/tg_engine.c b/tg-engine-service/tg_engine/tg_engine.c index 5f55c8d..7267034 100644 --- a/tg-engine-service/tg_engine/tg_engine.c +++ b/tg-engine-service/tg_engine/tg_engine.c @@ -565,6 +565,7 @@ void tg_logged_in(struct tgl_state *TLS) t_id.id = TLS->our_id; t_id.type = TGL_PEER_USER; tg_data->is_first_time_registration = EINA_TRUE; + create_data_base_tables(); tgl_do_get_user_info(TLS, t_id, offline_mode, &on_user_info_loaded, NULL); } @@ -1747,16 +1748,84 @@ void on_buddy_info_loaded(struct tgl_state *TLS, void *callback_extra, int succe } } +void on_chat_history_received(struct tgl_state *TLS, void *callback_extra, int success, int size, struct tgl_message *list[]) +{ + tg_engine_data_s *tg_data = TLS->callback_data; + for (int i = 0; i < size; i++) { + struct tgl_message* message = list[i]; + if (message->service || message->from_id.id == tg_data->id.id) { + continue; + } + Eina_Bool ret = insert_buddy_msg_to_db(message); + if (ret) { + tg_msg_receive(s_info.TLS, message); + } + } + tg_data->current_chat_index = tg_data->current_chat_index + 1; + if (tg_data->current_chat_index < eina_list_count(tg_data->chat_list)) { + tgl_peer_t* UC = eina_list_nth(tg_data->chat_list, tg_data->current_chat_index); + tgl_do_get_history(s_info.TLS, UC->id, 20, 0, on_chat_history_received, UC); + } else { + tg_data->current_chat_index = 0; + } +} + +static Eina_Bool on_load_chat_history_requested(void *data) +{ + struct tgl_state *TLS = data; + if (TLS) { + tg_engine_data_s *tg_data = TLS->callback_data; + tg_data->current_chat_index = 0; + tgl_peer_t* UC = eina_list_nth(tg_data->chat_list, tg_data->current_chat_index); + tgl_do_get_history(s_info.TLS, UC->id, 20, 0, on_chat_history_received, UC); + } + return ECORE_CALLBACK_CANCEL; +} + +void on_buddy_history_received(struct tgl_state *TLS, void *callback_extra, int success, int size, struct tgl_message *list[]) +{ + tg_engine_data_s *tg_data = TLS->callback_data; + for (int i = 0; i < size; i++) { + struct tgl_message* message = list[i]; + if (message->service || message->from_id.id == tg_data->id.id) { + continue; + } + Eina_Bool ret = insert_buddy_msg_to_db(message); + if (ret) { + tg_msg_receive(s_info.TLS, message); + } + } + tg_data->current_buddy_index = tg_data->current_buddy_index + 1; + if (tg_data->current_buddy_index < eina_list_count(tg_data->buddy_list)) { + tgl_peer_t* UC = eina_list_nth(tg_data->buddy_list, tg_data->current_buddy_index); + tgl_do_get_history(s_info.TLS, UC->id, 20, 0, on_buddy_history_received, UC); + } else { + tg_data->current_buddy_index = 0; + ecore_timer_add(5, on_load_chat_history_requested, TLS); + } +} + +static Eina_Bool on_load_buddy_history_requested(void *data) +{ + struct tgl_state *TLS = data; + if (TLS) { + tg_engine_data_s *tg_data = TLS->callback_data; + tg_data->current_buddy_index = 0; + tgl_peer_t* UC = eina_list_nth(tg_data->buddy_list, tg_data->current_buddy_index); + tgl_do_get_history(s_info.TLS, UC->id, 20, 0, on_buddy_history_received, UC); + } + return ECORE_CALLBACK_CANCEL; +} + void on_contacts_received(struct tgl_state *TLS, void *callback_extra, int success, int size, struct tgl_user *contacts[]) { + tg_engine_data_s *tg_data = TLS->callback_data; for (int i = size - 1; i >= 0; i--) { struct tgl_user *buddy = contacts[i]; - char* msg_table = get_table_name_from_number(buddy->id.id); create_buddy_msg_table(msg_table); free(msg_table); - //tgl_do_get_user_info(TLS, buddy->id, 0, &on_buddy_info_loaded, NULL); if (buddy->id.id == 333000 || buddy->id.id == 777000) { buddy->is_unknown = 1; } else { @@ -1777,56 +1846,33 @@ void on_contacts_received(struct tgl_state *TLS, void *callback_extra, int succe struct tgl_user *buddy = contacts[i]; tgl_do_get_user_info(TLS, buddy->id, 0, on_buddy_info_loaded, NULL); } - tg_engine_data_s *tg_data = TLS->callback_data; - //tg_data->is_loading_completed = EINA_TRUE; - send_response_for_server_connection_status(tg_data, tg_data->is_login_activated); - ecore_timer_add(5, on_send_unsent_messages_requested, TLS); -} - -void on_history_received(struct tgl_state *TLS, void *callback_extra, int success, int size, struct tgl_message *list[]) -{ - for (int i = 0; i < size; i++) { - //struct tgl_message - struct tgl_message* message = list[i]; - if (message->service) { - continue; - } - Eina_Bool ret = insert_buddy_msg_to_db(message); - if (ret) { - tg_msg_receive(s_info.TLS, message); - } - } + ecore_timer_add(3, on_send_unsent_messages_requested, TLS); + ecore_timer_add(6, on_load_buddy_history_requested, TLS); } -#if 0 -static Eina_Bool on_load_history_requested(void *data) -{ - tgl_peer_t* UC = data; - tgl_do_get_history(s_info.TLS, UC->id, 15, 0, on_history_received, UC); - return ECORE_CALLBACK_CANCEL; -} -#endif void on_contacts_and_chats_loaded(struct tgl_state *TLS, void *callback_extra, int success, int size, tgl_peer_id_t peers[], int last_msg_id[], int unread_count[]) { -#if 0 - int int_cnt = 5; -#endif + tg_engine_data_s *tg_data = TLS->callback_data; + if (tg_data->chat_list) { + eina_list_free(tg_data->chat_list); + tg_data->chat_list = NULL; + } + if (tg_data->buddy_list) { + eina_list_free(tg_data->buddy_list); + tg_data->buddy_list = NULL; + } for (int i = size - 1; i >= 0; i--) { tgl_peer_t* UC = tgl_peer_get(TLS, peers[i]); // insert into peer table insert_peer_into_database(UC, last_msg_id[i], unread_count[i], 0); -#if 0 - int_cnt = int_cnt + 3; - ecore_timer_add(int_cnt, on_load_history_requested, UC); -#endif switch (tgl_get_peer_type(peers[i])) { case TGL_PEER_USER: - // To-Do + tg_data->buddy_list = eina_list_append(tg_data->buddy_list, UC); break; case TGL_PEER_CHAT: - // To-Do + tg_data->chat_list = eina_list_append(tg_data->chat_list, UC); break; case TGL_PEER_ENCR_CHAT: // To-Do diff --git a/tg-engine-service/tg_engine/tg_engine.h b/tg-engine-service/tg_engine/tg_engine.h index 0be34c3..86cd61d 100644 --- a/tg-engine-service/tg_engine/tg_engine.h +++ b/tg-engine-service/tg_engine/tg_engine.h @@ -143,6 +143,11 @@ typedef struct tg_engine_data { char* mhash; //Eina_Bool is_loading_completed; notification_h s_notififcation; + Eina_List *chat_list; + int current_chat_index; + + Eina_List *buddy_list; + int current_buddy_index; } tg_engine_data_s; typedef struct contact_data { -- 2.7.4 From d6223a185a967e1042b92e3a871428e262fd8941 Mon Sep 17 00:00:00 2001 From: "moon87.park" Date: Tue, 20 Oct 2015 19:32:50 +0900 Subject: [PATCH 06/16] [Telegram] Modify the contact_selection view and the search fuction Change-Id: I319bd54d15db23ec2829424d84c74c8e063669b3 --- TelegramTizen/inc/ucol.h | 35 ++ TelegramTizen/res/po/ar.po | 3 + TelegramTizen/res/po/as.po | 18 + TelegramTizen/res/po/az.po | 3 + TelegramTizen/res/po/be_BY.po | 18 + TelegramTizen/res/po/bn.po | 18 + TelegramTizen/res/po/bn_BD.po | 18 + TelegramTizen/res/po/de.po | 3 + TelegramTizen/res/po/en.po | 3 + TelegramTizen/res/po/en_PH.po | 3 + TelegramTizen/res/po/en_US.po | 3 + TelegramTizen/res/po/es_ES.po | 3 + TelegramTizen/res/po/es_US.po | 5 +- TelegramTizen/res/po/fa.po | 18 + TelegramTizen/res/po/fr.po | 3 + TelegramTizen/res/po/gu.po | 18 + TelegramTizen/res/po/hi.po | 3 + TelegramTizen/res/po/hy.po | 3 + TelegramTizen/res/po/id.po | 18 + TelegramTizen/res/po/it_IT.po | 3 + TelegramTizen/res/po/ka.po | 483 ++++++++++++++++ TelegramTizen/res/po/kk.po | 3 + TelegramTizen/res/po/km.po | 18 + TelegramTizen/res/po/kn.po | 18 + TelegramTizen/res/po/ko_KR.po | 3 + TelegramTizen/res/po/ky_KG.po | 18 + TelegramTizen/res/po/lo.po | 18 + TelegramTizen/res/po/ml.po | 18 + TelegramTizen/res/po/mn_MN.po | 18 + TelegramTizen/res/po/mr.po | 18 + TelegramTizen/res/po/ms.po | 18 + TelegramTizen/res/po/my_ZG.po | 18 + TelegramTizen/res/po/ne.po | 18 + TelegramTizen/res/po/or.po | 18 + TelegramTizen/res/po/pa.po | 18 + TelegramTizen/res/po/pt_BR.po | 3 + TelegramTizen/res/po/pt_PT.po | 3 + TelegramTizen/res/po/ru_RU.po | 3 + TelegramTizen/res/po/si.po | 18 + TelegramTizen/res/po/ta.po | 18 + TelegramTizen/res/po/te.po | 18 + TelegramTizen/res/po/tg_TJ.po | 18 + TelegramTizen/res/po/th.po | 18 + TelegramTizen/res/po/tk_TM.po | 18 + TelegramTizen/res/po/tl.po | 18 + TelegramTizen/res/po/tr_TR.po | 3 + TelegramTizen/res/po/uk.po | 3 + TelegramTizen/res/po/ur.po | 18 + TelegramTizen/res/po/uz.po | 3 + TelegramTizen/res/po/vi.po | 18 + TelegramTizen/res/po/zh_CN.po | 3 + TelegramTizen/src/contact_selection_view.c | 385 +++++++++++-- TelegramTizen/src/telegramtizen.c | 3 + TelegramTizen/src/tg_search_peer_view.c | 178 +++--- TelegramTizen/src/ucol.c | 851 +++++++++++++++++++++++++++++ 55 files changed, 2398 insertions(+), 106 deletions(-) create mode 100755 TelegramTizen/inc/ucol.h create mode 100755 TelegramTizen/res/po/ka.po create mode 100755 TelegramTizen/src/ucol.c diff --git a/TelegramTizen/inc/ucol.h b/TelegramTizen/inc/ucol.h new file mode 100755 index 0000000..4cc04df --- /dev/null +++ b/TelegramTizen/inc/ucol.h @@ -0,0 +1,35 @@ +#ifndef TG_UCOL_H_ +#define TG_UCOL_H_ + +#include "tg_common.h" + +enum LANGUAGE { + LANG_ENGLISH, + LANG_KOREAN, + LANG_JAPANESS, + LANG_CHINESS, + LANG_UNKNOWN +}; + +extern int ucol_init(void); + +extern int ucol_compare(const char *src, const char *dest); +extern int ucol_case_compare(const char *src, const char *dest); + +extern int ucol_ncompare(const char *src, const char *dest, int len); +extern int ucol_case_ncompare(const char *src, const char *dest, int len); + +extern int ucol_search(const char *haystack, const char *needle); +extern int ucol_case_search(const char *haystack, const char *needle); + +extern int ucol_compare_first_letters(const char *src, const char *letters); +extern int ucol_detect_lang(int ch); +extern int ucol_fini(void); +extern const int ucol_current_lang(void); +extern int ucol_is_alpha(const char *name); +extern int ucol_is_jamo(const char *name); +extern int ucol_is_hangul(const char *name); +/* End of a file */ + + +#endif diff --git a/TelegramTizen/res/po/ar.po b/TelegramTizen/res/po/ar.po index 4bb56fe..b775f39 100755 --- a/TelegramTizen/res/po/ar.po +++ b/TelegramTizen/res/po/ar.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "ابتثجحخدذرزسشصضطظعغفقكلمنهوي" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "تطبيق المراسلة %1$sالأسرع%2$s حول العالم\nوهو %3$sمجاني%4$s و%5$sآمن%6$s." diff --git a/TelegramTizen/res/po/as.po b/TelegramTizen/res/po/as.po index 398c032..882140a 100755 --- a/TelegramTizen/res/po/as.po +++ b/TelegramTizen/res/po/as.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "অআইঈউঊঋএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযৰলৱশষসহABCDEFGHIJKLMNOPQRSTUVWXYZ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "বিশ্বৰ %1$sদ্ৰুততম%2$s মেচেজ এপ\nএইটো %3$sবিনামূলীয়া%4$s আৰু %5$sসুৰক্ষিত%6$s৷" @@ -463,3 +466,18 @@ msgstr "অনাৱৰোধ কৰক" msgid "IDS_TGRAM_OPT_SHARE" msgstr "ভাগ-বতৰা" +msgid "IDS_TGRAM_HEADER_LOG_OUT" +msgstr "লগ আউট কৰক" + +msgid "IDS_TGRAM_BODY_ENCRYPTED_FROM_END_TO_END_M_NOUN" +msgstr "অন্তিমৰ পৰা অন্তিমলৈ এনক্ৰিপ্ট কৰক" + +msgid "IDS_TGRAM_BODY_NOT_SAVED_ANYWHERE_M_NOUN" +msgstr "কোনো ঠাইতে সংৰক্ষণ কৰা নাই" + +msgid "IDS_TGRAM_BODY_AUTOMATICALLY_DELETED_AFTER_A_PRESET_TIME_M_NOUN" +msgstr "এটা প্ৰিছেট সময়ৰ পিছত স্বয়ংক্ৰিয়ভাৱে বিলোপ হ'ব" + +msgid "IDS_TGRAM_BODY_CANNOT_BE_FORWARDED_M_NOUN" +msgstr "অগ্ৰসৰ কৰিব পৰা নাযাব" + diff --git a/TelegramTizen/res/po/az.po b/TelegramTizen/res/po/az.po index 2f2c913..85f7c52 100755 --- a/TelegramTizen/res/po/az.po +++ b/TelegramTizen/res/po/az.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "ABCÇDEƏFGĞHXIİJKQLMNOÖPRSŞTUÜVYZ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "Dünyanın %1$sən sürətli%2$s mesajlaşma proqramı\nO %3$spulsuz%4$s və %5$stəhlükəsizdir%6$s." diff --git a/TelegramTizen/res/po/be_BY.po b/TelegramTizen/res/po/be_BY.po index 99fbe45..3777fed 100755 --- a/TelegramTizen/res/po/be_BY.po +++ b/TelegramTizen/res/po/be_BY.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "АБВГДЕЁЖЗІЙКЛМНОПРСТУЎФХЦЧШЫЬЭЮЯ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "Самая %1$sхуткая%2$s праграма абмену паведамленняў у свеце\nЯна %3$sбясплатная%4$s і %5$sбяспечная%6$s." @@ -463,3 +466,18 @@ msgstr "Разблак." msgid "IDS_TGRAM_OPT_SHARE" msgstr "Абагуліць" +msgid "IDS_TGRAM_HEADER_LOG_OUT" +msgstr "Выйсці з сістэмы" + +msgid "IDS_TGRAM_BODY_ENCRYPTED_FROM_END_TO_END_M_NOUN" +msgstr "Зашыфравана цалкам" + +msgid "IDS_TGRAM_BODY_NOT_SAVED_ANYWHERE_M_NOUN" +msgstr "Нідзе не захавана" + +msgid "IDS_TGRAM_BODY_AUTOMATICALLY_DELETED_AFTER_A_PRESET_TIME_M_NOUN" +msgstr "Аўтаматычна выдалена праз перадвызначаны час" + +msgid "IDS_TGRAM_BODY_CANNOT_BE_FORWARDED_M_NOUN" +msgstr "Немагчыма пераадрасаваць" + diff --git a/TelegramTizen/res/po/bn.po b/TelegramTizen/res/po/bn.po index 941a100..b464e2a 100755 --- a/TelegramTizen/res/po/bn.po +++ b/TelegramTizen/res/po/bn.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "অআইঈউঊঋএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযরলশষসহABCDEFGHIJKLMNOPQRSTUVWXYZ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "বিশ্বের %1$sদ্রুততম%2$s মেসেজিং অ্যাপ\nএটি %3$sবিনামূল্যে%4$s এবং %5$sনিরাপদ%6$s।" @@ -463,3 +466,18 @@ msgstr "অবরোধমুক্ত করুন" msgid "IDS_TGRAM_OPT_SHARE" msgstr "শেয়ার করুন" +msgid "IDS_TGRAM_HEADER_LOG_OUT" +msgstr "লগ আউট" + +msgid "IDS_TGRAM_BODY_ENCRYPTED_FROM_END_TO_END_M_NOUN" +msgstr "শেষ থেকে শেষ অবধি এনক্রিপ্টেড" + +msgid "IDS_TGRAM_BODY_NOT_SAVED_ANYWHERE_M_NOUN" +msgstr "অন্য কোথাও সংরক্ষিত নেই" + +msgid "IDS_TGRAM_BODY_AUTOMATICALLY_DELETED_AFTER_A_PRESET_TIME_M_NOUN" +msgstr "একটি প্রিসেট সময়ের পরে স্বয়ংক্রিয়ভাবে মোছা হয়েছে" + +msgid "IDS_TGRAM_BODY_CANNOT_BE_FORWARDED_M_NOUN" +msgstr "অগ্রবর্তী করা যাবে না" + diff --git a/TelegramTizen/res/po/bn_BD.po b/TelegramTizen/res/po/bn_BD.po index 515b7a4..d504953 100755 --- a/TelegramTizen/res/po/bn_BD.po +++ b/TelegramTizen/res/po/bn_BD.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "অআইঈউঊঋএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযরলশষসহABCDEFGHIJKLMNOPQRSTUVWXYZ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "বিশ্বের %1$sসবচেয়ে নিরাপদ%2$s মেসেজিং অ্যাপ\nএটি %3$sফ্রি%4$s ও %5$sনিরাপদ%6$s৷" @@ -463,3 +466,18 @@ msgstr "আনব্লক" msgid "IDS_TGRAM_OPT_SHARE" msgstr "শেয়ার করুন" +msgid "IDS_TGRAM_HEADER_LOG_OUT" +msgstr "লগ-আউট" + +msgid "IDS_TGRAM_BODY_ENCRYPTED_FROM_END_TO_END_M_NOUN" +msgstr "এক প্রান্ত থেকে আরেক প্রান্ত পর্যন্ত এনক্রিপ্টেড" + +msgid "IDS_TGRAM_BODY_NOT_SAVED_ANYWHERE_M_NOUN" +msgstr "কোথাও সংরক্ষিত হয়নি" + +msgid "IDS_TGRAM_BODY_AUTOMATICALLY_DELETED_AFTER_A_PRESET_TIME_M_NOUN" +msgstr "পূর্বনির্ধারিত সময় পরে স্বয়ংক্রিয়ভাবে মুছে ফেলা হয়েছে" + +msgid "IDS_TGRAM_BODY_CANNOT_BE_FORWARDED_M_NOUN" +msgstr "ফরোয়ার্ড করা যাবে না" + diff --git a/TelegramTizen/res/po/de.po b/TelegramTizen/res/po/de.po index 08d5eec..0f14ad7 100755 --- a/TelegramTizen/res/po/de.po +++ b/TelegramTizen/res/po/de.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "Die %1$sschnellste%2$s Nachrichten-App der Welt\nSie ist %3$sgratis%4$s und %5$ssicher%6$s." diff --git a/TelegramTizen/res/po/en.po b/TelegramTizen/res/po/en.po index 399d216..0f0b648 100755 --- a/TelegramTizen/res/po/en.po +++ b/TelegramTizen/res/po/en.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "The world's %1$sfastest%2$s messaging app\nIt is %3$sfree%4$s and %5$ssecure%6$s." diff --git a/TelegramTizen/res/po/en_PH.po b/TelegramTizen/res/po/en_PH.po index 399d216..0f0b648 100755 --- a/TelegramTizen/res/po/en_PH.po +++ b/TelegramTizen/res/po/en_PH.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "The world's %1$sfastest%2$s messaging app\nIt is %3$sfree%4$s and %5$ssecure%6$s." diff --git a/TelegramTizen/res/po/en_US.po b/TelegramTizen/res/po/en_US.po index 70ee1e6..05c6ce7 100755 --- a/TelegramTizen/res/po/en_US.po +++ b/TelegramTizen/res/po/en_US.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "The world's %1$sfastest%2$s messaging app\nIt is %3$sfree%4$s and %5$ssecure%6$s." diff --git a/TelegramTizen/res/po/es_ES.po b/TelegramTizen/res/po/es_ES.po index 56d76e5..742cb11 100755 --- a/TelegramTizen/res/po/es_ES.po +++ b/TelegramTizen/res/po/es_ES.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "ABCDEFGHIJKLMNÑOPQRSTUVWXYZ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "La aplicación de mensajería %1$smás rápida%2$s del mundo\nEs %3$sgratuita%4$s y %5$ssegura%6$s." diff --git a/TelegramTizen/res/po/es_US.po b/TelegramTizen/res/po/es_US.po index 2dfc8e7..a7c5c1c 100755 --- a/TelegramTizen/res/po/es_US.po +++ b/TelegramTizen/res/po/es_US.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "La aplicación de mensajes %1$smás rápida%2$s del mundo\nEs %3$sgratis%4$s y %5$ssegura%6$s." @@ -374,7 +377,7 @@ msgid "IDS_TGRAM_OPT_SAVE" msgstr "Guardar" msgid "IDS_TGRAM_HEADER_SLIDE_TO_CANCEL_ABB" -msgstr "Desliza cancelar" +msgstr "Deslizar cancela" msgid "IDS_TGRAM_HEADER_SETTINGS_ABB4" msgstr "Ajustes" diff --git a/TelegramTizen/res/po/fa.po b/TelegramTizen/res/po/fa.po index c06cd34..c91d130 100755 --- a/TelegramTizen/res/po/fa.po +++ b/TelegramTizen/res/po/fa.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "ابپتثجچحخدذرزژسشصضطظعغفقکگلمنوهی" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "%1$sسریع‌ترین%2$s برنامه پیام‌رسانی جهانی\nاین برنامه %3$sرایگان%4$s و %5$sایمن%6$s است." @@ -463,3 +466,18 @@ msgstr "رفع انسداد" msgid "IDS_TGRAM_OPT_SHARE" msgstr "اشتراک" +msgid "IDS_TGRAM_HEADER_LOG_OUT" +msgstr "خروج از سیستم" + +msgid "IDS_TGRAM_BODY_ENCRYPTED_FROM_END_TO_END_M_NOUN" +msgstr "رمزگذاری دو سویه" + +msgid "IDS_TGRAM_BODY_NOT_SAVED_ANYWHERE_M_NOUN" +msgstr "هیچ جا ذخیره نشده است" + +msgid "IDS_TGRAM_BODY_AUTOMATICALLY_DELETED_AFTER_A_PRESET_TIME_M_NOUN" +msgstr "پس از گذشت زمان پیش‌تنظیم، به طور خودکار حذف شد" + +msgid "IDS_TGRAM_BODY_CANNOT_BE_FORWARDED_M_NOUN" +msgstr "هدایت ممکن نیست" + diff --git a/TelegramTizen/res/po/fr.po b/TelegramTizen/res/po/fr.po index 3cb09e9..06b1c8c 100755 --- a/TelegramTizen/res/po/fr.po +++ b/TelegramTizen/res/po/fr.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "L'application de messagerie %1$sla plus rapide%2$s au monde\nElle est %3$sgratuite%4$s et %5$ssécurisée%6$s." diff --git a/TelegramTizen/res/po/gu.po b/TelegramTizen/res/po/gu.po index dd05c46..beda9b2 100755 --- a/TelegramTizen/res/po/gu.po +++ b/TelegramTizen/res/po/gu.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "અઆઇઈઉઊૠએઍઐઓઑઔકખગઘચછજઝટઠડઢણતથદધનપફબભમયરલવશષસહABCDEFGHIJKLMNOPQRSTUVWXYZ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "વિશ્વની %1$sસૌથી વધુ ઝડપી%2$s મેસેજિંગ એપ\nતે %3$sમફત%4$s છે અને %5$sસુરક્ષિત%6$s છે." @@ -463,3 +466,18 @@ msgstr "અનાવરોધિત કરો" msgid "IDS_TGRAM_OPT_SHARE" msgstr "શેર કરો" +msgid "IDS_TGRAM_HEADER_LOG_OUT" +msgstr "લોગ આઉટ કરો" + +msgid "IDS_TGRAM_BODY_ENCRYPTED_FROM_END_TO_END_M_NOUN" +msgstr "સમાપ્તિથી સુધી સમાપ્તિ સુધી એન્ક્રિપ્ટ કરેલ" + +msgid "IDS_TGRAM_BODY_NOT_SAVED_ANYWHERE_M_NOUN" +msgstr "ક્યાંય પણ સાચવેલ નથી" + +msgid "IDS_TGRAM_BODY_AUTOMATICALLY_DELETED_AFTER_A_PRESET_TIME_M_NOUN" +msgstr "પ્રીસેટ સમય પછી સ્વચાલિત રીતે હટાવવામાં આવ્યું" + +msgid "IDS_TGRAM_BODY_CANNOT_BE_FORWARDED_M_NOUN" +msgstr "ફોર્વર્ડ કરી શકાતું નથી" + diff --git a/TelegramTizen/res/po/hi.po b/TelegramTizen/res/po/hi.po index 9a9c527..a4bf2e1 100755 --- a/TelegramTizen/res/po/hi.po +++ b/TelegramTizen/res/po/hi.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "अआइईउऊएऐओऔकखगघङचछजझञटठडढणतथदधनपफबभमयरलवशषसहABCDEFGHIJKLMNOPQRSTUVWXYZ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "विश्व का %1$sसबसे तेज%2$s सन्देश सेवा एप है\nयह %3$sनिःशुल्क%4$s और %5$sसुरक्षित%6$s है।" diff --git a/TelegramTizen/res/po/hy.po b/TelegramTizen/res/po/hy.po index 6d75388..79a69d7 100755 --- a/TelegramTizen/res/po/hy.po +++ b/TelegramTizen/res/po/hy.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "#ԱԲԳԴԵԶԷԸԹԺԻԼԽԾԿՀՁՂՃՄՅՆՇՈՉՊՋՌՍՎՏՐՑՈՒՓՔԵՎՕՖ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "Աշխարհի %1$sամենաարագ%2$s հաղորդագրման ծրագիրը\nԱյն %3$sանվճար%4$s և %5$sապահով%6$s է:" diff --git a/TelegramTizen/res/po/id.po b/TelegramTizen/res/po/id.po index d993e09..5dd81f2 100755 --- a/TelegramTizen/res/po/id.po +++ b/TelegramTizen/res/po/id.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "Aplikasi pesan %1$stercepat%2$s di dunia\nIni %3$sgratis%4$s dan %5$saman%6$s." @@ -463,3 +466,18 @@ msgstr "Buka blokir" msgid "IDS_TGRAM_OPT_SHARE" msgstr "Bagi" +msgid "IDS_TGRAM_HEADER_LOG_OUT" +msgstr "Keluar" + +msgid "IDS_TGRAM_BODY_ENCRYPTED_FROM_END_TO_END_M_NOUN" +msgstr "Dienkripsi dari ujung ke ujung" + +msgid "IDS_TGRAM_BODY_NOT_SAVED_ANYWHERE_M_NOUN" +msgstr "Tidak disimpan" + +msgid "IDS_TGRAM_BODY_AUTOMATICALLY_DELETED_AFTER_A_PRESET_TIME_M_NOUN" +msgstr "Otomatis dihapus setelah waktu yang prasetel" + +msgid "IDS_TGRAM_BODY_CANNOT_BE_FORWARDED_M_NOUN" +msgstr "Tidak dapat diteruskan" + diff --git a/TelegramTizen/res/po/it_IT.po b/TelegramTizen/res/po/it_IT.po index 3f2f90d..a2cdab1 100755 --- a/TelegramTizen/res/po/it_IT.po +++ b/TelegramTizen/res/po/it_IT.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "L'applicazione di messaggistica %1$spiù veloce%2$s al mondo\nÈ %3$sgratuita%4$s e %5$ssicura%6$s." diff --git a/TelegramTizen/res/po/ka.po b/TelegramTizen/res/po/ka.po new file mode 100755 index 0000000..1bf4db8 --- /dev/null +++ b/TelegramTizen/res/po/ka.po @@ -0,0 +1,483 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰ" + +msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" +msgstr "მსოფლიოს %1$sუსწრაფესი%2$s შეტყობინებების აპლიკაცია\n%3$sუფასო%4$s და %5$sუსაფრთხოა%6$s." + +msgid "IDS_TGRAM_HEADER_TELEGRAM" +msgstr "Telegram" + +msgid "IDS_TGRAM_HEADER_FAST" +msgstr "ჩქარი" + +msgid "IDS_TGRAM_HEADER_FREE" +msgstr "უფასო" + +msgid "IDS_TGRAM_ACBUTTON_START_MESSAGING" +msgstr "შეტყობინებების დაწყება" + +msgid "IDS_TGRAM_BUTTON_NEXT_ABB5" +msgstr "შემდეგი" + +msgid "IDS_TGRAM_BUTTON_PREVIOUS_ABB4" +msgstr "წინა" + +msgid "IDS_TGRAM_BUTTON_NEXT_ABB6" +msgstr "შემდეგი" + +msgid "IDS_TGRAM_SBODY_P1SSTELEGRAMP2SS_DELIVERS_MESSAGES_NFASTER_THAN_ANY_OTHER_APP" +msgstr "%1$sTelegram%2$s-ს უფრო სწრაფად მიაქვს შეტყობინებები,\nვიდრე სხვა აპლიკაციას." + +msgid "IDS_TGRAM_SBODY_P1SSTELEGRAMP2SS_IS_FREE_FOREVER_N_NNO_ADS_NO_SUBSCRIPTION_FEES" +msgstr "%1$sTelegram%2$s მუდამ უფასოა.\n\nრეკლამები არ არის. გამოწერა უფასოა." + +msgid "IDS_TGRAM_SBODY_P1SSTELEGRAMP2SS_KEEPS_YOUR_MESSAGES_NSAFE_FROM_HACKERS" +msgstr "%1$sTelegram%2$s ჰაკერებისგან უსაფრთხოდ\nინახავს თქვენს შეტყობინებებს." + +msgid "IDS_TGRAM_SBODY_P1SSTELEGRAMP2SS_HAS_NO_LIMITS_ON_THE_SIZE_OF_NCHATS_AND_MEDIA_YOU_CAN_SHARE" +msgstr "%1$sTelegram%2$s-ს არ აქვს შეზღუდვა\nთქვენ მიერ გაზიარებულ საუბრებსა და მედიაზე." + +msgid "IDS_TGRAM_SBODY_P1SSTELEGRAMP2SS_ALLOWS_YOU_TO_ACCESS_NYOUR_MESSAGES_FROM_MULTIPLE_DEVICES" +msgstr "%1$sTelegram%2$s საშუალებას გაძლევთ, გახსნათ\nთქვენი შეტყობინებები რამდენიმე მოწყობილობიდან." + +msgid "IDS_TGRAM_SBODY_P1SSTELEGRAMP2SS_MESSAGES_ARE_STRONGLY_ENCRYPTED_NAND_CAN_BE_DELETED_AUTOMATICALLY" +msgstr "%1$sTelegram%2$s შეტყობინებები მკაცრადაა დაშიფრული\nდა ავტომატურად შეიძლება მათი წაშლა." + +msgid "IDS_TGRAM_HEADER_SECURE" +msgstr "დაცული" + +msgid "IDS_TGRAM_HEADER_POWERFUL" +msgstr "ძლიერი" + +msgid "IDS_TGRAM_HEADER_CLOUD_BASED_ABB" +msgstr "ონლაინ-საცავზე დამყარებული" + +msgid "IDS_TGRAM_HEADER_PRIVATE" +msgstr "პერსონალური" + +msgid "IDS_TGRAM_BUTTON_PREVIOUS" +msgstr "წინა" + +msgid "IDS_TGRAM_ACBUTTON_CANCEL_ABB" +msgstr "გაუქმება" + +msgid "IDS_TGRAM_ACBUTTON_DONE_ABB" +msgstr "მზადაა" + +msgid "IDS_TGRAM_HEADER_ENTER_NUMBER_ABB" +msgstr "ნომერი" + +msgid "IDS_TGRAM_HEADER_ENTER_CODE_ABB" +msgstr "ჩაწერეთ კოდი" + +msgid "IDS_TGRAM_HEADER_ENTER_NAME_ABB2" +msgstr "სახელი" + +msgid "IDS_TGRAM_BODY_CONFIRM_YOUR_COUNTRY_CODE_MSG" +msgstr "დაადასტურეთ დამცავი კოდი და შეიყვანეთ თქვენი ტელეფონის ნომერი." + +msgid "IDS_TGRAM_BODY_A_VERIFICATION_CODE_HAS_BEEN_SENT_MSG" +msgstr "დადასტურების კოდი გაიგზავნა. გახსენით შეტყობინებები და შეიყვანეთ დადასტურების კოდი." + +msgid "IDS_TGRAM_BODY_TELEGRAM_WILL_CALL_IN_P1SD_CP2SD" +msgstr "Telegram დარეკავს %1$d:%2$d საათზე." + +msgid "IDS_TGRAM_BODY_ENTER_YOUR_FIRST_AND_LAST_NAME_ABB" +msgstr "შეიყვანეთ თქვენი სახელი გვარი." + +msgid "IDS_TGRAM_BODY_FIRST_NAME_HREQUIRED_ABB" +msgstr "სახელი (მოითხოვება)" + +msgid "IDS_TGRAM_BODY_LAST_NAME_HREQUIRED_ABB" +msgstr "გვარი (მოითხოვება)" + +msgid "IDS_TGRAM_BODY_CODE" +msgstr "კოდი" + +msgid "IDS_TGRAM_BODY_PHONE_NUMBER_ABB" +msgstr "ტელეფონის ნომერი" + +msgid "IDS_TGRAM_HEADER_CONTACTS_ABB" +msgstr "კონტაქტები" + +msgid "IDS_TGRAM_NPBODY_SEARCH" +msgstr "ძებნა" + +msgid "IDS_TGRAM_MBODY_INVITE_FRIENDS" +msgstr "მოიწვიეთ მეგობრები" + +msgid "IDS_TGRAM_MBODY_SECRET_CHAT" +msgstr "აირჩიეთ საუბარი" + +msgid "IDS_TGRAM_TMBODY_SELECT_CONTACTS_ABB" +msgstr "აირჩიეთ კონტაქტები" + +msgid "IDS_TGRAM_MBODY_GROUP_CHAT" +msgstr "ჯგუფური საუბარი" + +msgid "IDS_TGRAM_MBODY_SELECT_ALL" +msgstr "ყველას არჩევა" + +msgid "IDS_TGRAM_HEADER_CREATE_GROUP_ABB" +msgstr "ჯგუფის შექმნა" + +msgid "IDS_TGRAM_NPBODY_NEW_GROUP_NAME_ABB" +msgstr "ახალი ჯგუფის სახელი" + +msgid "IDS_TGRAM_BUTTON_PD_SELECTED_ABB" +msgstr "არჩეულია %d" + +msgid "IDS_TGRAM_SBODY_LAST_SEEN_PD_MINUTES_AGO_ABB" +msgstr "ბოლოს ნანახია %d წუთის წინ" + +msgid "IDS_TGRAM_SBODY_LAST_SEEN_1_HOUR_AGO_ABB" +msgstr "ბოლოს ნანახია 1 საათის წინ" + +msgid "IDS_TGRAM_SBODY_LAST_SEEN_PD_HOURS_AGO_ABB" +msgstr "ბოლოს ნანახია %d საათის წინ" + +msgid "IDS_TGRAM_SBODY_LAST_SEEN_WITHIN_WEEK_ABB" +msgstr "ბოლოს ნანახია გასულ კვირაში" + +msgid "IDS_TGRAM_SBODY_LAST_SEEN_WITHIN_MONTH_ABB" +msgstr "ბოლოს ნანახია გასულ თვეში" + +msgid "IDS_TGRAM_SBODY_ONLINE" +msgstr "ინტერნეტში" + +msgid "IDS_TGRAM_SBODY_LAST_SEEN_RECENTLY_ABB" +msgstr "ბოლოს ნანახია ცოტა ხნის წინ" + +msgid "IDS_TGRAM_SBODY_LAST_SEEN_LONG_TIME_AGO_ABB" +msgstr "ბოლოს ნანახია დიდი ხნის წინ" + +msgid "IDS_TGRAM_SBODY_LAST_SEEN_1_MINUTE_AGO_ABB" +msgstr "ბოლოს ნანახია 1 წუთის წინ" + +msgid "IDS_TGRAM_ACBUTTON_SEND_ABB3" +msgstr "გგზ." + +msgid "IDS_TGRAM_BODY_P1SD_P2SD" +msgstr "%1$d/%2$d" + +msgid "IDS_TGRAM_HEADER_COMPOSE_MESSAGE_ABB2" +msgstr "შეტყობინების შედგენა" + +msgid "IDS_TGRAM_HEADER_CREATE_CONTACT_ABB" +msgstr "კონტაქტის შექმნა" + +msgid "IDS_TGRAM_BODY_NAME_ABB" +msgstr "სახელი" + +msgid "IDS_TGRAM_BODY_FIRST_NAME_ABB" +msgstr "სახელი" + +msgid "IDS_TGRAM_BODY_LAST_NAME_ABB" +msgstr "გვარი" + +msgid "IDS_TGRAM_BODY_MOBILE_ABB" +msgstr "მობილური" + +msgid "IDS_TGRAM_OPT_PHONE_NUMBER_ABB" +msgstr "ტელეფონის ნომერი" + +msgid "IDS_TGRAM_OPT_MOBILE" +msgstr "მობილური" + +msgid "IDS_TGRAM_OPT_HOME" +msgstr "სახლი" + +msgid "IDS_TGRAM_OPT_WORK" +msgstr "სამსახური" + +msgid "IDS_TGRAM_OPT_FAX_HHOME" +msgstr "ფაქსი (სახლის)" + +msgid "IDS_TGRAM_OPT_FAX_HWORK" +msgstr "ფაქსი (სამსახურის)" + +msgid "IDS_TGRAM_OPT_FAX_HOTHER_ABB" +msgstr "ფაქსი (სხვა)" + +msgid "IDS_TGRAM_OPT_PAGER" +msgstr "პეიჯერი" + +msgid "IDS_TGRAM_OPT_OTHER" +msgstr "სხვა" + +msgid "IDS_TGRAM_OPT_SEARCH" +msgstr "ძებნა" + +msgid "IDS_TGRAM_OPT_CONTACTS" +msgstr "კონტაქტები" + +msgid "IDS_TGRAM_OPT_SETTINGS" +msgstr "პარამეტრები" + +msgid "IDS_TGRAM_NPBODY_NO_CHATS" +msgstr "საუბრები არაა" + +msgid "IDS_TGRAM_BODY_TO_START_A_NEW_CONVERSATION_TAP_THE_CREATE_NEW_GROUP_BUTTON_IN_THE_BOTTOM_RIGHT_OR_PRESS_THE_MENU_KEY_FOR_MORE_OPTIONS" +msgstr "ახალი საუბრის დასაწყებად, შეეხეთ ახალი ჯგუფის შექმნის ღილაკს ქვედა მარჯვენა კუთხეში, ან დააჭირეთ მენიუს ღილაკს სხვა ვარიანტებისთვის." + +msgid "IDS_TGRAM_HEADER_SEARCH" +msgstr "ძებნა" + +msgid "IDS_TGRAM_NPBODY_NO_RESULTS_FOUND_ABB" +msgstr "შედეგები არ მოიძებნა" + +msgid "IDS_TGRAM_HEADER_SELECT_CHAT_ABB" +msgstr "აირჩიე საუბარი" + +msgid "IDS_TGRAM_HEADER_SELECT_CHATS_ABB" +msgstr "აირჩიე საუბრები" + +msgid "IDS_TGRAM_HEADER_LAST_SEEN_RECENTLY_ABB" +msgstr "ბოლოს ნანახია ცოტა ხნის წინ" + +msgid "IDS_TGRAM_HEADER_LAST_SEEN_LONG_TIME_AGO_ABB" +msgstr "ბოლოს ნანახია დიდი ხნის წინ" + +msgid "IDS_TGRAM_HEADER_LAST_SEEN_1_MINUTE_AGO_ABB" +msgstr "ბოლოს ნანახია 1 წუთის წინ" + +msgid "IDS_TGRAM_HEADER_LAST_SEEN_PD_MINUTES_AGO_ABB" +msgstr "ბოლოს ნანახია %d წუთის წინ" + +msgid "IDS_TGRAM_HEADER_LAST_SEEN_1_HOUR_AGO_ABB" +msgstr "ბოლოს ნანახია 1 საათის წინ" + +msgid "IDS_TGRAM_HEADER_LAST_SEEN_PD_HOURS_AGO_ABB" +msgstr "ბოლოს ნანახია %d საათის წინ" + +msgid "IDS_TGRAM_HEADER_LAST_SEEN_WITHIN_A_WEEK_ABB" +msgstr "ბოლოს ნანახია გასულ კვირაში" + +msgid "IDS_TGRAM_HEADER_LAST_SEEN_WITHIN_A_MONTH_ABB" +msgstr "ბოლოს ნანახია გასულ თვეში" + +msgid "IDS_TGRAM_OPT_VIEW_PROFILE_ABB" +msgstr "პროფილის ნახვა" + +msgid "IDS_TGRAM_OPT_DELETE" +msgstr "წაშლა" + +msgid "IDS_TGRAM_OPT_NOTIFICATION_SETTINGS_ABB" +msgstr "შეტყობინების პარამეტრები" + +msgid "IDS_TGRAM_BODY_NO_MESSAGES_HERE_YET_ING" +msgstr "აქ ჯერ არ არის შეტყობინებები..." + +msgid "IDS_TGRAM_BODY_PD_PARTICIPANTS" +msgstr "%d მონაწილე" + +msgid "IDS_TGRAM_BODY_P1SS_P2SS" +msgstr "%1$s %2$s" + +msgid "IDS_TGRAM_BODY_YOU_HAVE_CREATED_THIS_GROUP_CHAT" +msgstr "თქვენ შექმენით ეს ჯგუფური საუბარი." + +msgid "IDS_TGRAM_OPT_LEAVE_GROUP_CHAT_ABB" +msgstr "ჯგუფური საუბრიდან გასვლა" + +msgid "IDS_TGRAM_BODY_PS_HAS_LEFT_THE_GROUP_CHAT_ABB" +msgstr "%s გავიდა ჯგუფური საუბარიდან." + +msgid "IDS_TGRAM_HEADER_PS_CREATED_THIS_GROUP_CHAT_ABB" +msgstr "%s არის ამ ჯგუფური საუბრის შემქმნელი." + +msgid "IDS_TGRAM_HEADER_LEAVE_GROUP_CHAT_ABB2" +msgstr "ჯგუფური საუბრიდან გასვლა" + +msgid "IDS_TGRAM_POP_YOU_WILL_LEAVE_THIS_GROUP" +msgstr "თქვენ გახვალთ ამ ჯგუფიდან." + +msgid "IDS_TGRAM_BUTTON_CANCEL_ABB5" +msgstr "გაუქმება" + +msgid "IDS_TGRAM_BUTTON_LEAVE_ABB2" +msgstr "დატოვება" + +msgid "IDS_TGRAM_OPT_ADD_TO_TELEGRAM" +msgstr "Telegram-ში დამატება" + +msgid "IDS_TGRAM_SBODY_UNKNOWN" +msgstr "უცნობი" + +msgid "IDS_TGRAM_HEADER_DELETE" +msgstr "წაშლა" + +msgid "IDS_TGRAM_POP_PS_WILL_BE_REMOVED_FROM_YOUR_CONTACT_LIST_IN_TELEGRAM" +msgstr "%s წაიშლება თქვენს Telegram კონტაქტებში." + +msgid "IDS_TGRAM_OPT_COPY_TEXT" +msgstr "ტექსტის კოპირება" + +msgid "IDS_TGRAM_OPT_FORWARD" +msgstr "გადაგზავნა" + +msgid "IDS_TGRAM_OPT_FORWARD_VIA_TELEGRAM_ABB" +msgstr "გადაგზავნა Telegram-ით" + +msgid "IDS_TGRAM_OPT_REPLY" +msgstr "პასუხი" + +msgid "IDS_TGRAM_POP_THIS_MESSAGE_WILL_BE_DELETED" +msgstr "ეს წერილი წაიშლება." + +msgid "IDS_TGRAM_OPT_PROFILE_DETAILS_ABB" +msgstr "პროფილის დეტალები" + +msgid "IDS_TGRAM_HEADER_SELECT_ITEMS_ABB3" +msgstr "აირჩიე ელემენტ." + +msgid "IDS_TGRAM_ACBUTTON_DELETE_ABB2" +msgstr "წაშლა" + +msgid "IDS_TGRAM_OPT_ENABLE" +msgstr "ჩართვა" + +msgid "IDS_TGRAM_OPT_MUTE_FOR_1_HOUR_ABB" +msgstr "ხმა გამოირთოს 1 საათით" + +msgid "IDS_TGRAM_OPT_MUTE_FOR_PD_HOURS_ABB" +msgstr "ხმა გამოირთოს %d საათით" + +msgid "IDS_TGRAM_OPT_MUTE_FOR_PD_DAYS_ABB" +msgstr "ხმა გამოირთოს %d დღით" + +msgid "IDS_TGRAM_OPT_DISABLE" +msgstr "გამორთვა" + +msgid "IDS_TGRAM_HEADER_SHARE_CONTACT_DETAILS_ABB" +msgstr "საკონტაქტო ინფოს გაზიარება" + +msgid "IDS_TGRAM_POP_P1SSS_CONTACT_DETAILS_WILL_BE_SHARED_WITH_P2SS" +msgstr "%1$s-ის საკონტაქტო დეტალები გაზიარდება %2$s-თან." + +msgid "IDS_TGRAM_BUTTON_SHARE_ABB2" +msgstr "გაზიარება" + +msgid "IDS_TGRAM_OPT_ADD_TO_CONTACTS_ABB2" +msgstr "კონტაქტებში დამატება" + +msgid "IDS_TGRAM_OPT_CALL" +msgstr "ზარი" + +msgid "IDS_TGRAM_OPT_COMPOSE_MESSAGE_ABB" +msgstr "შეადგინეთ შეტყობინება" + +msgid "IDS_TGRAM_OPT_CREATE_CONTACT_ABB" +msgstr "ახალი კონტაქტი" + +msgid "IDS_TGRAM_OPT_UPDATE_CONTACT_ABB2" +msgstr "კონტაქტის განახლება" + +msgid "IDS_TGRAM_OPT_SAVE" +msgstr "შენახვა" + +msgid "IDS_TGRAM_HEADER_SLIDE_TO_CANCEL_ABB" +msgstr "გადასმით გაუქმ." + +msgid "IDS_TGRAM_HEADER_SETTINGS_ABB4" +msgstr "პარამეტრები" + +msgid "IDS_TGRAM_OPT_SOUNDS_AND_NOTIFICATIONS_ABB" +msgstr "ხმები და შეტყობინებები" + +msgid "IDS_TGRAM_OPT_PRIVACY_AND_SECURITY_ABB" +msgstr "კონფიდენციალურობა და უსაფრთხოება" + +msgid "IDS_TGRAM_OPT_SET_BACKGROUND_IMAGE_ABB" +msgstr "სურათის დაყენება ფონზე" + +msgid "IDS_TGRAM_OPT_SET_PROFILE_PICTURE_ABB" +msgstr "პროფილის სურათის დაყენება" + +msgid "IDS_TGRAM_OPT_EDIT_NAME" +msgstr "სახელის რედაქტირება" + +msgid "IDS_TGRAM_OPT_LOG_OUT" +msgstr "გამოსვლა" + +msgid "IDS_TGRAM_OPT_FROM_GALLERY_ABB2" +msgstr "გალერეიდან" + +msgid "IDS_TGRAM_OPT_TAKE_PICTURE_ABB" +msgstr "სურათის გადაღება" + +msgid "IDS_TGRAM_HEADER_SELECT_IMAGE_ABB2" +msgstr "სურათის არჩევა" + +msgid "IDS_TGRAM_POP_USE_TELEGRAM_SEAMLESSLY_ACROSS_ANY_NUMBER_OF_DEVICES_MSG" +msgstr "შეუფერხებლად გამოიყენეთ Telegram ერთდროულად, ნებისმიერი რაოდენობის მოწყობილობაში. ამასთან, საიდუმლო საუბრები გაქრება, როდესაც გახვალთ." + +msgid "IDS_TGRAM_BUTTON_LOG_OUT_ABB2" +msgstr "გამოსვლა" + +msgid "IDS_TGRAM_BODY_YOU_HAVE_INVITED_PS_TO_A_SECRET_CHAT" +msgstr "თქვენ %s მოიწვიეთ საიდუმლო საუბარში." + +msgid "IDS_TGRAM_BODY_SECRET_CHAT_CONTENT_C" +msgstr "საიდუმლო საუბრის შიგთავსი:" + +msgid "IDS_TGRAM_HEADER_SET_AUTO_DELETE_TIME_ABB" +msgstr "ავტომატური წაშლის დაყენება" + +msgid "IDS_TGRAM_OPT_VIEW_CONTACT_DETAILS_ABB" +msgstr "იხილეთ საკონტაქტო მონაცემები" + +msgid "IDS_TGRAM_OPT_SET_AUTO_DELETE_TIME_ABB" +msgstr "ავტომატური წაშლის დროის დაყენება" + +msgid "IDS_TGRAM_OPT_CLEAR_HISTORY_ABB3" +msgstr "ისტორიის წაშლა" + +msgid "IDS_TGRAM_OPT_LEAVE_CHAT" +msgstr "საუბრიდან გასვლა" + +msgid "IDS_TGRAM_OPT_EDIT" +msgstr "რედაქტირება" + +msgid "IDS_TGRAM_OPT_ADD_TO_CONTACTS_ABB3" +msgstr "კონტაქტებში დამატება" + +msgid "IDS_TGRAM_OPT_START_SECRET_CHAT_ABB" +msgstr "საიდუმლო საუბრის დაწყება" + +msgid "IDS_TGRAM_OPT_BLOCK" +msgstr "დაბლოკვა" + +msgid "IDS_TGRAM_OPT_UNBLOCK" +msgstr "განბლოკვა" + +msgid "IDS_TGRAM_HEADER_BLOCK" +msgstr "დაბლოკვა" + +msgid "IDS_TGRAM_POP_PS_WILL_BE_BLOCKED" +msgstr "%s დაიბლოკება." + +msgid "IDS_TGRAM_POP_PS_WILL_BE_UNBLOCKED" +msgstr "%s განიბლოკება." + +msgid "IDS_TGRAM_HEADER_UNBLOCK" +msgstr "განბლოკვა" + +msgid "IDS_TGRAM_OPT_SHARE" +msgstr "გაზიარება" + +msgid "IDS_TGRAM_HEADER_LOG_OUT" +msgstr "გამოსვლა" + +msgid "IDS_TGRAM_BODY_ENCRYPTED_FROM_END_TO_END_M_NOUN" +msgstr "დაშიფრულია ერთი ბოლოდან მეორე ბოლომდე" + +msgid "IDS_TGRAM_BODY_NOT_SAVED_ANYWHERE_M_NOUN" +msgstr "არსად შეინახა" + +msgid "IDS_TGRAM_BODY_AUTOMATICALLY_DELETED_AFTER_A_PRESET_TIME_M_NOUN" +msgstr "ავტომატურად წაიშალა წინასწარ დაყენებული დროის შემდეგ" + +msgid "IDS_TGRAM_BODY_CANNOT_BE_FORWARDED_M_NOUN" +msgstr "ვერ გადამისამართდება" + diff --git a/TelegramTizen/res/po/kk.po b/TelegramTizen/res/po/kk.po index 3df054e..515fdab 100755 --- a/TelegramTizen/res/po/kk.po +++ b/TelegramTizen/res/po/kk.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "АӘБВГҒДЕЁЖЗИЙКҚЛМНҢОӨПРСТУҰҮФХҺЦЧШЩЪЫІЬЭЮЯ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "Әлемнің %1$sең жылдам%2$s хабар алмасу қолданбасы\nБұл %3$sтегін%4$s және %5$sқауіпсіз%6$s." diff --git a/TelegramTizen/res/po/km.po b/TelegramTizen/res/po/km.po index 3e9f004..bab45f8 100755 --- a/TelegramTizen/res/po/km.po +++ b/TelegramTizen/res/po/km.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "កខគឃងចឆជឈញដឋឌឍណតថទធនបផពភមយរលវសហឡអABCDEFGHIJKLMNOPQRSTUVWXYZ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "កម្មវិធី​សារ%1$sលឿន​បំផុត%2$s របស់​ពិភពលោក\nវា​គឺ %3$sឥតគិតថ្លៃ%4$s និង %5$sមាន​សន្តិសុខ%6$s។" @@ -463,3 +466,18 @@ msgstr "ឈប់ខ្ទប់" msgid "IDS_TGRAM_OPT_SHARE" msgstr "ចែករំលែក" +msgid "IDS_TGRAM_HEADER_LOG_OUT" +msgstr "ចុះឈ្មោះចេញ" + +msgid "IDS_TGRAM_BODY_ENCRYPTED_FROM_END_TO_END_M_NOUN" +msgstr "បាន​អ៊ិនគ្រីប​ពី​ចុង​ទៅ​ចុង" + +msgid "IDS_TGRAM_BODY_NOT_SAVED_ANYWHERE_M_NOUN" +msgstr "មិន​បាន​រក្សាទុក​នៅ​កន្លែង​ណា​មួយ" + +msgid "IDS_TGRAM_BODY_AUTOMATICALLY_DELETED_AFTER_A_PRESET_TIME_M_NOUN" +msgstr "បាន​លុប​ដោយ​ស្វ័យប្រវត្តិ​បន្ទាប់​ពី​ម៉ោង​បុរេកំណត់" + +msgid "IDS_TGRAM_BODY_CANNOT_BE_FORWARDED_M_NOUN" +msgstr "មិន​អាច​បញ្ជូនបន្ត" + diff --git a/TelegramTizen/res/po/kn.po b/TelegramTizen/res/po/kn.po index e285906..b978e30 100755 --- a/TelegramTizen/res/po/kn.po +++ b/TelegramTizen/res/po/kn.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "ಅಆಇಈಉಊಋಎಏಐಒಓಔಅಕಖಗಘಙಚಛಜಝಞಟಠಡಢಣತಥದಧನಪಫಬಭಮಯರಲವಶಷಸಹಳABCDEFGHIJKLMNOPQRSTUVWXYZ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "ಜಗತ್ತಿನ %1$sಅತಿವೇಗದ%2$s ಮೆಸೇಜಿಂಗ್ ಅನ್ವಯಿಸುವಿಕೆ\nಇದು %3$sಉಚಿತವಾಗಿದೆ%4$s ಮತ್ತು %5$sಸುರಕ್ಷಿತವಾಗಿದೆ%6$s." @@ -463,3 +466,18 @@ msgstr "ಅನಿರ್ಬಂಧಿಸು" msgid "IDS_TGRAM_OPT_SHARE" msgstr "ಹಂಚಿಕೊಳ್ಳಿ" +msgid "IDS_TGRAM_HEADER_LOG_OUT" +msgstr "ಲಾಗ್ ಔಟ್" + +msgid "IDS_TGRAM_BODY_ENCRYPTED_FROM_END_TO_END_M_NOUN" +msgstr "ಅಂತ್ಯದಿಂದ ಅಂತ್ಯಕ್ಕೆ ಎನ್‌ಕ್ರಿಪ್ಟ್ ಮಾಡಲಾಗಿದೆ" + +msgid "IDS_TGRAM_BODY_NOT_SAVED_ANYWHERE_M_NOUN" +msgstr "ಎಲ್ಲಿಯೂ ಉಳಿಸಲಾಗಿಲ್ಲ" + +msgid "IDS_TGRAM_BODY_AUTOMATICALLY_DELETED_AFTER_A_PRESET_TIME_M_NOUN" +msgstr "ಪ್ರೀಸೆಟ್ ಸಮಯದ ನಂತರ ಸ್ವಯಂಚಾಲಿತವಾಗಿ ಅಳಿಸಲಾಗಿದೆ" + +msgid "IDS_TGRAM_BODY_CANNOT_BE_FORWARDED_M_NOUN" +msgstr "ಫಾರ್ವರ್ಡ್ ಮಾಡಲಾಗುವುದಿಲ್ಲ" + diff --git a/TelegramTizen/res/po/ko_KR.po b/TelegramTizen/res/po/ko_KR.po index ff8d3c4..d57475b 100755 --- a/TelegramTizen/res/po/ko_KR.po +++ b/TelegramTizen/res/po/ko_KR.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "ㄱㄴㄷㄹㅁㅂㅅㅇㅈㅊㅋㅌㅍㅎ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "세상에서 %1$s가장 빠른%2$s메시지 앱\n%3$s무료%4$s이며 %5$s안전%6$s합니다." diff --git a/TelegramTizen/res/po/ky_KG.po b/TelegramTizen/res/po/ky_KG.po index 01771dd..c9c406d 100755 --- a/TelegramTizen/res/po/ky_KG.po +++ b/TelegramTizen/res/po/ky_KG.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "АБВГДЕЁЖЗИЙКЛМНҢОӨПРСТУҮФХЦЧШЩЬЫЪЭЮЯ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "Дүйнөнүн %1$sэң тез%2$s билдирүү алмашуу колдонмосу\nАл %3$sакысыз%4$s жана %5$sкоопсуз%6$s." @@ -463,3 +466,18 @@ msgstr "Кулпудан чечүү" msgid "IDS_TGRAM_OPT_SHARE" msgstr "Бөлүшүү" +msgid "IDS_TGRAM_HEADER_LOG_OUT" +msgstr "Чыгуу" + +msgid "IDS_TGRAM_BODY_ENCRYPTED_FROM_END_TO_END_M_NOUN" +msgstr "Бир башынан экинчи башына чейин шифрленген" + +msgid "IDS_TGRAM_BODY_NOT_SAVED_ANYWHERE_M_NOUN" +msgstr "Эч жерде сакталган жок" + +msgid "IDS_TGRAM_BODY_AUTOMATICALLY_DELETED_AFTER_A_PRESET_TIME_M_NOUN" +msgstr "Алдын ала коюлган убакыттан кийин автоматтык түрдө өчүрүлдү" + +msgid "IDS_TGRAM_BODY_CANNOT_BE_FORWARDED_M_NOUN" +msgstr "Которууга болбойт" + diff --git a/TelegramTizen/res/po/lo.po b/TelegramTizen/res/po/lo.po index 363199f..9a2b006 100755 --- a/TelegramTizen/res/po/lo.po +++ b/TelegramTizen/res/po/lo.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "ແອັບການສົ່ງຂໍ້ຄວາມ %1$sໄວທີ່ສຸດ%2$s ຂອງໂລກ\nມັນ %3$sຟຣີ%4$s ແລະ %5$sປອດໄພ%6$s." @@ -463,3 +466,18 @@ msgstr "ປົດການບລັອກ" msgid "IDS_TGRAM_OPT_SHARE" msgstr "ແຊຣ໌" +msgid "IDS_TGRAM_HEADER_LOG_OUT" +msgstr "ອອກຈາກລະບົບ" + +msgid "IDS_TGRAM_BODY_ENCRYPTED_FROM_END_TO_END_M_NOUN" +msgstr "ໃສ່ລະຫັດແລ້ວຕັ້ງແຕ່ຕົ້ນຈົນຈົບ" + +msgid "IDS_TGRAM_BODY_NOT_SAVED_ANYWHERE_M_NOUN" +msgstr "ບໍ່ໄດ້ບັນທຶກຢູ່ບ່ອນໃດເລີຍ" + +msgid "IDS_TGRAM_BODY_AUTOMATICALLY_DELETED_AFTER_A_PRESET_TIME_M_NOUN" +msgstr "ໄດ້ລຶບຢ່າງອັດຕະໂນມັດຫຼັງຈາກເວລາທີ່ຕັ້ງຄ່າມາກ່ອນ" + +msgid "IDS_TGRAM_BODY_CANNOT_BE_FORWARDED_M_NOUN" +msgstr "ບໍ່ສາມາດຖືກສົ່ງຕໍ່ໄດ້" + diff --git a/TelegramTizen/res/po/ml.po b/TelegramTizen/res/po/ml.po index 58b1b49..c8f1b15 100755 --- a/TelegramTizen/res/po/ml.po +++ b/TelegramTizen/res/po/ml.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "അആഇഈഉഊഋഎഏഐഒഓഔകഖഗഘങചഛജഝഞടഠഡഢണതഥദധനപഫബഭമയരലവശഷസഹളഴറABCDEFGHIJKLMNOPQRSTUVWXYZ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "ലോകത്തിലെ %1$sഏറ്റവും വേഗമേറിയ%2$s സന്ദേശമയയ്ക്കൽ ആപ്ലിക്കേഷൻ\nഇത് %3$sസൗജന്യവും%4$s %5$sസുരക്ഷിതവുമാണ്%6$s." @@ -463,3 +466,18 @@ msgstr "തടയൽ മാറ്റുക" msgid "IDS_TGRAM_OPT_SHARE" msgstr "പങ്കിടുക" +msgid "IDS_TGRAM_HEADER_LOG_OUT" +msgstr "ലോഗ് ഔട്ട് ചെയ്യുക" + +msgid "IDS_TGRAM_BODY_ENCRYPTED_FROM_END_TO_END_M_NOUN" +msgstr "ആദ്യാവസാനം എൻക്രിപ്റ്റ് ചെയ്യപ്പെടുന്നു" + +msgid "IDS_TGRAM_BODY_NOT_SAVED_ANYWHERE_M_NOUN" +msgstr "എവിടെയും സംരക്ഷിച്ചിട്ടില്ല" + +msgid "IDS_TGRAM_BODY_AUTOMATICALLY_DELETED_AFTER_A_PRESET_TIME_M_NOUN" +msgstr "ഒരു മുൻക്രമീകൃത സമയത്തിന് ശേഷം ഓട്ടോമാറ്റിക്കായി ഇല്ലാതാക്കപ്പെടുന്നു" + +msgid "IDS_TGRAM_BODY_CANNOT_BE_FORWARDED_M_NOUN" +msgstr "ഫോർവേഡ് ചെയ്യാനാവില്ല" + diff --git a/TelegramTizen/res/po/mn_MN.po b/TelegramTizen/res/po/mn_MN.po index 8acf3c6..fe88978 100755 --- a/TelegramTizen/res/po/mn_MN.po +++ b/TelegramTizen/res/po/mn_MN.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "АБВГДЕЁЖЗИЙКЛМНОӨПРСТУҮФХЦЧШЩЪЬЫЭЮЯ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "Дэлхийн %1$sхамгийн хурдан%2$s зурвас хэрэглүүр\n%3$sҮнэгүй%4$s бас %5$sнайдвартай%6$s." @@ -463,3 +466,18 @@ msgstr "Нээх" msgid "IDS_TGRAM_OPT_SHARE" msgstr "Хуваалцах" +msgid "IDS_TGRAM_HEADER_LOG_OUT" +msgstr "Гарах" + +msgid "IDS_TGRAM_BODY_ENCRYPTED_FROM_END_TO_END_M_NOUN" +msgstr "Төгсгөл хооронд шифрлэсэн" + +msgid "IDS_TGRAM_BODY_NOT_SAVED_ANYWHERE_M_NOUN" +msgstr "Хаана ч хадгалагдаагүй" + +msgid "IDS_TGRAM_BODY_AUTOMATICALLY_DELETED_AFTER_A_PRESET_TIME_M_NOUN" +msgstr "Урьдчилан тохируулсан хугацааны дараа автоматаар устана" + +msgid "IDS_TGRAM_BODY_CANNOT_BE_FORWARDED_M_NOUN" +msgstr "Цааш илгээх боломжгүй" + diff --git a/TelegramTizen/res/po/mr.po b/TelegramTizen/res/po/mr.po index aba41a0..8d1e041 100755 --- a/TelegramTizen/res/po/mr.po +++ b/TelegramTizen/res/po/mr.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "अआइईउऊऋएऐओऔकखगघङचछजझञटठडढणतथदधनपफबभमयरलवशषसहABCDEFGHIJKLMNOPQRSTUVWXYZ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "जगातील%1$sसर्वात जलद%2$s संदेश प्रेषण अनुप्रयोग\nहा %3$sविनामूल्य%4$s आणि %5$sसुरक्षित%6$s आहे." @@ -463,3 +466,18 @@ msgstr "अनावरोधित करा" msgid "IDS_TGRAM_OPT_SHARE" msgstr "सहभागी करा" +msgid "IDS_TGRAM_HEADER_LOG_OUT" +msgstr "लॉग आउट करा" + +msgid "IDS_TGRAM_BODY_ENCRYPTED_FROM_END_TO_END_M_NOUN" +msgstr "या टोकापासून त्या टोकापर्यंत एन्क्रिप्ट केलेला" + +msgid "IDS_TGRAM_BODY_NOT_SAVED_ANYWHERE_M_NOUN" +msgstr "कुठेही जतन केलेले नाही" + +msgid "IDS_TGRAM_BODY_AUTOMATICALLY_DELETED_AFTER_A_PRESET_TIME_M_NOUN" +msgstr "स्वयंचलितपणे प्रीसेट वेळानंतर हटवले" + +msgid "IDS_TGRAM_BODY_CANNOT_BE_FORWARDED_M_NOUN" +msgstr "अग्रेषित केले जाऊ शकत नाही" + diff --git a/TelegramTizen/res/po/ms.po b/TelegramTizen/res/po/ms.po index 77790ea..5f0fa5c 100755 --- a/TelegramTizen/res/po/ms.po +++ b/TelegramTizen/res/po/ms.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "Aplikasi mesej %1$sterpantas%2$s di dunia\nIa adalah %3$spercuma%4$s dan %5$sselamat%6$s." @@ -463,3 +466,18 @@ msgstr "Nyahsekat" msgid "IDS_TGRAM_OPT_SHARE" msgstr "Kongsi" +msgid "IDS_TGRAM_HEADER_LOG_OUT" +msgstr "Log keluar" + +msgid "IDS_TGRAM_BODY_ENCRYPTED_FROM_END_TO_END_M_NOUN" +msgstr "Disulitkan dari hujung ke hujung" + +msgid "IDS_TGRAM_BODY_NOT_SAVED_ANYWHERE_M_NOUN" +msgstr "Tidak disimpan di mana-mana" + +msgid "IDS_TGRAM_BODY_AUTOMATICALLY_DELETED_AFTER_A_PRESET_TIME_M_NOUN" +msgstr "Dipadam secara automatik selepas masa pratetap" + +msgid "IDS_TGRAM_BODY_CANNOT_BE_FORWARDED_M_NOUN" +msgstr "Tidak boleh dimajukan" + diff --git a/TelegramTizen/res/po/my_ZG.po b/TelegramTizen/res/po/my_ZG.po index 0f75303..f95cda4 100755 --- a/TelegramTizen/res/po/my_ZG.po +++ b/TelegramTizen/res/po/my_ZG.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "ကမၻာ့ %1$sအျမန္ဆံုး%2$sမက္ေဆ့ခ်္ေပးပုိ႔သည့္ အက္ပ္\n%3$sအခမဲ့%4$sျဖစ္ၿပီး %5$sလံုျခံဳမႈ%6$sရွိပါသည္။" @@ -463,3 +466,18 @@ msgstr "ပိတ္ဆီးမႈျဖဳတ္ပါ" msgid "IDS_TGRAM_OPT_SHARE" msgstr "မွ်ေဝပါ" +msgid "IDS_TGRAM_HEADER_LOG_OUT" +msgstr "ေလာ့ ေအာက္" + +msgid "IDS_TGRAM_BODY_ENCRYPTED_FROM_END_TO_END_M_NOUN" +msgstr "အဆံုးတစ္ဖက္မွ တစ္ဖက္သုိ႔ ကုဒ္ေျပာင္းထားသည္" + +msgid "IDS_TGRAM_BODY_NOT_SAVED_ANYWHERE_M_NOUN" +msgstr "မည္သည့္ေနရာတြင္မွ မသိမ္းထားပါ" + +msgid "IDS_TGRAM_BODY_AUTOMATICALLY_DELETED_AFTER_A_PRESET_TIME_M_NOUN" +msgstr "ႀကိဳတင္သတ္မွတ္ခ်ိန္ၿပီးေနာက္ အလုိအေလ်ာက္ ဖ်က္လုိက္ပါသည္" + +msgid "IDS_TGRAM_BODY_CANNOT_BE_FORWARDED_M_NOUN" +msgstr "လုိင္းလႊဲေျပာင္း၍ မရပါ" + diff --git a/TelegramTizen/res/po/ne.po b/TelegramTizen/res/po/ne.po index e85c71e..13d7d5e 100755 --- a/TelegramTizen/res/po/ne.po +++ b/TelegramTizen/res/po/ne.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "अआइईउऊऋएऐओऔकखगघङचछजझञटठडढणतथदधनपफबभमयरलवशषसहABCDEFGHIJKLMNOPQRSTUVWXYZ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "विश्वको %1$sसबैभन्दा द्रुत%2$s मेसेजिङ एप\nयो %3$sनिःशुल्क%4$s र %5$sसुरक्षित%6$s छ।" @@ -463,3 +466,18 @@ msgstr "अनब्लक गर्नुहोस्" msgid "IDS_TGRAM_OPT_SHARE" msgstr "साझा गर्नुहोस्" +msgid "IDS_TGRAM_HEADER_LOG_OUT" +msgstr "लग आउट गर्नुहोस्" + +msgid "IDS_TGRAM_BODY_ENCRYPTED_FROM_END_TO_END_M_NOUN" +msgstr "सुरुदेखि अन्तसम्म इन्क्रिप्ट गरिएको" + +msgid "IDS_TGRAM_BODY_NOT_SAVED_ANYWHERE_M_NOUN" +msgstr "कहीँपनि सेव गरिएको छैन" + +msgid "IDS_TGRAM_BODY_AUTOMATICALLY_DELETED_AFTER_A_PRESET_TIME_M_NOUN" +msgstr "पूर्वनिश्चित समयपछि स्वचालित रूपमा मेटाइन्छ" + +msgid "IDS_TGRAM_BODY_CANNOT_BE_FORWARDED_M_NOUN" +msgstr "फवार्ड गर्न सकिँदैन" + diff --git a/TelegramTizen/res/po/or.po b/TelegramTizen/res/po/or.po index 241df57..317f5a3 100755 --- a/TelegramTizen/res/po/or.po +++ b/TelegramTizen/res/po/or.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "ଅଆଇଈଉଊଋୠଏଐଓଔକଖଗଘଙଚଛଜଝଞଟଠଡଢଡ଼ଢ଼ଣତଥଦଧନପଫବଭମଯୟରଲଳୱଶଷସହABCDEFGHIJKLMNOPQRSTUVWXYZ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "ବିଶ୍ୱର %1$sଦ୍ରୁତତର%2$s ମେସେଜିଂ ଆପ୍\nଏହା %3$sମୁକ୍ତ%4$s ଏବଂ %5$sସୁରକ୍ଷିତ%6$s।" @@ -463,3 +466,18 @@ msgstr "ଅନାବରୋଧ" msgid "IDS_TGRAM_OPT_SHARE" msgstr "ଅଂଶୀଦାର" +msgid "IDS_TGRAM_HEADER_LOG_OUT" +msgstr "ଲଗ୍ ଆଉଟ୍" + +msgid "IDS_TGRAM_BODY_ENCRYPTED_FROM_END_TO_END_M_NOUN" +msgstr "ଶେଷରୁ ଶେଷ ପର୍ଯ୍ୟନ୍ତ ଏନକ୍ରିପ୍ଟ ହୋଇଛି" + +msgid "IDS_TGRAM_BODY_NOT_SAVED_ANYWHERE_M_NOUN" +msgstr "କୌଣସି ସ୍ଥାନରେ ସଞ୍ଚୟ ହୋଇନାହିଁ" + +msgid "IDS_TGRAM_BODY_AUTOMATICALLY_DELETED_AFTER_A_PRESET_TIME_M_NOUN" +msgstr "ଏକ ପୂର୍ବସେଟ୍ ସମୟରେ ପରେ ସ୍ୱତଃସ୍ପୃତ ଭାବେ ବିଲୋପ ହୋଇଛି" + +msgid "IDS_TGRAM_BODY_CANNOT_BE_FORWARDED_M_NOUN" +msgstr "ଅଗ୍ରଗାମୀ ହୋଇପାରିବ ନାହିଁ" + diff --git a/TelegramTizen/res/po/pa.po b/TelegramTizen/res/po/pa.po index 0d8e519..057b3ce 100755 --- a/TelegramTizen/res/po/pa.po +++ b/TelegramTizen/res/po/pa.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "ਉਅੲਸਹਕਖਗਘਙਚਛਜਝਞਟਠਡਢਣਤਥਦਧਨਪਫਬਭਮਯਰਲਵੜਸ਼ਖ਼ਗ਼ਜ਼ਫ਼ਲ਼ABCDEFGHIJKLMNOPQRSTUVWXYZ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "ਵਿਸ਼ਵ ਦੀ %1$sਸਭ ਤੋਂ ਤੇਜ਼%2$s ਮੈਸੇਜਿੰਗ ਐਪ\nਇਹ %3$sਮੁਫ਼ਤ%4$s ਅਤੇ %5$sਸੁਰੱਖਿਅਤ%6$s ਹੈ।" @@ -463,3 +466,18 @@ msgstr "ਅਨਬਲੌਕ ਕਰੋ" msgid "IDS_TGRAM_OPT_SHARE" msgstr "ਸਾਂਝਾ ਕਰੋ" +msgid "IDS_TGRAM_HEADER_LOG_OUT" +msgstr "ਲੌਗ ਆਉਟ" + +msgid "IDS_TGRAM_BODY_ENCRYPTED_FROM_END_TO_END_M_NOUN" +msgstr "ਅੰਤ ਤੋਂ ਅੰਤ ਤੱਕ ਏਨਕ੍ਰਿਪਟ ਕੀਤਾ ਗਿਆ" + +msgid "IDS_TGRAM_BODY_NOT_SAVED_ANYWHERE_M_NOUN" +msgstr "ਕਿਤੇ ਵੀ ਸੁਰੱਖਿਅਤ ਨਹੀਂ" + +msgid "IDS_TGRAM_BODY_AUTOMATICALLY_DELETED_AFTER_A_PRESET_TIME_M_NOUN" +msgstr "ਇੱਕ ਪ੍ਰੀਸੈੱਟ ਸਮੇਂ ਤੋਂ ਬਾਅਦ ਸਵੈਚਲਿਤ ਮਿਟਾਇਆ ਗਿਆ" + +msgid "IDS_TGRAM_BODY_CANNOT_BE_FORWARDED_M_NOUN" +msgstr "ਫਾਰਵਰਡ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਦਾ" + diff --git a/TelegramTizen/res/po/pt_BR.po b/TelegramTizen/res/po/pt_BR.po index ec2f520..8d7bbfd 100755 --- a/TelegramTizen/res/po/pt_BR.po +++ b/TelegramTizen/res/po/pt_BR.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "O aplicativo de mensagens %1$smais rápido%2$s do mundo\nÉ %3$sgratuito%4$s e %5$sseguro%6$s." diff --git a/TelegramTizen/res/po/pt_PT.po b/TelegramTizen/res/po/pt_PT.po index efd9851..84512f9 100755 --- a/TelegramTizen/res/po/pt_PT.po +++ b/TelegramTizen/res/po/pt_PT.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "A aplicação de mensagens %1$smais rápida%2$s do mundo\nÉ %3$sgratuita%4$s e %5$ssegura%6$s." diff --git a/TelegramTizen/res/po/ru_RU.po b/TelegramTizen/res/po/ru_RU.po index 758122a..63137fd 100755 --- a/TelegramTizen/res/po/ru_RU.po +++ b/TelegramTizen/res/po/ru_RU.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "Самое %1$sбыстрое%2$s в мире %3$sбесплатное%4$s и %5$sзащищенное%6$s\nприложение для обмена сообщениями." diff --git a/TelegramTizen/res/po/si.po b/TelegramTizen/res/po/si.po index 3c1d0dc..71e2f33 100755 --- a/TelegramTizen/res/po/si.po +++ b/TelegramTizen/res/po/si.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "අආඇඈඉඊඋඌඍඎඑඒඓඔඕඖකඛගඝඞඟචඡජඣඤඦටඨඩඪණඬතථදධනඳපඵබභමඹයරලවශෂසහළෆABCDEFGHIJKLMNOPQRSTUVWXYZ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "ලොව %1$sවේගවත්ම%2$s පණිවිඩකරණ යෙදුම\nඑය %3$sනොමිලේ%4$s සහ %5$sආරක්ෂිතය%6$s." @@ -463,3 +466,18 @@ msgstr "අනවහිර කිරීම" msgid "IDS_TGRAM_OPT_SHARE" msgstr "බෙදාහදා ගන්න" +msgid "IDS_TGRAM_HEADER_LOG_OUT" +msgstr "පිටවීම" + +msgid "IDS_TGRAM_BODY_ENCRYPTED_FROM_END_TO_END_M_NOUN" +msgstr "නිමාවෙන් නිමාවට ගුප්ත කේතිතයි" + +msgid "IDS_TGRAM_BODY_NOT_SAVED_ANYWHERE_M_NOUN" +msgstr "කිසිදු තැනක සුරැක නැත" + +msgid "IDS_TGRAM_BODY_AUTOMATICALLY_DELETED_AFTER_A_PRESET_TIME_M_NOUN" +msgstr "පෙරසකසූ වේලාවකට පසුව ස්වයංක්‍රීයව මැකිණි" + +msgid "IDS_TGRAM_BODY_CANNOT_BE_FORWARDED_M_NOUN" +msgstr "යොමු කළ නොහැක" + diff --git a/TelegramTizen/res/po/ta.po b/TelegramTizen/res/po/ta.po index ba5b631..3ff42a9 100755 --- a/TelegramTizen/res/po/ta.po +++ b/TelegramTizen/res/po/ta.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "அஆஇஈஉஊஎஏஐஒஓஔஃகஙசஞடணதநபமயரலவழளறனABCDEFGHIJKLMNOPQRSTUVWXYZ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "உலகின் %1$sஅதிவேகமான%2$s மெசேஜிங் பயன்பாடு\nஇது %3$sஇலவசமானது%4$s மற்றும் %5$sபாதுகாப்பானது%6$s." @@ -463,3 +466,18 @@ msgstr "தடுப்பு நீக்கவும்" msgid "IDS_TGRAM_OPT_SHARE" msgstr "பகிர்க" +msgid "IDS_TGRAM_HEADER_LOG_OUT" +msgstr "வெளியேறுக" + +msgid "IDS_TGRAM_BODY_ENCRYPTED_FROM_END_TO_END_M_NOUN" +msgstr "முழுவதும் மறைகுறியாக்கப்பட்டது" + +msgid "IDS_TGRAM_BODY_NOT_SAVED_ANYWHERE_M_NOUN" +msgstr "எங்கும் சேமிக்கப்படவில்லை" + +msgid "IDS_TGRAM_BODY_AUTOMATICALLY_DELETED_AFTER_A_PRESET_TIME_M_NOUN" +msgstr "முன்னமைத்த நேரத்திற்குப் பிறகு தானாக நீக்கப்படும்" + +msgid "IDS_TGRAM_BODY_CANNOT_BE_FORWARDED_M_NOUN" +msgstr "முன்னனுப்ப இயலாது" + diff --git a/TelegramTizen/res/po/te.po b/TelegramTizen/res/po/te.po index 96249c7..f5ae392 100755 --- a/TelegramTizen/res/po/te.po +++ b/TelegramTizen/res/po/te.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "కఖగఘఙచఛజఝఞటఠడఢణతథదధనపఫబభమయరలళవశషసహఱABCDEFGHIJKLMNOPQRSTUVWXYZ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "ప్రపంచపు %1$sవేగవంతమైన%2$s మెసేజింగ్ అప్లికేషన్\nఇది %3$sఉచితం%4$s మరియు %5$sసురక్షితం%6$s." @@ -463,3 +466,18 @@ msgstr "అనుమతించు" msgid "IDS_TGRAM_OPT_SHARE" msgstr "భాగస్వామ్యం చేయి" +msgid "IDS_TGRAM_HEADER_LOG_OUT" +msgstr "లాగ్ అవుట్ చేయి" + +msgid "IDS_TGRAM_BODY_ENCRYPTED_FROM_END_TO_END_M_NOUN" +msgstr "మొదటి నుండి చివరి వరకు ఎన్‌క్రిప్ట్ చేయబడింది" + +msgid "IDS_TGRAM_BODY_NOT_SAVED_ANYWHERE_M_NOUN" +msgstr "ఎక్కడా సేవ్ చేయబడలేదు" + +msgid "IDS_TGRAM_BODY_AUTOMATICALLY_DELETED_AFTER_A_PRESET_TIME_M_NOUN" +msgstr "ప్రీసెట్ సమయం తర్వాత స్వయంచాలకంగా తొలగించబడుతుంది" + +msgid "IDS_TGRAM_BODY_CANNOT_BE_FORWARDED_M_NOUN" +msgstr "ఫార్వార్డ్ చేయబడదు" + diff --git a/TelegramTizen/res/po/tg_TJ.po b/TelegramTizen/res/po/tg_TJ.po index 08f3f08..1da60c3 100755 --- a/TelegramTizen/res/po/tg_TJ.po +++ b/TelegramTizen/res/po/tg_TJ.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "ABCDEFGHIJKLMNOPQRSTUVWXYZ#" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "Барномаи паёмнависии %1$sзудкортарин%2$s дар ҷаҳон\nОн %3$sройгон%4$s ва %5$sамн%6$s аст." @@ -463,3 +466,18 @@ msgstr "Ғайримамнуъ кардан" msgid "IDS_TGRAM_OPT_SHARE" msgstr "Мубодила кардан" +msgid "IDS_TGRAM_HEADER_LOG_OUT" +msgstr "Баромадан" + +msgid "IDS_TGRAM_BODY_ENCRYPTED_FROM_END_TO_END_M_NOUN" +msgstr "Аз охир то охир рамзбандӣ шудааст" + +msgid "IDS_TGRAM_BODY_NOT_SAVED_ANYWHERE_M_NOUN" +msgstr "Дар ягон ҷо захира нашудааст" + +msgid "IDS_TGRAM_BODY_AUTOMATICALLY_DELETED_AFTER_A_PRESET_TIME_M_NOUN" +msgstr "Баъди вақти таъйиншуда ба таври худкор нест карда мешавад" + +msgid "IDS_TGRAM_BODY_CANNOT_BE_FORWARDED_M_NOUN" +msgstr "Бозфиристӣ ғайриимкон аст" + diff --git a/TelegramTizen/res/po/th.po b/TelegramTizen/res/po/th.po index 98972a4..50d9b5e 100755 --- a/TelegramTizen/res/po/th.po +++ b/TelegramTizen/res/po/th.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลวศษสหฬอฮ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "แอพรับส่งข้อความที่ %1$sเร็วที่สุด%2$s ในโลก\n ซึ่งทั้ง %3$sฟรี%4$s และ %5$sปลอดภัย%6$s" @@ -463,3 +466,18 @@ msgstr "ปลดบล็อค" msgid "IDS_TGRAM_OPT_SHARE" msgstr "แชร์" +msgid "IDS_TGRAM_HEADER_LOG_OUT" +msgstr "ออกจากระบบ" + +msgid "IDS_TGRAM_BODY_ENCRYPTED_FROM_END_TO_END_M_NOUN" +msgstr "เข้ารหัสทั้งหมด" + +msgid "IDS_TGRAM_BODY_NOT_SAVED_ANYWHERE_M_NOUN" +msgstr "ไม่ได้บันทึกไว้ที่ใดเลย" + +msgid "IDS_TGRAM_BODY_AUTOMATICALLY_DELETED_AFTER_A_PRESET_TIME_M_NOUN" +msgstr "ลบอัตโนมัติเมื่อเลยเวลาที่กำหนดไว้" + +msgid "IDS_TGRAM_BODY_CANNOT_BE_FORWARDED_M_NOUN" +msgstr "ไม่สามารถส่งต่อได้" + diff --git a/TelegramTizen/res/po/tk_TM.po b/TelegramTizen/res/po/tk_TM.po index fcbb2c6..5b17944 100755 --- a/TelegramTizen/res/po/tk_TM.po +++ b/TelegramTizen/res/po/tk_TM.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "Dünýäniň %1$siň çalt%2$s hat alyşma goýmasy\nOl %3$smugt%4$s we %5$showpsuz%6$s." @@ -463,3 +466,18 @@ msgstr "Beklemeden aýyr" msgid "IDS_TGRAM_OPT_SHARE" msgstr "Paýlaş" +msgid "IDS_TGRAM_HEADER_LOG_OUT" +msgstr "Çyk" + +msgid "IDS_TGRAM_BODY_ENCRYPTED_FROM_END_TO_END_M_NOUN" +msgstr "Uçdan uja şifrlenen" + +msgid "IDS_TGRAM_BODY_NOT_SAVED_ANYWHERE_M_NOUN" +msgstr "Hiç ýerde ýazdyrylmadyk" + +msgid "IDS_TGRAM_BODY_AUTOMATICALLY_DELETED_AFTER_A_PRESET_TIME_M_NOUN" +msgstr "Öňbellenen wagtdan soň awtomatik öçürildi" + +msgid "IDS_TGRAM_BODY_CANNOT_BE_FORWARDED_M_NOUN" +msgstr "Gönükdirip bolmaýar" + diff --git a/TelegramTizen/res/po/tl.po b/TelegramTizen/res/po/tl.po index 15a71ec..27619cc 100755 --- a/TelegramTizen/res/po/tl.po +++ b/TelegramTizen/res/po/tl.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "Ang %1$spinakamabilis%2$s na messaging app\n%3$sLibre%4$s at %5$sligtas%6$s ito." @@ -463,3 +466,18 @@ msgstr "I-unblock" msgid "IDS_TGRAM_OPT_SHARE" msgstr "Ibahagi" +msgid "IDS_TGRAM_HEADER_LOG_OUT" +msgstr "Mag-log out" + +msgid "IDS_TGRAM_BODY_ENCRYPTED_FROM_END_TO_END_M_NOUN" +msgstr "Naka-encrypt mula isang dulo hanggang sa kabilang dulo" + +msgid "IDS_TGRAM_BODY_NOT_SAVED_ANYWHERE_M_NOUN" +msgstr "Hindi naka-save saanman" + +msgid "IDS_TGRAM_BODY_AUTOMATICALLY_DELETED_AFTER_A_PRESET_TIME_M_NOUN" +msgstr "Awtomatikong tanggalin pagkalipas ng tinakdang oras" + +msgid "IDS_TGRAM_BODY_CANNOT_BE_FORWARDED_M_NOUN" +msgstr "Hindi mai-forward" + diff --git a/TelegramTizen/res/po/tr_TR.po b/TelegramTizen/res/po/tr_TR.po index 83f1ebc..a3b6bfe 100755 --- a/TelegramTizen/res/po/tr_TR.po +++ b/TelegramTizen/res/po/tr_TR.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "Dünyanın %1$sen hızlı%2$s mesajlaşma uygulaması\n%3$sÜcretsiz%4$s ve %5$sgüvenli%6$s." diff --git a/TelegramTizen/res/po/uk.po b/TelegramTizen/res/po/uk.po index 14c61e2..5dadca2 100755 --- a/TelegramTizen/res/po/uk.po +++ b/TelegramTizen/res/po/uk.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "АБВГҐДЕЄЖЗИІЇЙКЛМНОПРСТУФХЦЧШЩЬЮЯ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "%1$sНайшвидша%2$s у світі %3$sбезкоштовна%4$s та %5$sзахищена%6$s\nпрограма обміну повідомленнями." diff --git a/TelegramTizen/res/po/ur.po b/TelegramTizen/res/po/ur.po index ccea4a8..b312dfc 100755 --- a/TelegramTizen/res/po/ur.po +++ b/TelegramTizen/res/po/ur.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "ابپتٹثجچحخدڈذرڑژسشصضطظعغفقکگلمنوہھءیے" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "دنیا کا %1$sتیز ترین%2$s پیغامات بھیجنے والا ایپلیکیشن\nیہ %3$sمفت%4$s اور %5$sمحفوظ%6$s ہے۔" @@ -463,3 +466,18 @@ msgstr "ان بلاک کریں" msgid "IDS_TGRAM_OPT_SHARE" msgstr "شراکت کریں" +msgid "IDS_TGRAM_HEADER_LOG_OUT" +msgstr "لاگ آؤٹ" + +msgid "IDS_TGRAM_BODY_ENCRYPTED_FROM_END_TO_END_M_NOUN" +msgstr "اینڈ ٹو اینڈ سے خفیہ کردہ" + +msgid "IDS_TGRAM_BODY_NOT_SAVED_ANYWHERE_M_NOUN" +msgstr "کہیں بھی محفوظ نہیں ہوا" + +msgid "IDS_TGRAM_BODY_AUTOMATICALLY_DELETED_AFTER_A_PRESET_TIME_M_NOUN" +msgstr "پہلے سے سیٹ کردہ وقت پر خود بخود حذف ہو گیا" + +msgid "IDS_TGRAM_BODY_CANNOT_BE_FORWARDED_M_NOUN" +msgstr "آگے نہیں بڑھایا جاسکتا" + diff --git a/TelegramTizen/res/po/uz.po b/TelegramTizen/res/po/uz.po index 1170ee2..3502bd6 100755 --- a/TelegramTizen/res/po/uz.po +++ b/TelegramTizen/res/po/uz.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "ABDEFGHIJKLMNOPQRSTUVXYZO‘G‘ChShNg" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "Dunyodagi %1$seng tez%2$s xabarlar ilovasi\nU %3$sbepul%4$s va %5$sxavfsiz%6$s." diff --git a/TelegramTizen/res/po/vi.po b/TelegramTizen/res/po/vi.po index 07082f1..fcb2bb4 100755 --- a/TelegramTizen/res/po/vi.po +++ b/TelegramTizen/res/po/vi.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "Ứng dụng nhắn tin %1$snhanh nhất%2$s thế giới\n%3$sMiễn phí%4$s và %5$sbảo mật%6$s." @@ -463,3 +466,18 @@ msgstr "Bỏ chặn" msgid "IDS_TGRAM_OPT_SHARE" msgstr "Chia sẻ" +msgid "IDS_TGRAM_HEADER_LOG_OUT" +msgstr "Đăng xuất" + +msgid "IDS_TGRAM_BODY_ENCRYPTED_FROM_END_TO_END_M_NOUN" +msgstr "Mã hóa hai đầu" + +msgid "IDS_TGRAM_BODY_NOT_SAVED_ANYWHERE_M_NOUN" +msgstr "Chưa lưu ở bất kỳ đâu" + +msgid "IDS_TGRAM_BODY_AUTOMATICALLY_DELETED_AFTER_A_PRESET_TIME_M_NOUN" +msgstr "Tự động xóa sau thời gian đặt sẵn" + +msgid "IDS_TGRAM_BODY_CANNOT_BE_FORWARDED_M_NOUN" +msgstr "Không thể chuyển tiếp" + diff --git a/TelegramTizen/res/po/zh_CN.po b/TelegramTizen/res/po/zh_CN.po index 4614167..a79e924 100755 --- a/TelegramTizen/res/po/zh_CN.po +++ b/TelegramTizen/res/po/zh_CN.po @@ -1,3 +1,6 @@ +msgid "IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ" +msgstr "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + msgid "IDS_TGRAM_SBODY_THE_WORLDS_P1SSFASTESTP2SS_MESSAGING_APP_NIT_IS_P3SSFREEP4SS_AND_P5SSSECUREP6SS" msgstr "全球%1$s最快的%2$s信息应用程序\n%3$s免费%4$s又%5$s安全%6$s。" diff --git a/TelegramTizen/src/contact_selection_view.c b/TelegramTizen/src/contact_selection_view.c index 89c55d9..0ca9a4e 100644 --- a/TelegramTizen/src/contact_selection_view.c +++ b/TelegramTizen/src/contact_selection_view.c @@ -6,6 +6,7 @@ #include "contact_selection_view.h" #include "group_chat_entry_view.h" +#include "ucol.h" static Evas_Object* create_image_object_from_file(const char *icon_name, Evas_Object *parent) { @@ -85,18 +86,23 @@ char* on_buddy_name_get_cb(void *data, Evas_Object *obj, const char *part) { int id = (int)data; appdata_s* ad = evas_object_data_get(obj, "app_data"); + Eina_List *list = evas_object_data_get(obj, "result_list"); - if (id == 0 && ad->buddy_list && eina_list_count(ad->buddy_list) > 0) { - char buf[512] = {'\0'}; - snprintf(buf, 512, "%s", "Select all"); - return strdup(buf); + if (!list) { + list = ad->buddy_list; } - if (ad->buddy_list && eina_list_count(ad->buddy_list) > 0) { - user_data_with_pic_s* item = eina_list_nth(ad->buddy_list, id - 1); - user_data_s* user = item->use_data; - + if (list && eina_list_count(list) > 0) { if (!strcmp(part,"elm.text")){ + if (id == 0) { + char buf[512] = { 0, }; + snprintf(buf, 512, "%s", i18n_get_text("IDS_TGRAM_MBODY_SELECT_ALL")); + return strdup(buf); + } + + user_data_with_pic_s* item = eina_list_nth(list, id - 1); + user_data_s* user = item->use_data; + char* user_name = replace(user->print_name, '_', " "); char buf[512] = {'\0'}; snprintf(buf, 512, "%s", user_name); @@ -115,10 +121,15 @@ void on_item_checkbox_sel_cb(void *data, Evas_Object *obj, void *event_info) appdata_s* ad = evas_object_data_get(obj, "app_data"); Eina_Bool checked = elm_check_state_get(obj); Evas_Object* buddy_gen_list = evas_object_data_get(obj, "buddy_gen_list"); - if (ad && ad->buddy_list && eina_list_count(ad->buddy_list) > 0) { + Eina_List *list = evas_object_data_get(buddy_gen_list, "result_list"); + + if (!list) { + list = ad->buddy_list; + } + if (ad && list && eina_list_count(list) > 0) { if(id == 0) { - for (int i = 0 ; i < eina_list_count(ad->buddy_list) ; i++) { - user_data_with_pic_s *item = eina_list_nth(ad->buddy_list, i); + for (int i = 0 ; i < eina_list_count(list) ; i++) { + user_data_with_pic_s *item = eina_list_nth(list, i); user_data_s* user = item->use_data; user->is_selected = checked; @@ -131,7 +142,7 @@ void on_item_checkbox_sel_cb(void *data, Evas_Object *obj, void *event_info) } } } else { - user_data_with_pic_s *item = eina_list_nth(ad->buddy_list, id - 1); + user_data_with_pic_s *item = eina_list_nth(list, id - 1); user_data_s* user = item->use_data; user->is_selected = checked; @@ -145,8 +156,8 @@ void on_item_checkbox_sel_cb(void *data, Evas_Object *obj, void *event_info) } } else { Eina_Bool all_items_selected = EINA_TRUE; - for (int i = 0 ; i < eina_list_count(ad->buddy_list) ; i++) { - user_data_with_pic_s *item = eina_list_nth(ad->buddy_list, i); + for (int i = 0 ; i < eina_list_count(list) ; i++) { + user_data_with_pic_s *item = eina_list_nth(list, i); user_data_s* user = item->use_data; if (!user->is_selected) { all_items_selected = EINA_FALSE; @@ -178,20 +189,27 @@ Evas_Object* on_buddy_selection_part_content_get_cb(void *data, Evas_Object *obj return NULL; } + Eina_List *list = evas_object_data_get(obj, "result_list"); + + if (!list) { + list = ad->buddy_list; + } + if (!strcmp(part, "elm.swallow.icon")) { Evas_Object *image = NULL; - if (id == 0 && ad->buddy_list && eina_list_count(ad->buddy_list) > 0) { + if (id == 0 && list && eina_list_count(list) > 0) { return eo; } - user_data_with_pic_s *item = eina_list_nth(ad->buddy_list, id - 1); + user_data_with_pic_s *item = eina_list_nth(list, id - 1); user_data_s* user = item->use_data; if (user->photo_path && strcmp(user->photo_path, "") != 0) { image = create_image_object_from_file(user->photo_path, obj); } else { - image = create_image_object_from_file(ui_utils_get_resource(DEFAULT_PROFILE_PIC), obj); + image = create_image_object_from_file(ui_utils_get_resource(DEFAULT_LIST_THUMB_SINGLE_PIC), obj); + evas_object_color_set(image, 45, 165, 224, 255); } item->contact_icon = image; @@ -201,19 +219,19 @@ Evas_Object* on_buddy_selection_part_content_get_cb(void *data, Evas_Object *obj char edj_path[PATH_MAX] = {0, }; app_get_resource(TELEGRAM_INIT_VIEW_EDJ, edj_path, (int)PATH_MAX); Evas_Object* user_pic_layout = elm_layout_add(ad->nf); - elm_layout_file_set(user_pic_layout, edj_path, "circle_layout"); + elm_layout_file_set(user_pic_layout, edj_path, "search_circle_layout"); evas_object_size_hint_weight_set(user_pic_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(user_pic_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(user_pic_layout); - elm_object_part_content_set(user_pic_layout, "content", image); + elm_object_part_content_set(user_pic_layout, "content", item->contact_icon); eo = elm_layout_add(obj); - elm_layout_theme_set(eo, "layout", "list/C/type.3", "default"); + elm_layout_theme_set(eo, "layout", "list/B/type.2", "default"); elm_layout_content_set(eo, "elm.swallow.content", user_pic_layout); } } else if (!strcmp(part, "elm.swallow.end")) { - if (id == 0 && ad->buddy_list && eina_list_count(ad->buddy_list) > 0) { + if (id == 0 && list && eina_list_count(list) > 0) { Eina_Bool all_items_selected = (Eina_Bool)evas_object_data_get(obj, "all_selected"); @@ -230,7 +248,7 @@ Evas_Object* on_buddy_selection_part_content_get_cb(void *data, Evas_Object *obj return eo; } - user_data_with_pic_s *item = eina_list_nth(ad->buddy_list, id - 1); + user_data_with_pic_s *item = eina_list_nth(list, id - 1); user_data_s* user = item->use_data; eo = elm_layout_add(obj); @@ -290,6 +308,277 @@ void on_cancel_buton_clicked(void *data, Evas_Object *object, void *event_info) evas_object_show(ad->panel); } +#if 0 +static char* _util_get_first_char(char *input_text) +{ /* + int unicode_len = eina_unicode_utf8_get_len(input_text); + int str_len = strlen(input_text); + int lang_byte = str_len / unicode_len + (str_len % unicode_len > 0 ? 1 : 0); + + first_char = strndup(input_text, lang_byte); + */ + char *first_char = NULL; + int count; + int flag; + unsigned char mask = 0x80; + + count = 0; + while (*input_text & mask) { + mask = mask >> 1; + count++; + } + + count = count == 0 ? 1 : count; + first_char = strndup(input_text, count); + + return first_char; +} + +static void _update_index_item(void *data, void *item_data, int id, Eina_List *list) +{ + appdata_s* ad = data; + if (id == 0) { + return; + } + user_data_with_pic_s* item = eina_list_nth(list, id-1); + user_data_s* user = item->use_data; + + Evas_Object *index = evas_object_data_get(ad->nf, "fs_index"); + + /* + char *index_text = NULL; + int unicode_len = eina_unicode_utf8_get_len(user->print_name); + int str_len = strlen(user->print_name); + int lang_byte = str_len / unicode_len + (str_len % unicode_len > 0 ? 1 : 0); + + index_text = strndup(user->print_name, lang_byte); + */ + + char *index_text = _util_get_first_char(user->print_name); + + Elm_Object_Item *it = elm_index_item_append(index, index_text, NULL, NULL); + + elm_object_item_data_set(it, item_data); + +} +#endif + +static void _append_peer_item(Evas_Object *genlist, appdata_s *ad, Eina_List* item_list) +{ + int i; + static Elm_Genlist_Item_Class itc; + Elm_Object_Item* item = NULL; + + itc.item_style = "type1"; + itc.func.text_get = on_buddy_name_get_cb; + itc.func.content_get = on_buddy_selection_part_content_get_cb; + itc.func.state_get = NULL; + itc.func.del = NULL; + + int count = eina_list_count(item_list); + + evas_object_data_set(genlist, "result_list", item_list); + + if(count > 0) { + for (i = 0; i < count+1; i++) { + item = elm_genlist_item_append(genlist, &itc, (void *) i, NULL, ELM_GENLIST_ITEM_NONE, on_buddy_selected, (void*) i); + //_update_index_item(ad, item, i, item_list); + } + } else { + i = 1; + elm_genlist_item_append(genlist, &itc, (void *) i, NULL, ELM_GENLIST_ITEM_NONE, NULL, (void*) i); + } +} + +static void _on_search_entry_changed(void *data, Evas_Object *obj, void *event_info) +{ + appdata_s* ad = data; + char* entry_text = NULL; + + Evas_Object *buddy_list = evas_object_data_get(ad->nf, "buddy_list"); + Evas_Object *main_layout = evas_object_data_get(ad->nf, "main_layout"); + Evas_Object *index = evas_object_data_get(ad->nf, "fs_index"); + + user_data_with_pic_s *item; + user_data_s* user; // = item->use_data; + + if (!buddy_list) { + DBG("buddy_list is null"); + return; + } + + elm_genlist_clear(buddy_list); + //elm_index_item_clear(index); + + entry_text = trim(elm_entry_markup_to_utf8(elm_object_text_get(obj))); + + Eina_List *result_list = NULL; + Eina_List *l = NULL; + + if (ucol_is_jamo(entry_text)) { + LOGD("entry_text is jamo, %s", entry_text); + EINA_LIST_FOREACH(ad->buddy_list, l, item) { + int result; + user = item->use_data; + result = ucol_compare_first_letters(user->print_name, entry_text); + if (result == 0) { + result_list = eina_list_append(result_list, item); + } + } + } else { + LOGD("entry_text is not jamo, %s", entry_text); + EINA_LIST_FOREACH(ad->buddy_list, l, item) { + user = item->use_data; + + if (ucol_ncompare(user->print_name, entry_text, strlen(entry_text)) == 0) { + result_list = eina_list_append(result_list, item); + } + } + } + + if ((entry_text == NULL || strlen(entry_text) == 0) && result_list == NULL) { + result_list = ad->buddy_list; + } + + LOGD("count of result_list is %d", eina_list_count(result_list)); + + if (result_list) { + Evas_Object *fs_layout = evas_object_data_get(ad->nf, "fs_layout"); + _append_peer_item(buddy_list, data, result_list); + Evas_Object *content = elm_object_part_content_unset(main_layout, "elm.swallow.content"); + if (evas_object_data_get(ad->nf, "no_contents_layout") == content) { + evas_object_hide(content); + } + elm_object_part_content_set(main_layout, "elm.swallow.content", fs_layout); + + } else { + Evas_Object *no_contents = evas_object_data_get(ad->nf, "no_contents_layout"); + + elm_object_part_content_unset(main_layout, "elm.swallow.content"); + elm_object_part_content_set(main_layout, "elm.swallow.content", no_contents); + } + + elm_index_level_go(index, 0); + elm_genlist_realized_items_update(buddy_list); + if (entry_text) { + free(entry_text); + } +} + +static void _on_search_entry_focused(void *data, Evas_Object *obj, void *event_info) +{ + Evas_Object *layout = data; + if (elm_object_focus_get(layout)) { + elm_object_signal_emit(layout, "elm,state,focused", ""); + } else{ + elm_object_signal_emit(layout, "elm,state,unfocused", ""); + } +} + +static Evas_Object *create_searchbar(Evas_Object* parent, void* data) +{ + char edj_path[PATH_MAX] = {0, }; + app_get_resource(TELEGRAM_INIT_VIEW_EDJ, edj_path, (int)PATH_MAX); + + Evas_Object* layout = elm_layout_add(parent); + elm_layout_file_set(layout, edj_path, ""); + + /* editfield layout */ + Evas_Object* searchbar_layout = elm_layout_add(parent); + elm_layout_theme_set(searchbar_layout, "layout", "searchfield", "singleline"); + evas_object_size_hint_align_set(searchbar_layout, EVAS_HINT_FILL, 0.0); + evas_object_size_hint_weight_set(searchbar_layout, EVAS_HINT_EXPAND, 0.0); + //evas_object_event_callback_add(searchbar_layout, EVAS_CALLBACK_DEL, _searchbar_layout_del_cb, NULL); + + /* entry */ + Evas_Object* searchbar_entry = elm_entry_add(searchbar_layout); + elm_entry_cursor_end_set(searchbar_entry); + evas_object_size_hint_weight_set(searchbar_entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(searchbar_entry, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_entry_single_line_set(searchbar_entry, EINA_TRUE); + elm_entry_scrollable_set (searchbar_entry, EINA_FALSE); + elm_entry_cnp_mode_set(searchbar_entry, ELM_CNP_MODE_NO_IMAGE); + elm_entry_context_menu_disabled_set(searchbar_entry, EINA_TRUE); + elm_object_part_text_set(searchbar_entry, "elm.guide", i18n_get_text("IDS_TGRAM_NPBODY_SEARCH")); + elm_object_focus_set(searchbar_entry, EINA_FALSE); + + limit_filter_data.max_char_count = 255; + elm_entry_markup_filter_append(searchbar_entry, elm_entry_filter_limit_size, &limit_filter_data); + + + evas_object_smart_callback_add(searchbar_entry, "changed", _on_search_entry_changed, data); + evas_object_smart_callback_add(searchbar_entry, "preedit,changed", _on_search_entry_changed, data); + evas_object_smart_callback_add(searchbar_entry, "focused", _on_search_entry_focused, searchbar_layout); + + elm_object_part_content_set(searchbar_layout, "elm.swallow.content", searchbar_entry); + return searchbar_layout; +} + +static void _index_selected_cb(void *data, Evas_Object *obj, void *event_info) +{ + appdata_s* ad = data; + Evas_Object *buddy_list = evas_object_data_get(ad->nf, "buddy_list"); + //Elm_Object_Item *gl_item = elm_genlist_first_item_get(search_list); + + user_data_with_pic_s* gl_item = NULL;//eina_list_nth(ad->search_peer_list, 0); + + //tg_peer_info_s* user = item->use_data; + Eina_List* list = ad->buddy_list; + int index = 0; + Eina_List *l; + + EINA_LIST_FOREACH(list, l, gl_item) { + if (ucol_compare_first_letters(gl_item->use_data->print_name, elm_index_item_letter_get(event_info)) == 0) { + break; + } + index++; + } + + if (eina_list_count(list) == index) { + return; + } + + Elm_Object_Item *item = elm_genlist_nth_item_get(buddy_list, ++index); + elm_genlist_item_show(item, ELM_GENLIST_ITEM_SCROLLTO_TOP); +} + +static Evas_Object* create_fastscroll(appdata_s *ad) +{ + Evas_Object *parent = ad->nf; + Evas_Object *index; + int i = 0, j, len; + char *str; + char buf[PATH_MAX] = {0, }; + + index = elm_index_add(parent); + elm_object_part_content_set(parent, "elm.swallow.fastscroll", index); + elm_index_autohide_disabled_set(index, EINA_TRUE); + elm_index_omit_enabled_set(index, EINA_TRUE); + + /* 1. Special character & Numbers */ + elm_index_item_append(index, "#", NULL, NULL); + + /* 2. Local language */ + str = i18n_get_text("IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ"); + len = strlen(str); + + while (i < len) { + j = i; + eina_unicode_utf8_next_get(str, &i); + snprintf(buf, i - j + 1, "%s", str + j); + buf[i - j + 1] = 0; + + elm_index_item_append(index, buf, NULL, NULL); + } + elm_index_level_go(index, 0); + + evas_object_smart_callback_add(index, "selected", _index_selected_cb, ad); + //evas_object_smart_callback_add(index, "changed", _index_changed_cb, NULL); + //evas_object_smart_callback_add(index, "language,changed", _index_language_changed_cb, NULL); + + return index; +} + void launch_contact_selction_view(void *data) { appdata_s* ad = data; @@ -300,9 +589,24 @@ void launch_contact_selction_view(void *data) elm_panel_hidden_set(ad->panel, EINA_TRUE); } - elm_layout_theme_set(ad->layout, "layout", "application", "default"); - static Elm_Genlist_Item_Class itc; + + /* Modified */ + Evas_Object* layout = elm_layout_add(ad->nf); + elm_layout_theme_set(layout, "layout", "application", "searchbar_base"); + 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_show(layout); + + Evas_Object* searchbar_layout = create_searchbar(layout, ad); + elm_object_part_content_set(layout, "searchbar", searchbar_layout); + + Evas_Object* fs_layout = elm_layout_add(layout); + elm_layout_theme_set(fs_layout, "layout", "application", "fastscroll"); + elm_object_part_content_set(layout, "elm.swallow.content", fs_layout); + + Evas_Object* index = create_fastscroll(ad); + elm_object_part_content_set(fs_layout, "elm.swallow.fastscroll", index); Evas_Object* buddy_gen_list = elm_genlist_add(ad->nf); elm_list_mode_set(buddy_gen_list, ELM_LIST_COMPRESS); @@ -313,10 +617,14 @@ void launch_contact_selction_view(void *data) evas_object_size_hint_align_set(buddy_gen_list, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_data_set(buddy_gen_list, "app_data", ad); + elm_object_part_content_set(fs_layout, "elm.swallow.content", buddy_gen_list); + Eina_Bool all_items_selected = EINA_FALSE; evas_object_data_set(buddy_gen_list, "all_selected", (void *)((int)all_items_selected)); +#if 0 + static Elm_Genlist_Item_Class itc; - itc.item_style = "default_style"; + itc.item_style = "type1"; itc.func.text_get = on_buddy_name_get_cb; itc.func.content_get = on_buddy_selection_part_content_get_cb; itc.func.state_get = NULL; @@ -333,23 +641,38 @@ void launch_contact_selction_view(void *data) for (int i = 0; i < size; i++) { elm_genlist_item_append(buddy_gen_list, &itc, (void*)i, NULL, ELM_GENLIST_ITEM_NONE, on_buddy_selected, (void*)i); } - +#endif evas_object_show(buddy_gen_list); + _append_peer_item(buddy_gen_list, ad, ad->buddy_list); + + /* no contents */ + Evas_Object *nocontents = elm_layout_add(ad->nf); + elm_layout_theme_set(nocontents, "layout", "nocontents", "default"); + evas_object_size_hint_weight_set(nocontents, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(nocontents, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_object_part_text_set(nocontents, "elm.text", "No Items"); + evas_object_data_set(ad->nf, "no_contents_layout", nocontents); + + evas_object_data_set(ad->nf, "fs_layout", fs_layout); + evas_object_data_set(ad->nf, "fs_index", index); + evas_object_data_set(ad->nf, "main_layout", layout); + evas_object_data_set(ad->nf, "buddy_list", buddy_gen_list); + Evas_Object* done_btn = elm_button_add(ad->layout); - elm_object_style_set(done_btn, "naviframe/title_icon"); + elm_object_style_set(done_btn, "naviframe/title_right"); evas_object_smart_callback_add(done_btn, "clicked", on_done_buton_clicked, ad); - elm_object_text_set(done_btn, "Done"); + elm_object_text_set(done_btn, i18n_get_text("IDS_TGRAM_ACBUTTON_DONE_ABB")); evas_object_show(done_btn); Evas_Object* cancel_btn = elm_button_add(ad->layout); - elm_object_style_set(cancel_btn, "naviframe/title_icon"); + elm_object_style_set(cancel_btn, "naviframe/title_left"); evas_object_smart_callback_add(cancel_btn, "clicked", on_cancel_buton_clicked, ad); - elm_object_text_set(cancel_btn, "Cancel"); + elm_object_text_set(cancel_btn, i18n_get_text("IDS_TGRAM_ACBUTTON_CANCEL_ABB")); evas_object_show(cancel_btn); Elm_Object_Item* buddy_sel_nav_item = NULL; - buddy_sel_nav_item = elm_naviframe_item_push(ad->nf, "Select friends", NULL, NULL, buddy_gen_list, NULL); + buddy_sel_nav_item = elm_naviframe_item_push(ad->nf, i18n_get_text("IDS_TGRAM_TMBODY_SELECT_CONTACTS_ABB"), NULL, NULL, layout, NULL); elm_object_item_part_content_set(buddy_sel_nav_item, "title_right_btn", done_btn); elm_object_item_part_content_set(buddy_sel_nav_item, "title_left_btn", cancel_btn); diff --git a/TelegramTizen/src/telegramtizen.c b/TelegramTizen/src/telegramtizen.c index 3dafa96..79a5aca 100644 --- a/TelegramTizen/src/telegramtizen.c +++ b/TelegramTizen/src/telegramtizen.c @@ -11,6 +11,7 @@ #include "tg_start_messaging_view.h" #include "tg_user_info_view.h" #include "tg_chat_info_view.h" +#include "ucol.h" #include #include static void @@ -2784,6 +2785,8 @@ static void create_base_gui(appdata_s *ad) ecore_timer_add(2, on_load_main_view_requested, ad); } + + ucol_init(); //eina_list_free(user_info); } diff --git a/TelegramTizen/src/tg_search_peer_view.c b/TelegramTizen/src/tg_search_peer_view.c index 4803e4c..a3ad69a 100755 --- a/TelegramTizen/src/tg_search_peer_view.c +++ b/TelegramTizen/src/tg_search_peer_view.c @@ -9,6 +9,7 @@ #include "tg_db_wrapper.h" #include "tg_messaging_view.h" #include "contact_selection_view.h" +#include "ucol.h" #define COMMAND_MENU_ITEM_COUNT 2 @@ -31,9 +32,7 @@ static _command_item_info contact_screen_command_item_list[COMMAND_MENU_ITEM_COU }; -char* _util_get_first_char(char *input_text) - - +static char* _util_get_first_char(char *input_text) { /* int unicode_len = eina_unicode_utf8_get_len(input_text); int str_len = strlen(input_text); @@ -76,8 +75,13 @@ char* on_peer_list_name_requested(void *data, Evas_Object *obj, const char *part int id = (int) data; appdata_s* ad = evas_object_data_get(obj, "app_data"); + Eina_List *list = evas_object_data_get(obj, "result_list"); - user_data_with_pic_s *item = eina_list_nth(ad->search_peer_list, id); + if (!list) { + list = ad->search_peer_list; + } + + user_data_with_pic_s *item = eina_list_nth(list, id); if (!item) { return NULL; } @@ -155,12 +159,16 @@ Evas_Object* on_peer_list_image_requested(void *data, Evas_Object *obj, const ch if (!strcmp(part, "elm.icon.left") || !strcmp(part, "elm.icon.1") || !strcmp(part, "elm.swallow.icon") ) { int id = (int) data; appdata_s* ad = evas_object_data_get(obj, "app_data"); - int size = eina_list_count(ad->search_peer_list); + Eina_List *list = evas_object_data_get(obj, "result_list"); + if (!list) { + list = ad->search_peer_list; + } + int size = eina_list_count(list); if (size <= 0) { return eo; } - user_data_with_pic_s *item = eina_list_nth(ad->search_peer_list, id); + user_data_with_pic_s *item = eina_list_nth(list, id); user_data_s *user = item->use_data; Evas_Object *profile_pic = NULL; @@ -383,10 +391,11 @@ static void on_peer_item_clicked(void *data, Evas_Object *obj, void *event_info) launch_messaging_view_cb(ad, peer_id); } -static void _update_index_item(void *data, void *item_data, int id) +#if 0 +static void _update_index_item(void *data, void *item_data, int id, Eina_List *list) { appdata_s* ad = data; - user_data_with_pic_s* item = eina_list_nth(ad->search_peer_list, id); + user_data_with_pic_s* item = eina_list_nth(list, id); user_data_s* user = item->use_data; Evas_Object *index = evas_object_data_get(ad->nf, "fs_index"); @@ -407,6 +416,7 @@ static void _update_index_item(void *data, void *item_data, int id) elm_object_item_data_set(it, item_data); } +#endif static void _append_peer_item(Evas_Object *genlist, appdata_s *ad, Eina_List* item_list) { @@ -423,10 +433,11 @@ static void _append_peer_item(Evas_Object *genlist, appdata_s *ad, Eina_List* it int count = eina_list_count(item_list); + evas_object_data_set(genlist, "result_list", item_list); + if(count > 0) { for (i = 0; i < count; i++) { item = elm_genlist_item_append(genlist, &itc, (void *) i, NULL, ELM_GENLIST_ITEM_NONE, on_peer_item_clicked, (void*) i); - _update_index_item(ad, item, i); } } else { i = 1; @@ -472,7 +483,6 @@ static void _append_index_item(Evas_Object *genlist, appdata_s *ad) if(count > 0) { for (i = 0; i < count; i++) { item = elm_genlist_item_append(genlist, &itc, (void *) i, NULL, ELM_GENLIST_ITEM_NONE, on_peer_item_clicked, (void*) i); - _update_index_item(ad, item, i); } } else { i = 1; @@ -528,33 +538,58 @@ static void _on_search_entry_changed(void *data, Evas_Object *obj, void *event_i Evas_Object *main_layout = evas_object_data_get(ad->nf, "main_layout"); Evas_Object *index = evas_object_data_get(ad->nf, "fs_index"); + user_data_with_pic_s *item; + user_data_s* user; // = item->use_data; + if (!search_list) { DBG("search_list is null"); return; } elm_genlist_clear(search_list); - clear_search_list(ad); - elm_index_item_clear(index); entry_text = trim(elm_entry_markup_to_utf8(elm_object_text_get(obj))); - Eina_Bool is_name_null = EINA_FALSE; - if (strlen(entry_text) > 0) { - ad->search_peer_list = load_buddy_data_by_name(ad->user_id.id, entry_text); + Eina_List *result_list = NULL; + Eina_List *l = NULL; + + if (ucol_is_jamo(entry_text)) { + LOGD("entry_text is jamo, %s", entry_text); + EINA_LIST_FOREACH(ad->search_peer_list, l, item) { + int result; + user = item->use_data; + result = ucol_compare_first_letters(user->print_name, entry_text); + if (result == 0) { + result_list = eina_list_append(result_list, item); + } + } } else { - is_name_null = EINA_TRUE; - ad->search_peer_list = load_buddy_data_by_name(ad->user_id.id, NULL); + LOGD("entry_text is not jamo, %s", entry_text); + EINA_LIST_FOREACH(ad->search_peer_list, l, item) { + user = item->use_data; + + if (ucol_ncompare(user->print_name, entry_text, strlen(entry_text)) == 0) { + result_list = eina_list_append(result_list, item); + } + } } - if (ad->search_peer_list) { + if ((entry_text == NULL || strlen(entry_text) == 0) && result_list == NULL) { + result_list = ad->search_peer_list; + _append_command_item(search_list, ad); + } + + LOGD("count of result_list is %d", eina_list_count(result_list)); + + if (result_list) { Evas_Object *fs_layout = evas_object_data_get(ad->nf, "fs_layout"); - if (is_name_null) { - _append_command_item(search_list, ad); + _append_peer_item(search_list, data, result_list); + Evas_Object *content = elm_object_part_content_unset(main_layout, "elm.swallow.content"); + if (evas_object_data_get(ad->nf, "no_contents_layout") == content) { + evas_object_hide(content); } - _append_peer_item(search_list, data, ad->search_peer_list); - elm_object_part_content_unset(main_layout, "elm.swallow.content"); elm_object_part_content_set(main_layout, "elm.swallow.content", fs_layout); + } else { Evas_Object *no_contents = evas_object_data_get(ad->nf, "no_contents_layout"); @@ -580,7 +615,7 @@ static void _on_search_entry_focused(void *data, Evas_Object *obj, void *event_i } -Evas_Object *_create_searchbar(Evas_Object* parent, void* data) +static Evas_Object *_create_searchbar(Evas_Object* parent, void* data) { char edj_path[PATH_MAX] = {0, }; app_get_resource(TELEGRAM_INIT_VIEW_EDJ, edj_path, (int)PATH_MAX); @@ -636,69 +671,64 @@ static void _index_selected_cb(void *data, Evas_Object *obj, void *event_info) //tg_peer_info_s* user = item->use_data; Eina_List* list = ad->search_peer_list; - int index = 0; - while (list) { - //const char *part_text = elm_object_item_part_text_get(gl_item, "elm.text"); - //const char *part_text = elm_object_item_data_get(gl_item); - gl_item = eina_list_data_get(list); - char *part_text = gl_item->use_data->print_name; - - const char *index_letter = elm_index_item_letter_get(event_info); - - int unicode_len = eina_unicode_utf8_get_len(part_text); - int str_len = strlen(part_text); - int lang_byte = str_len/unicode_len+(str_len%unicode_len > 0 ? 1: 0); - char *compare_text = strndup(part_text, lang_byte); + Eina_List *l; - Elm_Object_Item *item = elm_genlist_nth_item_get(search_list, index); - - if (!strcasecmp(index_letter, compare_text)) { - elm_genlist_item_show(item, ELM_GENLIST_ITEM_SCROLLTO_TOP); + EINA_LIST_FOREACH(list, l, gl_item) { + if (ucol_compare_first_letters(gl_item->use_data->print_name, elm_index_item_letter_get(event_info)) == 0) { break; } - //gl_item = elm_genlist_item_next_get(gl_item); - list = eina_list_next(list); index++; } -} -static Evas_Object* create_fastscroll(appdata_s *ad) -{ - Evas_Object *parent = ad->nf; - Evas_Object *index; - int i = 0, j, len; - char *str; - char buf[PATH_MAX] = {0, }; + if (eina_list_count(list) == index) { + return; + } - index = elm_index_add(parent); - elm_object_part_content_set(parent, "elm.swallow.fastscroll", index); - elm_index_autohide_disabled_set(index, EINA_TRUE); - elm_index_omit_enabled_set(index, EINA_TRUE); + if (list == ad->search_peer_list) { + index += 2; + } - /* 1. Special character & Numbers */ - elm_index_item_append(index, "#", NULL, NULL); + Elm_Object_Item *item = elm_genlist_nth_item_get(search_list, index); + elm_genlist_item_show(item, ELM_GENLIST_ITEM_SCROLLTO_TOP); +} - /* 2. Local language */ - str = dgettext("efl-extension", "IDS_EA_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ"); - len = strlen(str); +static Evas_Object* create_fastscroll(appdata_s *ad) + { + Evas_Object *parent = ad->nf; + Evas_Object *index; + int i = 0, j, len; + char *str; + char buf[PATH_MAX] = {0, }; + + index = elm_index_add(parent); + elm_object_part_content_set(parent, "elm.swallow.fastscroll", index); + elm_index_autohide_disabled_set(index, EINA_TRUE); + elm_index_omit_enabled_set(index, EINA_TRUE); + + /* 1. Special character & Numbers */ + elm_index_item_append(index, "#", NULL, NULL); + + /* 2. Local language */ + str = i18n_get_text("IDS_COM_BODY_ABCDEFGHIJKLMNOPQRSTUVWXYZ"); + len = strlen(str); + + while (i < len) { + j = i; + eina_unicode_utf8_next_get(str, &i); + snprintf(buf, i - j + 1, "%s", str + j); + buf[i - j + 1] = 0; + + elm_index_item_append(index, buf, NULL, NULL); + } + elm_index_level_go(index, 0); - while (i < len) { - j = i; - eina_unicode_utf8_next_get(str, &i); - snprintf(buf, i - j + 1, "%s", str + j); - buf[i - j + 1] = 0; + evas_object_smart_callback_add(index, "selected", _index_selected_cb, ad); + //evas_object_smart_callback_add(index, "changed", _index_changed_cb, NULL); + //evas_object_smart_callback_add(index, "language,changed", _index_language_changed_cb, NULL); - elm_index_item_append(index, buf, NULL, NULL); + return index; } - elm_index_level_go(index, 0); - - evas_object_smart_callback_add(index, "selected", _index_selected_cb, ad); - //evas_object_smart_callback_add(index, "changed", _index_changed_cb, NULL); - //evas_object_smart_callback_add(index, "language,changed", _index_language_changed_cb, NULL); - - return index; -} static Evas_Object* create_genlist(appdata_s *ad, Evas_Object *layout) @@ -760,6 +790,6 @@ void launch_start_peer_search_view(appdata_s* ad) evas_object_data_set(ad->nf, "main_layout", layout); evas_object_data_set(ad->nf, "search_list", peer_list); - elm_naviframe_item_push(ad->nf, "Contacts", NULL, NULL, layout, NULL); + elm_naviframe_item_push(ad->nf, i18n_get_text("IDS_TGRAM_HEADER_CONTACTS_ABB"), NULL, NULL, layout, NULL); } diff --git a/TelegramTizen/src/ucol.c b/TelegramTizen/src/ucol.c new file mode 100755 index 0000000..a073527 --- /dev/null +++ b/TelegramTizen/src/ucol.c @@ -0,0 +1,851 @@ +/* + * Add Viewer + * + * Copyright (c) 2000 - 2013 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. + * + */ + +#define _GNU_SOURCE + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include + +#include "ucol.h" + +static struct info { + i18n_ucollator_h coll; + enum LANGUAGE lang; + char *env_lang; +} s_info = { + .coll = NULL, + .lang = LANG_ENGLISH, + .env_lang = NULL, +}; + + int ucol_init(void) +{ + const char *env; + int status = I18N_ERROR_NONE; + + env = getenv("LANG"); + if (env) { + if (!strcasecmp(env, "en_US.utf-8")) { + s_info.lang = LANG_ENGLISH; + s_info.env_lang = "en_US.utf-8"; + } else if (!strcasecmp(env, "ja_JP.utf-8")) { + s_info.lang = LANG_JAPANESS; + s_info.env_lang = "ja_JP.utf-8"; + } else if (!strcasecmp(env, "ko_KR.utf-8")) { + s_info.lang = LANG_KOREAN; + s_info.env_lang = "ko_KR.utf-8"; + } + } + + status = i18n_ucollator_create(NULL, &s_info.coll); + if (I18N_ERROR_NONE != status) { + LOGE("Failed to open ucol (%d)\n", status); + i18n_ucollator_destroy(s_info.coll); + s_info.coll = NULL; + } + + status = I18N_ERROR_NONE; + status = i18n_ucollator_set_attribute(s_info.coll, I18N_UCOLLATOR_NORMALIZATION_MODE, I18N_UCOLLATOR_ON); + if (I18N_ERROR_NONE != status) { + LOGE("Failed to open ucol (%d)\n", status); + i18n_ucollator_destroy(s_info.coll); + s_info.coll = NULL; + } + + i18n_ucollator_set_strength(s_info.coll, I18N_UCOLLATOR_PRIMARY); + return 0; +} + +static inline i18n_uchar *to_UTF16(const char *src, int *out_len) +{ + i18n_uchar *res; + int status = I18N_ERROR_NONE; + int len; + + i18n_ustring_from_UTF8(NULL, 0, &len, src, -1, &status); + + res = malloc((len + 1) * sizeof(*res)); + if (!res) { + LOGE("malloc: %d\n", errno); + return NULL; + } + + status = I18N_ERROR_NONE; + i18n_ustring_from_UTF8(res, len + 1, &len, src, -1, &status); + if (I18N_ERROR_NONE != status) { + LOGE("Unable to convert(%s) to UTF16(%d)\n", src, status); + free(res); + return NULL; + } + res[len] = (i18n_uchar)0; + + if (out_len) { + *out_len = len; + } + return res; +} + +static inline char *to_UTF8(i18n_uchar *src, int *out_len) +{ + char *res; + int status = I18N_ERROR_NONE; + int len; + + i18n_ustring_to_UTF8(NULL, 0, &len, src, -1, &status); + + res = malloc((len + 1) * sizeof(*res)); + if (!res) { + LOGE("malloc: %d\n", errno); + return NULL; + } + + status = I18N_ERROR_NONE; + i18n_ustring_to_UTF8(res, len + 1, &len, src, -1, &status); + if (I18N_ERROR_NONE != status) { + LOGE("Unable to convert to UTF8(%d)\n", status); + free(res); + return NULL; + } + res[len] = '\0'; + + if (out_len) { + *out_len = len; + } + + return res; +} + +static inline int hangul_to_jamo(const char *index) +{ + Eina_Unicode *ret; + Eina_Unicode tmp = 0; + int base = 0xAC00; + int last = 0xD79F; + int a; + static int table[] = { + 0x00003131, 0x00003131, + 0x00003134, + 0x00003137, 0x00003137, + 0x00003139, + 0x00003141, + 0x00003142, 0x00003142, + 0x00003145, 0x00003145, + 0x00003147, + 0x00003148, 0x00003148, + 0x0000314a, + 0x0000314b, + 0x0000314c, + 0x0000314d, + 0x0000314e, + /* + 0xb184e3, 0xb284e3, 0xb484e3, 0xb784e3, 0xb884e3, 0xb984e3, + 0x8185e3, 0x8285e3, 0x8385e3, 0x8585e3, 0x8685e3, 0x8785e3, + 0x8885e3, 0x8985e3, 0x8a85e3, 0x8b85e3, 0x8c85e3, 0x8d85e3, + 0x8e85e3, + */ + }; + + ret = eina_unicode_utf8_to_unicode(index, &a); + if (ret) { + tmp = *ret; + free(ret); + } + + if (tmp < base || tmp > last) { + return tmp; + } + + tmp = tmp - base; + a = tmp / (21 * 28); + return table[a]; +} + +#define __isalpha(a) (((a) >= 'a' && (a) <= 'z') || ((a) >= 'A' && (a) <= 'Z')) +#define __tolower(a) (((a) >= 'A' && (a) <= 'Z') ? (a) + 32 : (a)) + + int ucol_compare_first_letters(const char *name, const char *letters) +{ + if (ucol_is_hangul(letters)) { + int jamo_name; + int jamo_letters = 0; + Eina_Unicode *ucs; + + jamo_name = hangul_to_jamo(name); + + ucs = eina_unicode_utf8_to_unicode(letters, &jamo_letters); + if (ucs) { + jamo_letters = (int)*ucs; + free(ucs); + } + + if (__isalpha(jamo_letters)) { + if (!__isalpha(jamo_name)) { + //LOGD("%d - %d (%s, %s)\n", jamo_name, jamo_letters, name, letters); + return -1; + } + + return __tolower(jamo_name) - __tolower(jamo_letters); + } + + return jamo_name - jamo_letters; + } + + return ucol_ncompare(name, letters, strlen(letters)); +} + + int ucol_is_jamo(const char *name) +{ + i18n_uchar *uni; + int name_len = 0; + int lang = 0; + + uni = to_UTF16(name, &name_len); + if (!uni) { + LOGE("DEST: Failed to convert to UTF16\n"); + return 0; + } + + i18n_uchar_get_ublock_code(*uni, &lang); + free(uni); + switch (lang) { + case I18N_UCHAR_UBLOCK_HANGUL_JAMO: + case I18N_UCHAR_UBLOCK_HANGUL_COMPATIBILITY_JAMO: + case I18N_UCHAR_UBLOCK_HANGUL_JAMO_EXTENDED_A: + case I18N_UCHAR_UBLOCK_HANGUL_JAMO_EXTENDED_B: + return 1; + case I18N_UCHAR_UBLOCK_HANGUL_SYLLABLES: + default: + break; + } + + return 0; +} + +int ucol_is_hangul(const char *name) +{ + i18n_uchar *uni; + int name_len = 0; + int lang = 0; + + uni = to_UTF16(name, &name_len); + if (!uni) { + LOGE("DEST: Failed to convert to UTF16\n"); + return 0; + } + + i18n_uchar_get_ublock_code(*uni, &lang); + free(uni); + switch (lang) { + case I18N_UCHAR_UBLOCK_HANGUL_JAMO: + case I18N_UCHAR_UBLOCK_HANGUL_COMPATIBILITY_JAMO: + case I18N_UCHAR_UBLOCK_HANGUL_JAMO_EXTENDED_A: + case I18N_UCHAR_UBLOCK_HANGUL_JAMO_EXTENDED_B: + case I18N_UCHAR_UBLOCK_HANGUL_SYLLABLES: + return 1; + default: + break; + } + + return 0; + } + + + int ucol_is_alpha(const char *name) +{ + Eina_Unicode *ucs; + int len; + int letter = 0; + + ucs = eina_unicode_utf8_to_unicode(name, &len); + if (ucs) { + letter = (int)*ucs; + free(ucs); + } + + return __isalpha(letter); +} + + int ucol_detect_lang(int ch) +{ + // int result; + int lang; + // int status; + // int size; + + /* + u_strToUpper((UChar *)&ch, 1, (UChar *)&result, -1, NULL, &status); + if (U_FAILURE(status)) { + LOGE("u_strToLower: %s\n", u_errorName(status)); + return LANG_UNKNOWN; + } + + size = unorm_normalize((UChar *)&result, 1, UNORM_NFD, 0, (UChar *)&result, 1, &status); + if (U_FAILURE(status)) { + LOGE("unorm_normalize: %s\n", u_errorName(status)); + return LANG_UNKNOWN; + } + */ + + i18n_uchar_get_ublock_code(ch, &lang); + switch (lang) { + case I18N_UCHAR_UBLOCK_HIRAGANA: + case I18N_UCHAR_UBLOCK_KATAKANA: + case I18N_UCHAR_UBLOCK_KATAKANA_PHONETIC_EXTENSIONS: + case I18N_UCHAR_UBLOCK_JAVANESE: + case I18N_UCHAR_UBLOCK_HALFWIDTH_AND_FULLWIDTH_FORMS: + lang = LANG_JAPANESS; + break; + case I18N_UCHAR_UBLOCK_HANGUL_JAMO: + case I18N_UCHAR_UBLOCK_HANGUL_COMPATIBILITY_JAMO: + case I18N_UCHAR_UBLOCK_HANGUL_SYLLABLES: + case I18N_UCHAR_UBLOCK_HANGUL_JAMO_EXTENDED_A: + case I18N_UCHAR_UBLOCK_HANGUL_JAMO_EXTENDED_B: + lang = LANG_KOREAN; + break; + case I18N_UCHAR_UBLOCK_BASIC_LATIN: // = 1, /*[0000]*/ + case I18N_UCHAR_UBLOCK_LATIN_1_SUPPLEMENT: // =2, /*[0080]*/ + case I18N_UCHAR_UBLOCK_LATIN_EXTENDED_A: // =3, /*[0100]*/ + case I18N_UCHAR_UBLOCK_LATIN_EXTENDED_B: // =4, /*[0180]*/ + case I18N_UCHAR_UBLOCK_LATIN_EXTENDED_ADDITIONAL: // =38, /*[1E00]*/ + lang = LANG_ENGLISH; + break; + case I18N_UCHAR_UBLOCK_CJK_RADICALS_SUPPLEMENT: //=58, /*[2E80]*/ + case I18N_UCHAR_UBLOCK_CJK_SYMBOLS_AND_PUNCTUATION: //=61, /*[3000]*/ + case I18N_UCHAR_UBLOCK_ENCLOSED_CJK_LETTERS_AND_MONTHS: //=68, /*[3200]*/ + case I18N_UCHAR_UBLOCK_CJK_STROKES: // =130, /*[31C0]*/ + case I18N_UCHAR_UBLOCK_CJK_COMPATIBILITY: // =69, /*[3300]*/ + case I18N_UCHAR_UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A: //=70, /*[3400]*/ + case I18N_UCHAR_UBLOCK_CJK_UNIFIED_IDEOGRAPHS: //=71, /*[4E00]*/ + case I18N_UCHAR_UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS: //=79, /*[F900]*/ + case I18N_UCHAR_UBLOCK_CJK_COMPATIBILITY_FORMS: //=83, /*[FE30]*/ + case I18N_UCHAR_UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B : // =94, /*[20000]*/ + case I18N_UCHAR_UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT: // =95, /*[2F800]*/ + case I18N_UCHAR_UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C: // =197, /*[2A700]*/ + case I18N_UCHAR_UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D: // =209, /*[2B740]*/ + lang = LANG_CHINESS; + break; + default: + LOGD("Detected unknown: %d\n", lang); + lang = LANG_UNKNOWN; + break; + } + + return lang; +} + +static char *ucol_toupper(const char *haystack) +{ + i18n_uchar *_haystack; + i18n_uchar *u_haystack; + int haystack_len; + int status = I18N_ERROR_NONE; + int ret; + char *utf8_ret; + + u_haystack = to_UTF16(haystack, &haystack_len); + if (!u_haystack) { + // Error will be printed by to_UTF16 + return NULL; + } + + haystack_len = i18n_ustring_to_upper(NULL, 0, u_haystack, -1, NULL, &status); + + _haystack = malloc(sizeof(*_haystack) * (haystack_len + 1)); + if (!_haystack) { + LOGE("malloc: %d\n", errno); + free(u_haystack); + return NULL; + } + + //ret = u_strFoldCase((UChar *)_haystack, haystack_len, (UChar *)haystack, -1, U_FOLD_CASE_DEFAULT, &status); + status = I18N_ERROR_NONE; + ret = i18n_ustring_to_upper(_haystack, haystack_len + 1, u_haystack, -1, NULL, &status); + free(u_haystack); + if (I18N_ERROR_NONE != status) { + LOGE("upper: %d\n", status); + free(_haystack); + return NULL; + } + + utf8_ret = to_UTF8(_haystack, &ret); + free(_haystack); + + return utf8_ret; +} + + int ucol_case_ncompare(const char *src, const char *dest, int len) +{ + char *_src; + char *_dest; + int ret; + + if (!src || !dest || len <= 0) { + return -EINVAL; + } + + if (!s_info.coll) { + LOGE("Fallback to strncasecmp\n"); + return strncasecmp(src, dest, len); + } + + _src = ucol_toupper(src); + if (!_src) { + return -EFAULT; + } + + _dest = ucol_toupper(dest); + if (!_dest) { + free(_src); + return -EFAULT; + } + + ret = ucol_ncompare(_src, _dest, len); + + free(_src); + free(_dest); + return ret; +} + + int ucol_ncompare(const char *src, const char *dest, int len) +{ + i18n_uchar *src_uni; + i18n_uchar *dest_uni; + i18n_ucollator_result_e res; + int32_t dest_len; + int32_t src_len; + char *tmp; + + if (!src || !dest || len <= 0) { + return -EINVAL; + } + + if (!s_info.coll) { + LOGE("Fallback to strcmp\n"); + return strncmp(src, dest, len); + } + + tmp = malloc(len + 1); + if (!tmp) { + LOGE("malloc: %d\n", errno); + return strncmp(src, dest, len); + } + strncpy(tmp, dest, len); + tmp[len] = '\0'; + + /* To get the ucs16 len */ + src_uni = to_UTF16(tmp, &len); + free(tmp); + if (!src_uni) { + LOGE("Failed get utf16\n"); + return strncmp(src, dest, len); + } + free(src_uni); + + src_uni = to_UTF16(src, &src_len); + if (!src_uni) { + LOGE("SRC: Failed to convert to UTF16\n"); + return strncmp(src, dest, len); + } + + dest_uni = to_UTF16(dest, &dest_len); + if (!dest_uni) { + LOGE("DEST: Failed to convert to UTF16\n"); + free(src_uni); + return strncmp(src, dest, len); + } + + switch (s_info.lang) { + case LANG_JAPANESS: + if (__isalpha(*src_uni) && !__isalpha(*dest_uni)) { + res = I18N_UCOLLATOR_GREATER; + } else if (!__isalpha(*src_uni) && __isalpha(*dest_uni)) { + res = I18N_UCOLLATOR_LESS; + } else { + int src_lang; + int dest_lang; + + src_lang = ucol_detect_lang(*src_uni); + dest_lang = ucol_detect_lang(*dest_uni); + + if (src_lang == LANG_JAPANESS && dest_lang != LANG_JAPANESS) { + res = I18N_UCOLLATOR_LESS; + } else if (src_lang != LANG_JAPANESS && dest_lang == LANG_JAPANESS) { + res = I18N_UCOLLATOR_GREATER; + } else { + i18n_ucollator_str_collator(s_info.coll, src_uni, len, dest_uni, len, &res); + } + } + break; + case LANG_KOREAN: + if (__isalpha(*src_uni) && !__isalpha(*dest_uni)) { + res = I18N_UCOLLATOR_GREATER; + } else if (!__isalpha(*src_uni) && __isalpha(*dest_uni)) { + res = I18N_UCOLLATOR_LESS; + } else { + int src_lang; + int dest_lang; + + src_lang = ucol_detect_lang(*src_uni); + dest_lang = ucol_detect_lang(*dest_uni); + + if (src_lang == LANG_KOREAN && dest_lang != LANG_KOREAN) { + res = I18N_UCOLLATOR_LESS; + } else if (src_lang != LANG_KOREAN && dest_lang == LANG_KOREAN) { + res = I18N_UCOLLATOR_GREATER; + } else { + i18n_ucollator_str_collator(s_info.coll, src_uni, len, dest_uni, len, &res); + } + } + break; + case LANG_ENGLISH: + default: + /* + if (__isalpha(*src_uni) && !__isalpha(*dest_uni)) { + res = UCOL_LESS; + } else if (!__isalpha(*src_uni) && __isalpha(*dest_uni)) { + res = UCOL_GREATER; + } else { + */ + i18n_ucollator_str_collator(s_info.coll, src_uni, len, dest_uni, len, &res); + /* + } + */ + } + + free(src_uni); + free(dest_uni); + + switch (res) { + case I18N_UCOLLATOR_LESS: + return -1; + + case I18N_UCOLLATOR_EQUAL: + return 0; + + case I18N_UCOLLATOR_GREATER: + return 1; + + default: + LOGD("%s ? %s\n", src, dest); + return 0; + } +} + + int ucol_case_compare(const char *src, const char *dest) +{ + char *_src; + char *_dest; + int ret; + + if (!src || !dest) { + return -EINVAL; + } + + if (!s_info.coll) { + LOGE("Fallback to strcasecmp\n"); + return strcasecmp(src, dest); + } + + _src = ucol_toupper(src); + if (!_src) { + return -EFAULT; + } + + _dest = ucol_toupper(dest); + if (!_dest) { + free(_src); + return -EFAULT; + } + + ret = ucol_compare(_src, _dest); + free(_src); + free(_dest); + return ret; +} + + int ucol_compare(const char *src, const char *dest) +{ + i18n_uchar *src_uni; + i18n_uchar *dest_uni; + i18n_ucollator_result_e res; + int32_t dest_len; + int32_t src_len; + int len; + + if (!src || !dest) { + return -EINVAL; + } + + if (!s_info.coll) { + LOGE("Fallback to strcmp\n"); + return strcmp(src, dest); + } + + src_uni = to_UTF16(src, &src_len); + if (!src_uni) { + LOGE("SRC: Failed to convert to UTF16\n"); + return strcmp(src, dest); + } + + dest_uni = to_UTF16(dest, &dest_len); + if (!dest_uni) { + LOGE("DEST: Failed to convert to UTF16\n"); + free(src_uni); + return strcmp(src, dest); + } + + len = src_len > dest_len ? dest_len : src_len; + + switch (s_info.lang) { + case LANG_JAPANESS: + if (__isalpha(*src_uni) && !__isalpha(*dest_uni)) { + res = I18N_UCOLLATOR_GREATER; + } else if (!__isalpha(*src_uni) && __isalpha(*dest_uni)) { + res = I18N_UCOLLATOR_LESS; + } else { + int src_lang; + int dest_lang; + + src_lang = ucol_detect_lang(*src_uni); + dest_lang = ucol_detect_lang(*dest_uni); + + if (src_lang == LANG_JAPANESS && dest_lang != LANG_JAPANESS) { + res = I18N_UCOLLATOR_LESS; + } else if (src_lang != LANG_JAPANESS && dest_lang == LANG_JAPANESS) { + res = I18N_UCOLLATOR_GREATER; + } else { + i18n_ucollator_str_collator(s_info.coll, src_uni, len, dest_uni, len, &res); + } + } + break; + case LANG_KOREAN: + if (__isalpha(*src_uni) && !__isalpha(*dest_uni)) { + res = I18N_UCOLLATOR_GREATER; + } else if (!__isalpha(*src_uni) && __isalpha(*dest_uni)) { + res = I18N_UCOLLATOR_LESS; + } else { + int src_lang; + int dest_lang; + + src_lang = ucol_detect_lang(*src_uni); + dest_lang = ucol_detect_lang(*dest_uni); + + if (src_lang == LANG_KOREAN && dest_lang != LANG_KOREAN) { + res = I18N_UCOLLATOR_LESS; + } else if (src_lang != LANG_KOREAN && dest_lang == LANG_KOREAN) { + res = I18N_UCOLLATOR_GREATER; + } else { + i18n_ucollator_str_collator(s_info.coll, src_uni, len, dest_uni, len, &res); + } + } + break; + case LANG_ENGLISH: + default: + if (__isalpha(*src_uni) && !__isalpha(*dest_uni)) { + res = I18N_UCOLLATOR_LESS; + } else if (!__isalpha(*src_uni) && __isalpha(*dest_uni)) { + res = I18N_UCOLLATOR_GREATER; + } else { + i18n_ucollator_str_collator(s_info.coll, src_uni, len, dest_uni, len, &res); + } + } + + free(src_uni); + free(dest_uni); + + switch (res) { + case I18N_UCOLLATOR_LESS: + return -1; + + case I18N_UCOLLATOR_EQUAL: + if (src_len > dest_len) { + return 1; + } else if (src_len == dest_len) { + return 0; + } + + return -1; + + case I18N_UCOLLATOR_GREATER: + return 1; + + default: + LOGD("%s ? %s\n", src, dest); + return 0; + } +} + +static int util_get_utf8_len(char ch) + { + int idx_len; + if ((ch & 0x80) == 0x00) { + idx_len = 1; + } else if ((ch & 0xE0) == 0xC0) { + idx_len = 2; + } else if ((ch & 0xF0) == 0xE0) { + idx_len = 3; + } else if ((ch & 0xFC) == 0xF8) { + idx_len = 4; + } else if ((ch & 0xFE) == 0xFC) { + idx_len = 5; + } else if ((ch & 0xFF) == 0xFE) { + idx_len = 6; + } else { + idx_len = 1; + } + + return idx_len; + } + + + int ucol_case_search(const char *haystack, const char *needle) +{ + char *_haystack; + char *_needle; + const char *ptr; + int len; + int needle_len; + int idx; + int ret; + + if (!haystack || !needle) { + return -EINVAL; + } + + if (!s_info.coll) { + LOGE("Fallback to strcasestr\n"); + ptr = strcasestr(haystack, needle); + if (!ptr) { + return -ENOENT; + } + + return (int)(ptr - haystack); + } + + _haystack = ucol_toupper(haystack); + if (!_haystack) { + // Error will be printed by ucol_toupper + return -EFAULT; + } + + _needle = ucol_toupper(needle); + if (!_needle) { + // Error will be printed by ucol_toupper + free(_haystack); + return -EFAULT; + } + + needle_len = strlen(_needle); + len = strlen(_haystack) - needle_len; + if (len == 0) { + ret = ucol_compare(_haystack, _needle); + free(_needle); + free(_haystack); + return ret == 0 ? 0 : -ENOENT; + } else if (len < 0) { + free(_haystack); + free(_needle); + return -ENOENT; + } + + for (idx = 0; idx <= len; ) { + ret = ucol_ncompare(_haystack + idx, _needle, needle_len); + if (ret == 0) { + free(_haystack); + free(_needle); + return idx; + } + + idx += util_get_utf8_len(_haystack[idx]); + } + + free(_haystack); + free(_needle); + return -ENOENT; +} + + int ucol_search(const char *haystack, const char *needle) +{ + int ret; + int len; + const char *ptr; + int idx; + int needle_len; + + if (!haystack || !needle) { + return -EINVAL; + } + + if (!s_info.coll) { + LOGE("Fallback to strstr\n"); + ptr = strstr(haystack, needle); + if (!ptr) { + return -ENOENT; + } + + return (int)(ptr - haystack); + } + + needle_len = strlen(needle); + len = strlen(haystack) - needle_len; + if (len == 0) { + return ucol_compare(haystack, needle) == 0 ? 0 : -ENOENT; + } else if (len < 0) { + return -ENOENT; + } + + for (idx = 0; idx < len;) { + ret = ucol_ncompare(haystack + idx, needle, needle_len); + if (ret == 0) { + return idx; + } + + idx += util_get_utf8_len(haystack[idx]); + } + + return -ENOENT; +} + + int ucol_fini(void) +{ + if (s_info.coll) { + i18n_ucollator_destroy(s_info.coll); + s_info.coll = NULL; + } + return 0; +} + + const int ucol_current_lang(void) +{ + return s_info.lang; +} + +/* End of a file */ -- 2.7.4 From 864346e57e3ba52251f20bc770728d987a2f4acf Mon Sep 17 00:00:00 2001 From: "moon87.park" Date: Tue, 20 Oct 2015 22:32:15 +0900 Subject: [PATCH 07/16] [Telegram] Modify the contact list image Change-Id: Iab184a32a6351f0690eeb6244ec3c4ab24ce0d19 --- TelegramTizen/res/edje/telegram_init_screen.edc | 19 +++++++++++-------- .../res/images/telegram_list_thumb_image_bg.png | Bin 0 -> 2557 bytes .../res/images/telegram_list_thumb_image_multi.png | Bin 4443 -> 5259 bytes .../res/images/telegram_list_thumb_image_single.png | Bin 4163 -> 4843 bytes .../images/telegram_list_thumb_image_telegram.png | Bin 0 -> 3120 bytes TelegramTizen/src/tg_search_peer_view.c | 9 +++++---- TelegramTizen/tg_utils/tg_common.h | 1 + 7 files changed, 17 insertions(+), 12 deletions(-) create mode 100755 TelegramTizen/res/images/telegram_list_thumb_image_bg.png mode change 100644 => 100755 TelegramTizen/res/images/telegram_list_thumb_image_multi.png mode change 100644 => 100755 TelegramTizen/res/images/telegram_list_thumb_image_single.png create mode 100755 TelegramTizen/res/images/telegram_list_thumb_image_telegram.png diff --git a/TelegramTizen/res/edje/telegram_init_screen.edc b/TelegramTizen/res/edje/telegram_init_screen.edc index 578f629..45f6f72 100644 --- a/TelegramTizen/res/edje/telegram_init_screen.edc +++ b/TelegramTizen/res/edje/telegram_init_screen.edc @@ -116,6 +116,7 @@ collections { images { image: "camera_btn_gallery_mask.png" COMP; image: "telegram_date_divider.#.png" COMP; + image: "telegram_list_thumb_image_bg.png" COMP; } group { @@ -888,8 +889,8 @@ collections { precise_is_inside: 1; description { state: default 0.0; - rel1.relative: 0.0 0.05; - rel2.relative: 1.0 0.95; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; color: 250 250 250 0; } } @@ -899,20 +900,21 @@ collections { precise_is_inside: 1; description { state: default 0.0; - rel1.relative: 0.0 0.05; - rel2.relative: 1.0 0.95; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; image.normal: camera_btn_gallery_mask.png; } } part { name: content_bg; - type: RECT; + type: IMAGE; clip_to: masking; description { state: default 0.0; rel1.relative: 0.0 0.0; rel2.relative: 1.0 1.0; - color: 45 165 224 255; + image.normal: "telegram_list_thumb_image_bg.png"; + color: 250 250 250 255; } } part { @@ -3020,13 +3022,14 @@ group } part { name: content_bg; - type: RECT; + type: IMAGE; clip_to: masking; description { state: default 0.0; rel1.relative: 0.0 0.0; rel2.relative: 1.0 1.0; - color: 250 250 250 0; + image.normal: "telegram_list_thumb_image_bg.png"; + color: 250 250 250 255; } } part { diff --git a/TelegramTizen/res/images/telegram_list_thumb_image_bg.png b/TelegramTizen/res/images/telegram_list_thumb_image_bg.png new file mode 100755 index 0000000000000000000000000000000000000000..eb1e100ce546b575b11292636b7690702a332fcd GIT binary patch literal 2557 zcmbVOX;c$g7LE-H0s?6eL_|WO$eukUX#)+ZM0Np#L^cUYAdze)K>~Ioi%3{SP(eUO za5#zz-74+IuHXVHhL%M@OhY5BII`&2h+b-aCe&4K zl6K$WZiYa#V)+cFoaygJW{ZU`ERBzgLMQ>z5XfeCg@nb9=gMI*+&I370-tVdg~Rw9 z3Op3=kMfsLxjepCvXr|mIe@`Vj%SlNaCbM@W(64}5OU=#m_jHJ$;b){{39laRjp=ZkcJ3(DYuBT$K$C62FQ@pKxRM#SI<7!n4J zrr}9cR}z&*B@nS51T-CwTf%yaWO9~>&0UJi2jhOmV*eIPrb@Xixmd~&iv>#^5XckD z#WJ2)0;6st!0bZ#B91swX0O?vPt^ikDSr=_Lzjw$u#ftZ`Co}o!vI826aj-J;i;Os zJ&7c`Ckao-0YoeYg`>kiV>$niW=Jp@q^3Fkr&*RvUWrL8b=LKOD~SF%3lAoZLE_X?@eqp(RE+mT_W^ z{ourg6rNX}s=+!Zo6dOnP{;bTY9@`I;mJU4Y&Z8p*g4dEf8TQ2d{ zkJJnaW>Bv{Cmfd{fsCwr3EA6L7k&9@ti&!`Oei^FrqZs|x&KXE`sCEsM(_74>z5Ct zTBns4^}-`84{0HnO{Ti0nmD<;hu@7?>&;}*aWMu&qbB`|qC&H`nS_ZD$-e%4A~Zt# z{_-uG*m)ekP42^H)XADhBJJLcql*m_ltq$DBBvFxq!umk_??+ zdDTK+1~0?$?!5=L?vWr;GL+;Ir>}DBGpVe<}@Mfrmsho$@g!tedrn`?;pnR-uc#3bwLzy(xNtg?9J0eHB+V1 zy=0GckB12c8UR0(UVXod!7#j3ID68khrTbY&EODW!dJhpA8wYt^1PZT@u+i7e`Gcs z@^&QHo8>M+713MNoW1zC%6Jb~xct;ryARN^` zoplp=>VbfE`DWsbMI+t%xzS7}!q#U|#|G~Zhy4dSb zQQhNSHDyAn_${#&`W;{tH{U1jAgFFwB)_K%R#PfixlfcLaCxm$slB#+j`t2QdH48R zTUm1of_W+W_#ZJ=@wq$a2g=-_k>|$8VF)+l$a7tNXubEgd$IsMk5GtQ^#pC#4%&jmmbki+TpE#1#JUyqY9r5c7yNyoQ_!$@LndPS3oGCn0_|G8cb^&Sr7?0^X z8WPe!x68i%c9HQDJ9|sh)q4+zM(mDzuIsP+LiI@`_53ceYMzMU1sID-;l9TWA{t@)yw3@Auas_=Y5k_zl!g75QKdg=yKeM z+YnZ=yfZF;z?t>IuIsJtXfCWop`Ed~xx1sz=v`Kj(HTk53`@0$k{B%nOblmTVrkDF zCX5#*7Ar> zDdqNSXjJBda=4bFt=M<)T;iH{T^FBOj-IWe9ke!bh&*MNriQ#Xn7`1Qr5XnwI%4uE zt#kbxMI^;n^mJYBUq2PR*`7M>h;;2MFfPcSVHXtuBF5bZdUdylDYIy=Qd#e*j#g BBwGLg literal 0 HcmV?d00001 diff --git a/TelegramTizen/res/images/telegram_list_thumb_image_multi.png b/TelegramTizen/res/images/telegram_list_thumb_image_multi.png old mode 100644 new mode 100755 index 5fd92eb5fd869ff1a4c05192f6ff59fc0b37563f..33749f6e59e04d6ba1bcc885e943f9b5a1d5fce7 GIT binary patch delta 2570 zcmV+l3ib8dB8w>@iBL{Q4GJ0x0000DNk~Le0001D0001D2nGNE0IQ`24zVGg3V#W< zNkl0?I`_Q0hsF-S$Xlx`Zz8W7<3_cPQ zfrMZ*LeM`j8bwVcN`hEL1yNC>F&cc4SP^SmTUrq*LhWw1+jhI%*Ub3G@3-B%cW3UL zbMLu#?(E!eGHKJ!oO|y1p5O1B-+$|zT%}SWL*ubH<^5{|mIEt*BG3yg1C{^sUcxCrP6R_b88!XWT({rpD>%ZN~P0+#}p z0|N<4X$5!=*az%a>1jzK)&N_84JrwZL`9`!H*f$bFLWYuz#q*0kLc9s~a8lavm` zdwa2d{GQwsx~G2<3HqGz3}6oE)8BMh_GeQ2GH6N2KY$;(B%%-aFwkz;fp*|R2kXcb z@T{thYeHD=`Xjb; z68Ix-B5xJozbYZ7&{kp|ZCnpr5`~Cs41X84HdRMaNto8b+7RP* zbvfdupLWpJYMp>4cs&83fqb0~Z!&yHzk@ZQqLMI>fbGx&yxP&4vDQ%4_33(NO~f|C z8Q!hi)Tn3&UXq|8*N2-pdOH%AH^Hl@kvfzQkcP_)8(-z%WhQ~wHNdLg=s=x zk@wq5`3TbBB5$eNKw>`Y`?rq)55+))i`}2i#0(_jl7xv^Ug!V6h@?9DT_Eqk(7kMd zeg|#XjL8MMF`7q2H_2ye2c={l0B#SEl(z$4b=a4JgKex0a=KQ`BjUma?B#1M_G7@? zkibqYlz&uBeE@MayFk(fDr>6|(NFSduQ9;aBhf7rd`q{3yAxI|PSs)Faz7t8O27@k zPb`18A8~JgoCepzg;33%ULx`a3#Zo-9YEaPE-|j^=$??jp9a37eY+irUnh-KhzHr! zgrgBxjTP_mx!Xl z4|-xyU(-lDcMI@W$8DcM(phE-CqJSV`jLc4DPrax?}gczwMkt1MYzfCD<5)bs01o)z}#ZZcYISCKv>6#X$jz!MH8)5@E9No{rd|T@BjF zL{TeIE%!0%XN=4tqRmjPgta`UfZx!3IHd0#7S9=cC+|1tO!oQzB3v5E2=N7V;zpQa z#R~9@u0{3G0rv5PQ%Kmds0)12@OK587k@T=AJxG>fo17$nAF1(vjV9udx;oN;H5SIA8jHst^>9w@SL;WH6p1a)wUx! zOutl%@-PiJq$&VwktpSM2gY0|B2Fjxva69`4oGF{sT2|MIoza=+FJSN)I>8GT7L@- zBVHngv+-ychW!#TnT<(9aLh|YW#%6;B#Mfk2$1T{49QEwgrA5b*|;Q*b7Sr$;%Smi zu*%?x&3K78gPGelgBz6b1fKlvh9|S}Nes{6IlbRc#J+5N62qLa_7gFLoqIb&c(t@Y zhzO9w$uq=@gZL7xt3~McAl}C|C4Z`b1h_l(`+5B=%EogZ&PSYvGv`N5As&ly9r)>5 zlf4=dd*NODw0f?E`jGE%Nc_!zyerE2pJ3;s)ixO}PQlMEC^%Bg+fNukzv{<2P zLj=H|m|J$c5;+&INQOm7CgWDmns^Yn*Jf8^gL{F$EBjk%{MD9el#Z)ZP2Gt_DS|B# zCE$mIyd$AS(2dmR9k<=*+u{l2i0Ul9U0Z8>A&kKl2KND<%E*|9hktaEk`xgDcV%SE z!Nb5?!;VMPT7|pRSShzS3Ex5DH=!q`i=vUcbtX);AORKN^T-LDku-zLD>63&zfvo_ z6)*|B5BRQ&##~<-+lN#GZC&6bJPW)5sjzhd*Y#}2kposfgPUss(uiG1dDmW-jmCMg z_-5dKlB-3F8-vLCPk%p-qwzQ^JRe7{A-I*`LlV=DDdbF!fw)MBTOzzT4>`m2dfZ$B zl?2MV-ra~~%EyYNYMzIX3uZ4;t31tRVkO{bD$Um>K|+!eQEhki3E+dcISSg?R~BVGR-yT!th@FJ?AGJFRQa%w?~`YIr?`1hXDR&YMc* g3#XlkmcjoA0LR)dwZTzAyZ`_I07*qoM6N<$f}csYuK)l5 delta 1748 zcmV;_1}piCDcd3;iBL{Q4GJ0x0000DNk~Le0000(0000(2nGNE0LRL>bFm?w3V#NM zNklwZChyhc;3^13C8!B3)@2Li^0@eVP@>gy+ z{~|C9oC5}dlfV#=(Ki>$pk>qoHvrcGWdV#g4*U-MB;>?%os1~Z3~U9eGWZh5fFFUw zLQ+nVu>`mU*anm?qMKg=egM7(CUSv{Cg3h$1=+(S&;cAx$9>WvqZD`u*ndRs;0*Aw z1m8s?V*~I=maV}J)4-=d*J6;d4Y(T!liN519JFy88!|$`PGCFvgDzmd-z3h4j5eT! z{6jbJfgeKrn)=Q>B?3wM9u&(?n~a-*Rtr}umYO4)p@$30cNAN^%qCz*y0u9iaF36y zvl6&MlW@%e7l8A?-$}tNB!3T6B0$%I6!J0ZvJEdOdKP%h(gZcR(jFD+OMOPYW0ZP8;IGB=8n6YD>n$QfRqZ zL%qdKCak0mxY6R8;}QUETy7fZF<40t@V-sVs1rZaAp%@uNkj;^*ME`-#DX5MOtFiB zYsIp4s0SMTk`V@W8=~(<36M5v`)(=bQb7c`-?9KKlKYIf9N(q0HXRv_5(jjsu+%1& z_=(~^vBU6iIxH12Nr!Tg8jNIw4AW>x1REQ3y(8dh^-e$ef&;4zGv=+y3Bk{v9kTGM^kqQvS2WNh(Bo@{QQ+U4_CB=I>bh2L z*L`o+kx}nsinECq$v6VM>G=Pc1jN%RkWpi4NhWMcCLz zAK8{knb$_Y3O-&I;t%-I6uM^A?U@c07Zjd)zA-Th!a?D1Uo|8BgOZvPQc(=%r zW9X(N8zM%;)Vl&U@jl=q`O{U`&smfS5pkD`y2LE(NON^8#w;x2O#UPXIhcG^mbH)lrpLNqjF9-&mX#3>a0srwN6QK`HAzSWHNfBI<5K-T0vs*DT)%5 zBPc}Huh92b6p5I!9=i^nOviyTkr3ukiq;7h3crb| z^ni9SLxWq1Fz8%UsYOZl#d+Wgany3cuVOt2InSVU(*-b1nG?WkVsc>-Q*O!=A`(`! zL4P!sGMOCqx)I?;2B_Au0000dX_vsiJ8GlhAf6Qv~@pWMl7NZvna0thFoc8H zhd~Tr7ygGs&HA7nO(qdtSdN!t8D1PGyHVJMC*$isk+6b@h&ebL=VC=dDILKMJc|A( zJ#9(EQmn-*q9o*rktiki<1rkc=|ps36)uTHG$RJF1%HkE&Wt1CY+N4K{eM=#e%yn< zL?xi*i8u{!iJNdMVgP@{-&>W4F1$7_L!DY5kK=cEzLkhL9am%F470lq_l|n z(zq9#G=mM{NAR0SOw$oD8*j%sZQ_-94nK>3n}&#a_&{_;v=fG~3IA#aB6=eU3$!PW z;n#R5PaVN*JUSK+YoyEA;nD?`t(Sf%{>G<1JE-+R7z84z{5+;yw zW%M8=FA-gMZ0{B8*((d-j!I3Dm%C3i0DqdMD*gUNxt(4 zwqO$3BGx465DIxt5V1hM1%>^1b$^4@(p~s`6#MHIFsi>72)?ZA@k{x{t*c=HV=?QLap~hi8vAykw&39$9=|>CW~s8dcSe`R?wo&xyK!%o&*w)wC55%!Q@S+GO>o0K_;C}E zPz(0qCx1ddRMzM&B_c&u_g$K(_eBjjCe%D6B_eB$>4=cq(`wk6U~}&rZ_s6ly%JRK zXSk$hiP2_9-C z-q1p1tcwAkyV+m#7NF
>m%I+;)n)WD=7Y0j-7%1i=Hw=uIh~Z*Ra>28uM2w8SQ6MQs#uLFlFC*sj!ev;t@ zbALUai06cJ77Ap)EcI6-g3z42K(=^1?#We&cu0sb7sw71e(dFl7?MHDw= zovee|$@p~qTQ53=^4&9p8i3P;{H9iE+JAdQ@Qe-$*?vz)m&8=V%D1S}%)ORYa`kq% zJY5LBpCf(KtrU1hNZ;>QdoXR%ZkM$-SG?BbDe6mwJfP)mveX=k+U0$!SG67#nkycd zE)j&%*H2VfR_5UfY5O}h6ZYfIDq7}kYN(K{rvdL8q2j+3tA!?rMYHzcx&D%K5uB1Si%4U?&4ZAikGgx(-h z5kcs&eN{om2@-C=x2C+FHQ@NOOMivd4X3s#2}kfbd~aGCOM?ysT!lXgRr~FPgF^Ss z+o!$5H}HteKH)&si`s;Q9m0`kTN`n)Miw*f7J9h;z|4B8(md;93P9W zkeOKgau{C`dWsJ=^1@jjEZ!&h;IGhn)uiR{pm4TDCP{c%)>-e4Yv?svJAdVWAR1}s z%PwT4ev-Z~P dM6?b5KLB2O+J+osVs8Kd002ovPDHLkV1lbFm?w3V#J| zNkljzQ64@9G4f|{s76YV&pY!o`Ab$;{fQ!I+U<#Ot;(=zB={`-sBA^+VFQ0}Y=Z^!! zz~8_i@Eb4$g!<+ZAzDT&umZRVn5Qt_Ip7rVgOHP}bTVpymB1>XF~pac1-=Ik2uT%1 zMlEm$&<)g=ahgv9hk&nviAo@&19%XaOLUk7_5j}nnLa_ts0W?|mQgwA1Ajgj=UX;1 zZUCN&*czO00oVl`D+d|fz(YWi%Eo@+3op~g3mFMuEpQL9j$ zC(CC_`Jv{@L*3;NtW5yl0Dl?atTOqJ180CSuMTvB1X^0C6I1Q8_=&v$WGv>8=sK`9#tfw9oX!X2xOYREKX1h4@iVvl8oiR z0>zxhMy0Vf0M{vv)gY;cqGTi#m(d2`1!d>^ocJCM+-YANk_7}xqkrPf(glwH6JX4= zM+aQ$WpxxIW2MrK8ZpV9LUG6B%=W#Y#6>!ZnIM zt*Hz+VN=8!%H`pUn;DCo~eiiAy7u1lWp6LbuD3dX>n4UGiOH1%Lb<*fz_eF@jq89g{>vv_0yVU%p_&)CST@>f2mS3{`=ilGBQNevmG%qg~*t|RH&;7r>(NWE?5p#85x&l z;p}9bj36fw6-Iy`i;CZ%3F}skuFwOd{m|o6$Aub_)XHq`n5=)$rV5=7?^n{5-g#WBkark!thz&!v U$`3~&p8x;=07*qoM6N<$f*_KsRR910 diff --git a/TelegramTizen/res/images/telegram_list_thumb_image_telegram.png b/TelegramTizen/res/images/telegram_list_thumb_image_telegram.png new file mode 100755 index 0000000000000000000000000000000000000000..67e1015938dc7ca4d746164ea6b266feb3686c74 GIT binary patch literal 3120 zcmbVOc{o&iAD=8`$uf#8#h9^-bv851GzMd4Buiq55@yW7WEN&dM#~^%iLzc@iF;K_ zij*tLmL-iysaxqL_m-x`T9S%x@95Tj-#_ki|9H=H&iO6p^Z9(2-}n1GC)>~0Lqp9_ z4Fm#dcy6Nj%SYz&qq0)|u06F~f_=ORk$kQ_V;N&F=Elj{AP~_-9LI=^1w;@g5Y6T}LuambKp||FGjto) z2k8^%4#coG?GXS0dwl7UdtxK;ET{_!LKG9^0$f1EfQY#qo{%7RhJMv0$mh%32q@$$ zL=@``{mZFfA3umYUjRU`_87ZJBnkz=;p|ZkSR4*z3qd1MXarJzlOybeNjwolY{wJA zzAI1wVWfZ^Ct~w?kYz;%lb;}RhRQwtD+F$wkI&!2JmI%Q$y0_9GvW{^dnAI(U5@K3 zS}5`d{_Dm+qJ{LNH~`@f2>A(uNcnk0!M>B_x%+oR%Rsp|ge?NL{7@Ji3O_P|3-Cmq z6lbXXi#?0YBH$co7!-|+awlWms8|%r35RmSQ!w&0xH;h5ozUMk{)tPaInprh?hZIK z9)m(rv1BC1iA-_8f zeldIzUl_xWgSZFaAnZ+En&L!8;?Nj8 z)_pl{vJ;+0#$#y?6ekQC=|F>i$^# z%TaBE)pv7I-UIojRX2UR^1Y-g4fo7`%u8*M?v>XoUJEvR6n*Q~}1?3zX#dOX#N?8cHbh&kk_f#uNLue`_38}W}k1Lam zg>WHqPQP;I2pDr5pY}15q;{twNqsIVs;02?trz%tplte#`kiciMMy8F_8tz4JdLbm z@{W{g_YSN&dKtCjU{AqFZ~4H!11+#ga_5|ZCA3ki=1?p3kxO0+BA47bkyMaGpeoKb z@c_w8$<3F&Sj(I@hjLWRo{S1)8yNcFIG5;t0;FFYKy2S&nDKI`T(@&O1bzlpNYs-pA2fNZh_8owQVUeURZ4 zwoe9oCb^~Ng4$cqkTFr#a4`1Mc3ZOVOAB6GZP;D+0aE;!EO+9D%IB+SYze0H`tEB5 zZ7+SVH=UaTZ-pEC+aB28Sg2fiqDFPGfB&;~QLar!Q?&($U&k~CFPyM(ZEW(cK3h)f z=?PZamKrnF9O^-_e3Q20`sWwc`KH4ew!`FrysS43DiuE|&b{Y&C|$I}`MrKTtbZ%z zT)vLXMQRgev&AZ$;yOM28*98%ub^Rc;+N8g1-U!hLSE67aC`IZ1)I}1n$#?sAZw}V z>J^U!XVVI;2#?%hYF4hbjBXYFJ&sC~;zQDOmsyE0R zzaTB&M=~(N&4(Tlf z!A&=d1MC9w@3QP%LKiS6JCZ&1m=P+@6)kUN2yNJ;-j&67s}*&g6oq8{Y5GR2x9Qn= zqVZ+qtmgr z=EC~--J8!UT;azvH>5hXmL~KBHzc14Ricm^TEg`^+Zx>NRpmc+5t}8U-p8v1O~Mp( zR&;_r7WvbFG%!``y=87}W?IkeGrQYiw*{I8s@-nP@Sn9vOTo{XbgLM5SZ>0`N}}P~ z>=Ub-!wOW+s8NHcTT{3njHWuX9=^KU-{gOPO-W9AGa&+;vJ#!7ra>Bg7c4UxSn%vi z4T0%4GHOGz@G9*PYbzx$cP=L%HY}J?)Fvfo)n9bS&dc;Kd7u5S$WB)R@WVRDx&`*7tU;=~`W^ z3^Cvoc-YJpC3RteX1553lkWYP?sw133CXn*e)V^cU*Azbp1$(Go z3S%k*@P1AG3u|;W>rv(J${U*;Ocg?!GwX|ZMDJUL9S%uemj=IV(yQ9uq8%M@u)HK37QX1r?iUWLzQJ03swS%unL;|7g3m#`*A@01O)L9)Bokbqr@ z6>ifKjn*>zgUF>n%0_25dGDj~7PMedsxCwsP*GEB8@b*V;ENl;W~R#H&_KW3P^9y3 zuTZ71nyr4Ru$nDdi;gyss0XF~>#Jj;cWnm!TA6mSEv`awaiXNzl09M#t%i zV%HZidSyV{PsdwL*Hd(oJ$nt|-DH;7vo1NtF;(5|+TN#&(+q=-MJV_;vx3xOO@`HqorvN+~zh*#l^jo7 zV4f5NPL&aLeh#{?>h-w!=&_OeSswFM>pO6|{;gyh_H3-j_U7a74};bTygZ89-M2j6 z)BZDymEL^i!u;Frr%nqh2BwNIsKVR)X(+yAm@5vslI}d?C4D#^Zo*uVk2+A+VH%eG z`+OEsaem+fnn23*Td%VsKQ3kFNL73Norz-~%_$1p9!W%2Vvsdx^=#2VsT59IP?o3{ zfG%2V7rB99uVrcq(@V}zrv@Y1y+$nSGQzT0CrI?5)6Ypc2X2Mg*1<3SZggN$NrQYe z)eJPL5JtKFK6+hg{gGn5Nj}0X(k9{9533$nP|&kn`nZDWkgh6V&Z3t?*MJxAQ1v9F w;gqIB4LdD`B$Dq%;>*jV0rI%UpKBsOBL(v&-NVndmjB^BslJpta>RlE0H1OeO#lD@ literal 0 HcmV?d00001 diff --git a/TelegramTizen/src/tg_search_peer_view.c b/TelegramTizen/src/tg_search_peer_view.c index a3ad69a..df6d224 100755 --- a/TelegramTizen/src/tg_search_peer_view.c +++ b/TelegramTizen/src/tg_search_peer_view.c @@ -26,8 +26,8 @@ static void on_group_chat_clicked(void *data, Evas_Object *obj, void *event_info static void on_secret_chat_clicked(void *data, Evas_Object *obj, void *event_info); static _command_item_info contact_screen_command_item_list[COMMAND_MENU_ITEM_COUNT] = { - {"invites friends", TELEGRAM_BUTTON_ADD_ICON, on_invite_friends_clicked, NULL}, - {"group chat", DEFAULT_LIST_THUMB_MULTI_PIC, on_group_chat_clicked, NULL}, + {"IDS_TGRAM_MBODY_INVITE_FRIENDS", TELEGRAM_CONTACT_ADD_ICON, on_invite_friends_clicked, NULL}, + {"IDS_TGRAM_MBODY_GROUP_CHAT", DEFAULT_LIST_THUMB_MULTI_PIC, on_group_chat_clicked, NULL}, /*{"secret chat", "telegram_list_thumb_image_secrete.png", on_secret_chat_clicked, NULL},*/ }; @@ -109,7 +109,7 @@ char* _on_command_name_requested(void *data, Evas_Object *obj, const char *part) if (!strcmp(part,"elm.text.main.left.top") || !strcmp(part,"elm.text")){ char buf[512] = {'\0'}; - snprintf(buf, 512, "%s", contact_screen_command_item_list[row].string); + snprintf(buf, 512, "%s", _(contact_screen_command_item_list[row].string)); return strdup(buf); } @@ -127,7 +127,7 @@ Evas_Object* _on_command_name_image_requested(void *data, Evas_Object *obj, cons Evas_Object *profile_pic = NULL; profile_pic = create_image_object_from_file(ui_utils_get_resource(contact_screen_command_item_list[row].image_path), obj); - //evas_object_color_set(profile_pic, 45, 165, 224, 255); + evas_object_color_set(profile_pic, 45, 165, 224, 255); char edj_path[PATH_MAX] = {0, }; app_get_resource(TELEGRAM_INIT_VIEW_EDJ, edj_path, (int)PATH_MAX); @@ -175,6 +175,7 @@ Evas_Object* on_peer_list_image_requested(void *data, Evas_Object *obj, const ch if (user->photo_path && strcmp(user->photo_path, "") != 0) { profile_pic = create_image_object_from_file(user->photo_path, obj); } else { + profile_pic = create_image_object_from_file(ui_utils_get_resource(DEFAULT_LIST_THUMB_SINGLE_PIC), obj); evas_object_color_set(profile_pic, 45, 165, 224, 255); } diff --git a/TelegramTizen/tg_utils/tg_common.h b/TelegramTizen/tg_utils/tg_common.h index 3a1a797..e160e53 100644 --- a/TelegramTizen/tg_utils/tg_common.h +++ b/TelegramTizen/tg_utils/tg_common.h @@ -79,6 +79,7 @@ #define DEFAULT_TELEGRAM_ICON FM_ICON_PATH"/tg_icon.png" #define TELEGRAM_BUTTON_ADD_ICON FM_ICON_PATH"/telegram_button_add.png" +#define TELEGRAM_CONTACT_ADD_ICON FM_ICON_PATH"/telegram_list_thumb_image_add.png" #define TELEGRAM_THUMB_ADD_ICON FM_ICON_PATH"/telegram_thumb_add.png" #define FM_ICON_CAMERA FM_ICON_PATH"floating_camera.png" -- 2.7.4 From 78d724411325cadda49575c9a3795a5ff52ff887 Mon Sep 17 00:00:00 2001 From: "polu.sandeep" Date: Tue, 20 Oct 2015 22:00:26 +0900 Subject: [PATCH 08/16] Made changes as per GUI guidelines Change-Id: Ie8d4b46adc837296aea4f7fd0d3da4f95437b0c7 --- TelegramTizen/inc/server_requests.h | 1 + TelegramTizen/src/server_requests.c | 65 ++++++- TelegramTizen/src/telegramtizen.c | 13 ++ TelegramTizen/src/tg_main_item_deletion_view.c | 224 ++++++++++++++++++++++--- TelegramTizen/src/tg_messaging_view.c | 70 +++++--- TelegramTizen/src/tg_user_main_view.c | 30 +++- TelegramTizen/tg_utils/tg_common.h | 2 + tg-engine-service/db_manager/tg_db_manager.c | 1 + tg-engine-service/inc/server_response.h | 2 + tg-engine-service/src/server_response.c | 29 ++++ tg-engine-service/src/tg-engine-service.c | 28 ++++ tg-engine-service/tg_engine/tg_engine.c | 57 +++++++ tg-engine-service/tg_engine/tg_engine.h | 2 + 13 files changed, 474 insertions(+), 50 deletions(-) diff --git a/TelegramTizen/inc/server_requests.h b/TelegramTizen/inc/server_requests.h index 18c2a1f..37f2142 100644 --- a/TelegramTizen/inc/server_requests.h +++ b/TelegramTizen/inc/server_requests.h @@ -16,6 +16,7 @@ void send_request_for_validation(service_client* service_client, const char* sms // type_of_chat 0-buddy, 1-group_chat 2-encrpted_chat void send_request_for_message_transport(appdata_s *ad, service_client* service_client, const int buddy_id, const int message_id, const int msg_type, const char* data, const int type_of_chat); void send_request_for_marked_as_read(service_client* service_client, const int buddy_id, const int type_of_chat); +void send_delete_selected_group_chats_request(service_client* service_client, Eina_List *sel_grp_chats); void send_delete_group_chat_request(service_client* service_client, const int chat_id); void send_add_buddy_request(service_client* service_client, const int buddy_id, const char *first_name, const char *last_name, const char *phone_number); void send_delete_buddy_request(service_client* service_client, const int buddy_id); diff --git a/TelegramTizen/src/server_requests.c b/TelegramTizen/src/server_requests.c index d2d4673..0782d0a 100644 --- a/TelegramTizen/src/server_requests.c +++ b/TelegramTizen/src/server_requests.c @@ -363,6 +363,69 @@ void send_unblock_buddy_request(service_client* service_client, const int buddy_ } + + +void send_delete_selected_group_chats_request(service_client* service_client, Eina_List *sel_grp_chats) +{ + if (!service_client || !sel_grp_chats) { + // error + return; + } + bundle *msg; + char tmp[50]; + char chat_id_key[50]; + int result; + msg = bundle_create(); + if (!msg) { + return; + } + + if (bundle_add_str(msg, "app_name", "Tizen Telegram") != 0) { + ERR("Failed to add data by key to bundle"); + bundle_free(msg); + return; + } + + if (bundle_add_str(msg, "command", "delete_selected_group_chats_request") != 0) { + ERR("Failed to add data by key to bundle"); + bundle_free(msg); + return; + } + + // add count + int list_size = eina_list_count(sel_grp_chats); + + char cnt_str[50] = {0,}; + sprintf(cnt_str, "%d", list_size); + + if (bundle_add_str(msg, "list_size", cnt_str) != 0) { + ERR("Failed to add data by key to bundle"); + bundle_free(msg); + return; + } + + // add chat ids + for (int i = 0; i < list_size ; i++) { + tg_main_list_item_s *item = eina_list_nth(sel_grp_chats, i); + snprintf(tmp, sizeof(tmp) - 1, "%d", item->peer_id); + snprintf(chat_id_key, sizeof(chat_id_key) - 1, "chat_id_%d", i); + + if (bundle_add_str(msg, chat_id_key, tmp) != 0) { + ERR("Failed to add data by key to bundle"); + bundle_free(msg); + return; + } + } + + result = service_client_send_message(service_client, msg); + if(result != SVC_RES_OK) { + // error + } + bundle_free(msg); +} + + + void send_delete_group_chat_request(service_client* service_client, const int chat_id) { if (!service_client) { @@ -395,8 +458,6 @@ void send_delete_group_chat_request(service_client* service_client, const int ch bundle_free(msg); return; } - - result = service_client_send_message(service_client, msg); if(result != SVC_RES_OK) { // error diff --git a/TelegramTizen/src/telegramtizen.c b/TelegramTizen/src/telegramtizen.c index 79a5aca..df5eeb7 100644 --- a/TelegramTizen/src/telegramtizen.c +++ b/TelegramTizen/src/telegramtizen.c @@ -1770,6 +1770,18 @@ static int _on_service_client_msg_received_cb(void *data, bundle *const rec_msg) if (app->current_app_state == TG_SET_USER_INFO_STATE) { on_user_unblock_response_received(app, buddy_id, is_success); } + } else if (strcmp(rec_key_val, "selected_group_chats_deleted_response") == 0) { + + if (app->current_app_state == TG_USER_MAIN_VIEW_SELECTION_STATE) { + elm_naviframe_item_pop(app->nf); + app->current_app_state = TG_USER_MAIN_VIEW_STATE; + show_floating_button(app); + load_buddy_list_data(app); + load_unknown_buddy_list_data(app); + load_peer_data(app); + load_main_list_data(app); + refresh_main_list_view(app, EINA_FALSE); + } } else if (strcmp(rec_key_val, "group_chat_deleted_response") == 0) { char* chat_id_str = NULL; @@ -2821,6 +2833,7 @@ app_create(void *data) ad->s_notififcation = NULL; ad->panel = NULL; ad->is_server_ready = EINA_FALSE; + ad->msg_count = 0; create_base_gui(ad); int err = badge_new(TELEGRAM_APP_ID); if (BADGE_ERROR_NONE != err) { diff --git a/TelegramTizen/src/tg_main_item_deletion_view.c b/TelegramTizen/src/tg_main_item_deletion_view.c index 3d5acf1..e846094 100644 --- a/TelegramTizen/src/tg_main_item_deletion_view.c +++ b/TelegramTizen/src/tg_main_item_deletion_view.c @@ -5,8 +5,10 @@ * Author: sandeep */ - #include "tg_main_item_deletion_view.h" +#include "tg_user_main_view.h" +#include "tg_db_manager.h" +#include "server_requests.h" static Evas_Object* create_image_object_from_file(const char *icon_name, Evas_Object *parent) { @@ -18,16 +20,8 @@ static Evas_Object* create_image_object_from_file(const char *icon_name, Evas_Ob return icon; } -static Evas_Object* create_check(Evas_Object *parent) -{ - Evas_Object *check; - check = elm_check_add(parent); - return check; -} - char* on_mainlist_title_requested(void *data, Evas_Object *obj, const char *part) { - int org_id = (int) data; if (org_id == 0) { if (!strcmp(part,"elm.text.main.left.top") || !strcmp(part,"elm.text")){ @@ -35,9 +29,7 @@ char* on_mainlist_title_requested(void *data, Evas_Object *obj, const char *part } return NULL; } - int id = org_id - 1; - appdata_s* ad = evas_object_data_get(obj, "app_data"); if (ad->main_list == NULL || eina_list_count(ad->main_list) <= 0) { @@ -63,32 +55,122 @@ char* on_mainlist_title_requested(void *data, Evas_Object *obj, const char *part } } + +void change_main_item_selection_state(appdata_s *ad, Evas_Object *gen_list, Eina_Bool checked, int org_id) +{ + if (!ad || !gen_list) { + return; + } + if (ad->main_list && eina_list_count(ad->main_list) > 0) { + if (org_id ==0) { + for (int i = 0 ; i < eina_list_count(ad->main_list) ; i++) { + tg_main_list_item_s *item = eina_list_nth(ad->main_list, i); + item->is_selected = checked; + Eina_Bool all_items_selected = checked; + evas_object_data_set(gen_list, "all_selected", (void *)((int)all_items_selected)); + Elm_Object_Item* list_item = elm_genlist_nth_item_get(gen_list, i + 1); + if (list_item) { + elm_genlist_item_selected_set(list_item, EINA_FALSE); + Evas_Object *llayout = elm_object_item_part_content_get(list_item, "elm.swallow.end"); + Evas_Object *lcheckbox = elm_object_part_content_get(llayout, "elm.swallow.content"); + elm_check_state_set(lcheckbox, checked); + } + } + } else { + tg_main_list_item_s *item = eina_list_nth(ad->main_list, org_id - 1); + item->is_selected = checked; + + if (!checked) { + Elm_Object_Item* list_item = elm_genlist_nth_item_get(gen_list, 0); + if (list_item) { + elm_genlist_item_selected_set(list_item, EINA_FALSE); + Evas_Object *llayout = elm_object_item_part_content_get(list_item, "elm.swallow.end"); + Evas_Object *lcheckbox = elm_object_part_content_get(llayout, "elm.swallow.content"); + elm_check_state_set(lcheckbox, EINA_FALSE); + } + } else { + Eina_Bool all_items_selected = EINA_TRUE; + for (int i = 0 ; i < eina_list_count(ad->main_list) ; i++) { + tg_main_list_item_s *item = eina_list_nth(ad->main_list, i); + if (!item->is_selected) { + all_items_selected = EINA_FALSE; + break; + } + } + Elm_Object_Item* list_item = elm_genlist_nth_item_get(gen_list, 0); + if (list_item) { + elm_genlist_item_selected_set(list_item, EINA_FALSE); + Evas_Object *llayout = elm_object_item_part_content_get(list_item, "elm.swallow.end"); + Evas_Object *lcheckbox = elm_object_part_content_get(llayout, "elm.swallow.content"); + elm_check_state_set(lcheckbox, all_items_selected); + } + } + } + } +} + +void on_main_item_checkbox_sel_cb(void *data, Evas_Object *obj, void *event_info) +{ + int org_id = (int) data; + appdata_s *ad = evas_object_data_get(obj, "app_data"); + Evas_Object *gen_list = evas_object_data_get(obj, "selection_gen_list"); + Eina_Bool checked = elm_check_state_get(obj); + change_main_item_selection_state(ad, gen_list, checked, org_id); +} + +void on_main_item_selected(void *data, Evas_Object *obj, void *event_info) +{ + int org_id = (int) data; + Elm_Object_Item *it = event_info; + elm_genlist_item_selected_set(it, EINA_FALSE); + Evas_Object *layout = elm_object_item_part_content_get(event_info, "elm.swallow.end"); + Evas_Object *checkbox = elm_object_part_content_get(layout, "elm.swallow.content"); + Eina_Bool checked = elm_check_state_get(checkbox); + appdata_s *ad = evas_object_data_get(checkbox, "app_data"); + checked = !checked; + elm_check_state_set(checkbox, checked); + change_main_item_selection_state(ad, obj, checked, org_id); +} + Evas_Object* on_mainlist_content_requested(void *data, Evas_Object *obj, const char *part) { int org_id = (int) data; + appdata_s* ad = evas_object_data_get(obj, "app_data"); + Evas_Object *eo = NULL; + int id = org_id - 1; + if (ad->main_list == NULL || eina_list_count(ad->main_list) <= 0) { + return NULL; + } if (!strcmp("elm.swallow.end", part)) { - return create_check(obj); + eo = elm_layout_add(obj); + elm_layout_theme_set(eo, "layout", "list/C/type.2", "default"); + Evas_Object *check = elm_check_add(obj); + elm_object_focus_set(check, EINA_FALSE); + evas_object_propagate_events_set(check, EINA_FALSE); + evas_object_data_set(check, "app_data", ad); + evas_object_data_set(check, "selection_gen_list", obj); + evas_object_smart_callback_add(check, "changed", on_main_item_checkbox_sel_cb, data); + elm_layout_content_set(eo, "elm.swallow.content", check); + if (org_id == 0) { + Eina_Bool all_items_selected = (Eina_Bool)evas_object_data_get(obj, "all_selected"); + elm_check_state_set(check, all_items_selected); + } else { + tg_main_list_item_s* item = eina_list_nth(ad->main_list, id); + elm_check_state_set(check, item->is_selected); + } + return eo; } if (org_id == 0) { return NULL; } - int id = org_id - 1; - - appdata_s* ad = evas_object_data_get(obj, "app_data"); - - if (ad->main_list == NULL || eina_list_count(ad->main_list) <= 0) { - return NULL; - } tg_main_list_item_s* item = eina_list_nth(ad->main_list, id); if (!item) { return NULL; } - - Evas_Object *eo = NULL; if (!strcmp(part, "elm.icon.left") || !strcmp(part, "elm.icon.1") || !strcmp(part, "elm.swallow.icon")) { //if (item->profile_pic == NULL) { Evas_Object *profile_pic = NULL; @@ -142,6 +224,76 @@ Evas_Object* on_mainlist_content_requested(void *data, Evas_Object *obj, const c } +void on_delete_selected_items_clicked(void *data, Evas_Object *object, void *event_info) +{ + appdata_s *ad = data; + if (!ad) + return; + + show_loading_popup(ad); + // delete users. + + Eina_List *sel_grp_chat = NULL; + + for (int i = 0; i < eina_list_count(ad->main_list); i++) { + tg_main_list_item_s* sel_item = eina_list_nth(ad->main_list, i); + if (sel_item && sel_item->is_selected) { + if (sel_item->peer_type == TGL_PEER_USER) { + char* tablename = get_table_name_from_number(sel_item->peer_id); + delete_all_records(tablename); + free(tablename); + + // delete from main list + if (sel_item->peer_print_name) { + free(sel_item->peer_print_name); + sel_item->peer_print_name = NULL; + } + if (sel_item->last_message) { + free(sel_item->last_message); + sel_item->last_message = NULL; + } + if (sel_item->profile_pic_path) { + free(sel_item->profile_pic_path); + sel_item->profile_pic_path = NULL; + } + sel_item->date_lbl = NULL; + sel_item->msg_status_lbl = NULL; + sel_item->main_item_layout = NULL; + sel_item->profile_pic = NULL; + sel_item->profile_pic_path = NULL; + sel_item->status_lbl = NULL; + sel_item->user_name_lbl = NULL; + //ad->main_list + ad->main_list = eina_list_remove(ad->main_list, sel_item); + } else if (sel_item->peer_type == TGL_PEER_CHAT) { + sel_grp_chat = eina_list_append(sel_grp_chat, sel_item); + } + } + } + + if (sel_grp_chat && eina_list_count(sel_grp_chat) > 0) { + send_delete_selected_group_chats_request(ad->service_client, sel_grp_chat); + } else { + refresh_main_list_view(ad, EINA_FALSE); + elm_naviframe_item_pop(ad->nf); + ad->current_app_state = TG_USER_MAIN_VIEW_STATE; + show_floating_button(ad); + hide_loading_popup(ad); + } +} + +void on_selection_cancel_clicked(void *data, Evas_Object *object, void *event_info) +{ + appdata_s *ad = data; + if (!ad) + return; + + elm_naviframe_item_pop(ad->nf); + ad->current_app_state = TG_USER_MAIN_VIEW_STATE; + show_floating_button(ad); +} + + void launch_main_item_deletion_view_cb(appdata_s* ad) { if (!ad) @@ -171,6 +323,8 @@ void launch_main_item_deletion_view_cb(appdata_s* ad) evas_object_show(bg_box); elm_object_part_content_set(layout, "main_box", bg_box); + + if (ad->main_list == NULL || eina_list_count(ad->main_list) <= 0) { return; } else { @@ -184,6 +338,10 @@ void launch_main_item_deletion_view_cb(appdata_s* ad) evas_object_data_set(buddy_list, "app_data", ad); elm_genlist_homogeneous_set(buddy_list, EINA_TRUE); + evas_object_data_set(buddy_list, "app_data", ad); + Eina_Bool all_items_selected = EINA_FALSE; + evas_object_data_set(buddy_list, "all_selected", (void *)((int)all_items_selected)); + itc.item_style = "type1"; itc.func.text_get = on_mainlist_title_requested; itc.func.content_get = on_mainlist_content_requested; @@ -193,7 +351,11 @@ void launch_main_item_deletion_view_cb(appdata_s* ad) int size = eina_list_count(ad->main_list); if(size > 0) { for (i = 0; i <= size; i++) { - elm_genlist_item_append(buddy_list, &itc, (void *) i, NULL, ELM_GENLIST_ITEM_NONE, NULL, (void*) i); + if (i < size) { + tg_main_list_item_s *item = eina_list_nth(ad->main_list, i); + item->is_selected = EINA_FALSE; + } + elm_genlist_item_append(buddy_list, &itc, (void *) i, NULL, ELM_GENLIST_ITEM_NONE, on_main_item_selected, (void*) i); } } else { i = 1; @@ -203,7 +365,21 @@ void launch_main_item_deletion_view_cb(appdata_s* ad) elm_box_pack_end(bg_box, buddy_list); } evas_object_data_set(ad->nf, "main_list_box", bg_box); - elm_naviframe_item_push(ad->nf, i18n_get_text("IDS_TGRAM_HEADER_SELECT_CHATS_ABB"), NULL, NULL, scroller, NULL); - + Elm_Object_Item* buddy_sel_nav_item = elm_naviframe_item_push(ad->nf, i18n_get_text("IDS_TGRAM_HEADER_SELECT_CHATS_ABB"), NULL, NULL, scroller, NULL); + + Evas_Object* delete_btn = elm_button_add(ad->layout); + elm_object_style_set(delete_btn, "naviframe/title_left"); + evas_object_smart_callback_add(delete_btn, "clicked", on_delete_selected_items_clicked, ad); + elm_object_text_set(delete_btn, i18n_get_text("IDS_TGRAM_OPT_DELETE")); + evas_object_show(delete_btn); + + Evas_Object* cancel_btn = elm_button_add(ad->layout); + elm_object_style_set(cancel_btn, "naviframe/title_right"); + evas_object_smart_callback_add(cancel_btn, "clicked", on_selection_cancel_clicked, ad); + elm_object_text_set(cancel_btn, i18n_get_text("IDS_TGRAM_BUTTON_CANCEL_ABB5")); + evas_object_show(cancel_btn); + + elm_object_item_part_content_set(buddy_sel_nav_item, "title_right_btn", delete_btn); + elm_object_item_part_content_set(buddy_sel_nav_item, "title_left_btn", cancel_btn); } diff --git a/TelegramTizen/src/tg_messaging_view.c b/TelegramTizen/src/tg_messaging_view.c index e6cf0d4..826ac68 100644 --- a/TelegramTizen/src/tg_messaging_view.c +++ b/TelegramTizen/src/tg_messaging_view.c @@ -860,7 +860,7 @@ Evas_Object *on_message_item_content_get_cb(void *data, Evas_Object *obj, const Evas_Object *ser_lbl = elm_label_add(obj); char temp_msg[4*256] = {0,}; - snprintf(temp_msg, sizeof(temp_msg), "%s", msg->message); + snprintf(temp_msg, sizeof(temp_msg), "%s", msg->message); elm_object_text_set(ser_lbl, temp_msg); elm_label_ellipsis_set(ser_lbl, EINA_TRUE); //evas_object_resize(ser_lbl, 200, 15); @@ -1281,7 +1281,8 @@ static Eina_Bool on_new_text_message_send_cb(void *data) if (!text_to_send || (strlen(text_to_send) == 0)) return ECORE_CALLBACK_CANCEL; - int unique_id = time(NULL); + ad->msg_count = ad->msg_count + 1001; + int unique_id = time(NULL) + ad->msg_count; tg_message_s msg; msg.msg_id = unique_id; msg.from_id = ad->current_user_data->user_id.id; @@ -1346,11 +1347,11 @@ static void on_text_message_send_clicked(void *data, Evas_Object *obj, void *eve return; if(add_date_item_to_chat(data)) { - ecore_timer_add(3, on_new_text_message_send_cb, chat_list); + ecore_timer_add(1, on_new_text_message_send_cb, chat_list); return; } - - int unique_id = time(NULL); + ad->msg_count = ad->msg_count + 1001; + int unique_id = time(NULL) + ad->msg_count; tg_message_s msg; msg.msg_id = unique_id; msg.from_id = ad->current_user_data->user_id.id; @@ -1527,20 +1528,35 @@ void on_user_presence_state_changed(appdata_s* ad, int buddy_id) } } +static Eina_Bool on_change_input_type_requested(void *data) +{ + Evas_Object* text_entry = data; + + elm_entry_input_panel_layout_set(text_entry, ELM_INPUT_PANEL_LAYOUT_EMOTICON); + elm_object_focus_set(text_entry, EINA_TRUE); + elm_entry_input_panel_show(text_entry); + + return ECORE_CALLBACK_CANCEL; +} + static void on_message_smiley_clicked(void *data, Evas_Object *obj, void *event_info) { Evas_Object* text_entry = data; - //elm_entry_input_panel_hide(text_entry); - elm_entry_input_panel_layout_set(text_entry,ELM_INPUT_PANEL_LAYOUT_EMOTICON); + elm_object_focus_set(obj, EINA_FALSE); + elm_object_focus_set(text_entry, EINA_FALSE); + elm_entry_input_panel_hide(text_entry); + ecore_timer_add(0.3, on_change_input_type_requested, text_entry); + /* + elm_entry_input_panel_layout_set(text_entry, ELM_INPUT_PANEL_LAYOUT_EMOTICON); elm_object_focus_set(text_entry, EINA_TRUE); - //elm_entry_input_panel_show(text_entry); + elm_entry_input_panel_show(text_entry);*/ } static void on_message_text_entry_clicked(void *data, Evas_Object *obj, void *event_info) { - //elm_entry_input_panel_hide(obj); + elm_entry_input_panel_hide(obj); elm_entry_input_panel_layout_set(obj,ELM_INPUT_PANEL_LAYOUT_NORMAL); - //elm_entry_input_panel_show(obj); + elm_entry_input_panel_show(obj); } @@ -1572,7 +1588,8 @@ static Eina_Bool on_new_contact_message_send_cb(void *data) peer_with_pic_s *sel_item = eina_list_nth(ad->peer_list, user_id); - int unique_id = time(NULL); + ad->msg_count = ad->msg_count + 1001; + int unique_id = time(NULL) + ad->msg_count; char unique_id_str[50]; sprintf(unique_id_str, "%d", unique_id); @@ -1641,14 +1658,15 @@ void send_contact_message_to_buddy(void *data, char *first_name, char *last_name evas_object_data_set(chat_list, "contact_last_name", strdup(last_name)); evas_object_data_set(chat_list, "contact_phone_number", strdup(phone_number)); - ecore_timer_add(3, on_new_contact_message_send_cb, chat_list); + ecore_timer_add(1, on_new_contact_message_send_cb, chat_list); return; } peer_with_pic_s *sel_item = eina_list_nth(ad->peer_list, user_id); - int unique_id = time(NULL); + ad->msg_count = ad->msg_count + 1001; + int unique_id = time(NULL) + ad->msg_count; char unique_id_str[50]; sprintf(unique_id_str, "%d", unique_id); @@ -1705,7 +1723,8 @@ static Eina_Bool on_new_location_message_send_cb(void *data) peer_with_pic_s *sel_item = eina_list_nth(ad->peer_list, user_id); - int unique_id = time(NULL); + ad->msg_count = ad->msg_count + 1001; + int unique_id = time(NULL) + ad->msg_count; char unique_id_str[50]; sprintf(unique_id_str, "%d", unique_id); @@ -1767,13 +1786,14 @@ void send_location_message_to_buddy(void *data, char *latitude, char *longitude) if(add_date_item_to_chat(data)) { evas_object_data_set(chat_list, "contact_latitude", strdup(latitude)); evas_object_data_set(chat_list, "contact_longitude", strdup(longitude)); - ecore_timer_add(3, on_new_location_message_send_cb, chat_list); + ecore_timer_add(1, on_new_location_message_send_cb, chat_list); return; } peer_with_pic_s *sel_item = eina_list_nth(ad->peer_list, user_id); - int unique_id = time(NULL); + ad->msg_count = ad->msg_count + 1001; + int unique_id = time(NULL) + ad->msg_count; char unique_id_str[50]; sprintf(unique_id_str, "%d", unique_id); @@ -1829,7 +1849,8 @@ static Eina_Bool on_new_media_message_send_cb(void *data) peer_with_pic_s *sel_item = eina_list_nth(ad->peer_list, user_id); - int unique_id = time(NULL); + ad->msg_count = ad->msg_count + 1001; + int unique_id = time(NULL) + ad->msg_count; char unique_id_str[50]; sprintf(unique_id_str, "%d", unique_id); @@ -1905,12 +1926,13 @@ void send_media_message_to_buddy(void *data, const char* file_path, enum tgl_mes evas_object_data_set(chat_list, "file_type", strdup(file_type_char)); evas_object_data_set(chat_list, "file_path", strdup(file_path)); - ecore_timer_add(3, on_new_media_message_send_cb, chat_list); + ecore_timer_add(1, on_new_media_message_send_cb, chat_list); return; } peer_with_pic_s *sel_item = eina_list_nth(ad->peer_list, user_id); - int unique_id = time(NULL); + ad->msg_count = ad->msg_count + 1001; + int unique_id = time(NULL) + ad->msg_count; char unique_id_str[50]; sprintf(unique_id_str, "%d", unique_id); @@ -2465,6 +2487,15 @@ static void on_message_smiley_unpressed(void *data, Evas_Object *obj, void *even evas_object_color_set(data, 45, 165, 224, 178); } +void on_message_back_button_clicked(void *data, Evas_Object *obj, void *event_info) +{ + appdata_s *ad = data; + if (!ad) + return; + + app_nf_back_cb(data, obj, event_info); +} + void on_user_info_button_clicked(void *data, Evas_Object *obj, void *event_info) { appdata_s *ad = data; @@ -2622,6 +2653,7 @@ void launch_messaging_view_cb(appdata_s* ad, int user_id) elm_object_part_content_set(main_layout, "swallow.item", title_layout); Evas_Object *back_btn = create_button(ad->nf, "naviframe/back_btn/default", NULL); + evas_object_smart_callback_add(back_btn, "clicked", on_message_back_button_clicked, ad); elm_object_part_content_set(title_layout, "swallow.back_arrow", back_btn); diff --git a/TelegramTizen/src/tg_user_main_view.c b/TelegramTizen/src/tg_user_main_view.c index b233535..b04153d 100644 --- a/TelegramTizen/src/tg_user_main_view.c +++ b/TelegramTizen/src/tg_user_main_view.c @@ -333,8 +333,6 @@ void on_chat_long_press_option_selected_cb(void *data, Evas_Object *obj, void *e tg_main_list_item_s *sel_item = (tg_main_list_item_s*)evas_object_data_get(popup, "selected_chat_item"); int item_id = (int)evas_object_data_get(popup, "selected_chat_item_index"); - - Elm_Object_Item *it = event_info; elm_genlist_item_selected_set(it, EINA_FALSE); int id = (int)elm_object_item_data_get(it); @@ -924,7 +922,7 @@ void reload_main_list_view(appdata_s* ad) int i = 0; static Elm_Genlist_Item_Class itc; - itc.item_style = "type1"; + itc.item_style = "full"; itc.func.text_get = NULL; itc.func.content_get = on_chat_item_load_requested; itc.func.state_get = NULL; @@ -950,7 +948,7 @@ void refresh_main_list_view(appdata_s* ad, Eina_Bool is_new_item) if (buddy_list) { if (is_new_item) { static Elm_Genlist_Item_Class itc; - itc.item_style = "type1"; + itc.item_style = "full"; itc.func.text_get = NULL; itc.func.content_get = on_chat_item_load_requested; itc.func.state_get = NULL; @@ -959,6 +957,28 @@ void refresh_main_list_view(appdata_s* ad, Eina_Bool is_new_item) int size = eina_list_count(ad->main_list); int i = size - 1; elm_genlist_item_append(buddy_list, &itc, (void*) i, NULL, ELM_GENLIST_ITEM_NONE, NULL, (void*) i); + } else { + elm_genlist_clear(buddy_list); + + static Elm_Genlist_Item_Class itc; + itc.item_style = "full"; + itc.func.text_get = NULL; + itc.func.content_get = on_chat_item_load_requested; + itc.func.state_get = NULL; + itc.func.del = NULL; + + int i = 0; + if (ad->main_list) { + int size = eina_list_count(ad->main_list); + if(size > 0) { + for (i = 0; i < size; i++) { + elm_genlist_item_append(buddy_list, &itc, (void *) i, NULL, ELM_GENLIST_ITEM_NONE, NULL, (void*) i); + } + } else { + i = 1; + elm_genlist_item_append(buddy_list, &itc, (void *) i, NULL, ELM_GENLIST_ITEM_NONE, NULL, (void*) i); + } + } } elm_genlist_realized_items_update(buddy_list); } else { @@ -982,7 +1002,7 @@ void refresh_main_list_view(appdata_s* ad, Eina_Bool is_new_item) evas_object_size_hint_align_set(buddy_list, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_data_set(buddy_list, "app_data", ad); - itc.item_style = "type1"; + itc.item_style = "full"; itc.func.text_get = NULL; itc.func.content_get = on_chat_item_load_requested; itc.func.state_get = NULL; diff --git a/TelegramTizen/tg_utils/tg_common.h b/TelegramTizen/tg_utils/tg_common.h index e160e53..f40b5df 100644 --- a/TelegramTizen/tg_utils/tg_common.h +++ b/TelegramTizen/tg_utils/tg_common.h @@ -509,6 +509,7 @@ typedef struct tg_main_list_item { Evas_Object* date_lbl; Evas_Object* msg_status_lbl; Evas_Object* main_item_layout; + Eina_Bool is_selected; } tg_main_list_item_s; typedef struct appdata { @@ -559,6 +560,7 @@ typedef struct appdata { Elm_Theme *theme; int screen_mode_for_fb; // for floating button icon Evas_Object *menu_popup; + int msg_count; } appdata_s; extern void show_toast(appdata_s* ad, char* value); diff --git a/tg-engine-service/db_manager/tg_db_manager.c b/tg-engine-service/db_manager/tg_db_manager.c index 8689429..0f4b621 100644 --- a/tg-engine-service/db_manager/tg_db_manager.c +++ b/tg-engine-service/db_manager/tg_db_manager.c @@ -663,6 +663,7 @@ Eina_Bool delete_record(char *tablename, const char* where_clause) ret = sqlite3_exec(db,var_query, NULL, NULL, &err_msg); close_database(db); if( ret != SQLITE_OK ){ + free(var_query); sqlite3_free(err_msg); return EINA_FALSE; } diff --git a/tg-engine-service/inc/server_response.h b/tg-engine-service/inc/server_response.h index 23462f3..d5fc258 100644 --- a/tg-engine-service/inc/server_response.h +++ b/tg-engine-service/inc/server_response.h @@ -15,6 +15,7 @@ extern void process_validation_command(tg_engine_data_s *tg_data, char *code); extern void process_send_message_command(int buddy_id, int message_id, int msg_type, char* msg_data, int type_of_chat); extern void process_marked_as_read_command(int buddy_id, int type_of_chat); extern void process_delete_group_chat_request(tg_engine_data_s* tg_data, int chat_id); +extern void process_delete_selected_group_chats_request(tg_engine_data_s* tg_data, Eina_List *sel_grp_chats); extern void process_add_user_request(tg_engine_data_s* tg_data, int buddy_id, char *first_name, char *last_name, char *phone_num); extern void process_update_chat_request(tg_engine_data_s* tg_data, int chat_id); extern void process_delete_user_request(tg_engine_data_s* tg_data, int buddy_id); @@ -42,6 +43,7 @@ extern void send_buddy_profile_pic_updated_response(tg_engine_data_s *tg_data, i extern void send_message_received_response(tg_engine_data_s *tg_data, int from_id, int to_id, long long message_id, int type_of_chat); extern void send_message_sent_to_buddy_response(tg_engine_data_s *tg_data, int buddy_id, int message_id, char* table_name, Eina_Bool is_success, int type_of_chat); extern void send_group_chat_deleted_response(tg_engine_data_s *tg_data, int chat_id, Eina_Bool is_success); +extern void send_selected_group_chats_deleted_response(tg_engine_data_s *tg_data); extern void send_message_read_by_buddy_response(tg_engine_data_s *tg_data, int buddy_id, int message_id, char* table_name, char* phone, int type_of_chat); extern void send_media_download_completed_response(tg_engine_data_s *tg_data, int buddy_id, int to_id, long long media_id, const char* filename); extern void send_video_thumb_download_completed_response(tg_engine_data_s *tg_data, int buddy_id, int to_id, long long media_id, const char* filename); diff --git a/tg-engine-service/src/server_response.c b/tg-engine-service/src/server_response.c index ce8c7d4..c2762fc 100644 --- a/tg-engine-service/src/server_response.c +++ b/tg-engine-service/src/server_response.c @@ -63,6 +63,14 @@ void process_send_message_command(int buddy_id, int message_id, int msg_type, ch send_message_to_buddy(buddy_id, message_id, msg_type, msg_data, type_of_chat); } +void process_delete_selected_group_chats_request(tg_engine_data_s* tg_data, Eina_List *sel_grp_chats) +{ + if (!tgl_engine_get_TLS()) { + return; + } + delete_selected_group_chat(tg_data, sel_grp_chats); +} + void process_delete_group_chat_request(tg_engine_data_s* tg_data, int chat_id) { if (!tgl_engine_get_TLS()) { @@ -1026,6 +1034,27 @@ void send_buddy_unblocked_response(tg_engine_data_s *tg_data, int buddy_id, Eina } +void send_selected_group_chats_deleted_response(tg_engine_data_s *tg_data) +{ + bundle *msg = bundle_create(); + if (bundle_add_str(msg, "app_name", "Tizen Telegram") != 0) { + ERR("Failed to add data by key to bundle"); + bundle_free(msg); + } + + if (bundle_add_str(msg, "command", "selected_group_chats_deleted_response") != 0) { + ERR("Failed to add data by key to bundle"); + bundle_free(msg); + } + int result = SVC_RES_FAIL; + result = tg_server_send_message(tg_data->tg_server, msg); + + if(result != SVC_RES_OK) { + // error: cient not ready + } + bundle_free(msg); +} + void send_group_chat_deleted_response(tg_engine_data_s *tg_data, int chat_id, Eina_Bool is_success) { bundle *msg = bundle_create(); diff --git a/tg-engine-service/src/tg-engine-service.c b/tg-engine-service/src/tg-engine-service.c index 80e0549..f7fecdf 100644 --- a/tg-engine-service/src/tg-engine-service.c +++ b/tg-engine-service/src/tg-engine-service.c @@ -81,6 +81,34 @@ static int _on_tg_server_msg_received_cb(void *data, bundle *const rec_msg) int chat_id = atoi(chat_id_str); process_delete_group_chat_request(tg_data, chat_id); + + } else if (strcmp(cmd_key_val, "delete_selected_group_chats_request") == 0) { + + char* count_str = NULL; + res = bundle_get_str(rec_msg, "list_size", &count_str); + int size = atoi(count_str); + Eina_List* chat_id_list = NULL; + + for (int count = 0 ; count < size ; count++) { + char count_str[10]; + sprintf(count_str, "%d", count); + + char chat_id_key[20]; + strcpy(chat_id_key, "chat_id_"); + strcat(chat_id_key, count_str); + + char* chat_id_str = NULL; + res = bundle_get_str(rec_msg, chat_id_key, &chat_id_str); + + + int chat_id = atoi(chat_id_str); + chat_id_list = eina_list_append(chat_id_list, chat_id); + } + + if (chat_id_list && eina_list_count(chat_id_list) > 0) { + process_delete_selected_group_chats_request(tg_data, chat_id_list); + } + } else if (strcmp(cmd_key_val, "add_buddy") == 0) { char* buddy_id_str = NULL; diff --git a/tg-engine-service/tg_engine/tg_engine.c b/tg-engine-service/tg_engine/tg_engine.c index 7267034..f899101 100644 --- a/tg-engine-service/tg_engine/tg_engine.c +++ b/tg-engine-service/tg_engine/tg_engine.c @@ -1865,6 +1865,11 @@ void on_contacts_and_chats_loaded(struct tgl_state *TLS, void *callback_extra, i } for (int i = size - 1; i >= 0; i--) { tgl_peer_t* UC = tgl_peer_get(TLS, peers[i]); + // user exited from chat + if(UC->flags == 144) { + continue; + } + // insert into peer table insert_peer_into_database(UC, last_msg_id[i], unread_count[i], 0); switch (tgl_get_peer_type(peers[i])) { @@ -2815,6 +2820,57 @@ void do_unblock_buddy(int buddy_id) tgl_do_unblock_user(s_info.TLS, peer_id, &on_user_unblock_response , (void*)(buddy_id)); } +void on_selected_group_chats_delete_reponse(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M) +{ + Eina_List *sel_grp_chats = callback_extra; + tg_engine_data_s *tg_data = TLS->callback_data; + int chat_id = eina_list_nth(sel_grp_chats, tg_data->current_group_chat_index); + + if (success) { + // update database + // delete from peer table + delete_chat_from_db(chat_id); + char* msg_table = get_table_name_from_number(chat_id); + drop_table(msg_table); + free(msg_table); + } else { + + } + + tg_data->current_group_chat_index = tg_data->current_group_chat_index + 1; + + if (tg_data->current_group_chat_index < eina_list_count(sel_grp_chats)) { + int group_chat_id = (int)eina_list_nth(sel_grp_chats, tg_data->current_group_chat_index); + + tgl_peer_id_t chat_id; + chat_id.id = group_chat_id; + chat_id.type = TGL_PEER_CHAT; + + tgl_peer_id_t self_id = tg_data->id; + + tgl_do_del_user_from_chat(s_info.TLS, chat_id, self_id, on_selected_group_chats_delete_reponse, (void*)(sel_grp_chats)); + } else { + send_selected_group_chats_deleted_response(tg_data); + } +} + +void delete_selected_group_chat(tg_engine_data_s *tg_data, Eina_List *sel_grp_chats) +{ + if (sel_grp_chats && eina_list_count(sel_grp_chats) > 0) { + + tg_data->current_group_chat_index = 0; + int group_chat_id = (int)eina_list_nth(sel_grp_chats, tg_data->current_group_chat_index); + + tgl_peer_id_t chat_id; + chat_id.id = group_chat_id; + chat_id.type = TGL_PEER_CHAT; + + tgl_peer_id_t self_id = tg_data->id; + + tgl_do_del_user_from_chat(s_info.TLS, chat_id, self_id, on_selected_group_chats_delete_reponse, (void*)(sel_grp_chats)); + } +} + void on_group_chat_delete_reponse(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M) { int chat_id = (int)callback_extra; @@ -2842,6 +2898,7 @@ void leave_group_chat(tg_engine_data_s *tg_data, int group_chat_id) tgl_do_del_user_from_chat(s_info.TLS, chat_id, self_id, on_group_chat_delete_reponse, (void*)(group_chat_id)); } + #if 0 void on_new_msg_requested_chat_info_received(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_chat *chat_info) { diff --git a/tg-engine-service/tg_engine/tg_engine.h b/tg-engine-service/tg_engine/tg_engine.h index 86cd61d..5e25f65 100644 --- a/tg-engine-service/tg_engine/tg_engine.h +++ b/tg-engine-service/tg_engine/tg_engine.h @@ -148,6 +148,7 @@ typedef struct tg_engine_data { Eina_List *buddy_list; int current_buddy_index; + int current_group_chat_index; } tg_engine_data_s; typedef struct contact_data { @@ -171,6 +172,7 @@ extern void set_user_name(tg_engine_data_s *tg_data, int buddy_id, const char *u extern void request_for_code_via_call(struct tgl_state *TLS, char* phone_no, Eina_Bool trough_sms); extern void free_contact_data(Eina_List *contact_data); extern void leave_group_chat(tg_engine_data_s *tg_data, int group_chat_id); +extern void delete_selected_group_chat(tg_engine_data_s *tg_data, Eina_List *sel_grp_chats); extern void do_delete_buddy(int buddy_id); extern void do_add_buddy(int buddy_id, char *first_name, char *last_name, char *phone_num); extern void do_update_chat_info(int chat_id); -- 2.7.4 From 78f98b1a874314f6fd11cd7d0bfe692068d60c79 Mon Sep 17 00:00:00 2001 From: "polu.sandeep" Date: Tue, 20 Oct 2015 22:36:42 +0900 Subject: [PATCH 09/16] Implemented service message item Change-Id: Ia1aa147d8dc929e29d42b90a14bdebbce1c7c5e6 --- TelegramTizen/res/edje/telegram_init_screen.edc | 11 ++++++++--- TelegramTizen/src/tg_messaging_view.c | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/TelegramTizen/res/edje/telegram_init_screen.edc b/TelegramTizen/res/edje/telegram_init_screen.edc index 45f6f72..57a38de 100644 --- a/TelegramTizen/res/edje/telegram_init_screen.edc +++ b/TelegramTizen/res/edje/telegram_init_screen.edc @@ -1455,6 +1455,10 @@ group } } + images { + image: "telegram_button_on_bg.#.png" COMP; + } + group { name: "chat_service_item_box"; @@ -1476,7 +1480,7 @@ group state: "default" 0.0; rel1 { relative: 0.0 0.0; to, "swallow.chat_service_text"; } rel2 { relative: 1.0 1.0; to, "swallow.chat_service_text"; } - color: 225 237 241 0; + color: 0 0 0 0; } } part{ @@ -1487,9 +1491,10 @@ group rel1 { relative: 0.0 -0.2; to, "chat_service_bg"; } rel2 { relative: 1.0 0.9; to, "chat_service_bg"; } image { - border: 10 10 20 20; - normal: "msg_out_photo.9.png"; + border: 5 5 5 5; + normal: "telegram_button_on_bg.#.png"; } + color: 0 0 0 25; } } part{ diff --git a/TelegramTizen/src/tg_messaging_view.c b/TelegramTizen/src/tg_messaging_view.c index 826ac68..1ad3b1b 100644 --- a/TelegramTizen/src/tg_messaging_view.c +++ b/TelegramTizen/src/tg_messaging_view.c @@ -869,7 +869,26 @@ Evas_Object *on_message_item_content_get_cb(void *data, Evas_Object *obj, const elm_object_part_content_set(layout, "elm.text", ser_lbl); return layout; } else if (msg->service == 1) { + char edj_path[PATH_MAX] = {0, }; + app_get_resource(TELEGRAM_INIT_VIEW_EDJ, edj_path, (int)PATH_MAX); + + layout = elm_layout_add(obj); + elm_layout_file_set(layout, edj_path, "chat_service_item_box"); + 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_show(layout); + Evas_Object* ser_lbl = elm_label_add(obj); + char temp_msg[4*256] = {0,}; + snprintf(temp_msg, sizeof(temp_msg), "%s", msg->message); + elm_object_text_set(ser_lbl, temp_msg); + elm_label_ellipsis_set(ser_lbl, EINA_TRUE); + evas_object_resize(ser_lbl, 200, 15); + evas_object_show(ser_lbl); + + elm_object_part_content_set(layout, "swallow.chat_service_text", ser_lbl); + + return layout; } Evas_Object *entry = elm_entry_add(obj); -- 2.7.4 From 8ef53fdc1a1330fc9709eb39bcfd729b07acdbae Mon Sep 17 00:00:00 2001 From: "moon87.park" Date: Wed, 21 Oct 2015 16:55:30 +0900 Subject: [PATCH 10/16] [Telegram] Create the edit name view in setting Change-Id: Ie324f8bfaccc9602cd3c8dd85c0e94006cae0687 --- TelegramTizen/inc/tg_edit_name_view.h | 17 +++++ TelegramTizen/src/tg_edit_name_view.c | 137 ++++++++++++++++++++++++++++++++++ TelegramTizen/src/tg_settings_view.c | 3 +- 3 files changed, 156 insertions(+), 1 deletion(-) create mode 100644 TelegramTizen/inc/tg_edit_name_view.h create mode 100644 TelegramTizen/src/tg_edit_name_view.c diff --git a/TelegramTizen/inc/tg_edit_name_view.h b/TelegramTizen/inc/tg_edit_name_view.h new file mode 100644 index 0000000..ac9c141 --- /dev/null +++ b/TelegramTizen/inc/tg_edit_name_view.h @@ -0,0 +1,17 @@ +/* + * tg_edit_name_view.h + * + * Created on: Oct 21, 2015 + * Author: moonkyoung + */ + +#ifndef TG_EDIT_NAME_VIEW_H_ +#define TG_EDIT_NAME_VIEW_H_ + + +#include "tg_common.h" + +extern void launch_editname_screen(appdata_s* ad); + + +#endif /* TG_EDIT_NAME_VIEW_H_ */ diff --git a/TelegramTizen/src/tg_edit_name_view.c b/TelegramTizen/src/tg_edit_name_view.c new file mode 100644 index 0000000..479fd1a --- /dev/null +++ b/TelegramTizen/src/tg_edit_name_view.c @@ -0,0 +1,137 @@ +/* + * tg_edit_name_view.c + * + * Created on: Oct 21, 2015 + * Author: moonkyoung + */ + + +#include "tg_edit_name_view.h" + + + +static void on_first_name_change_enable_ok_button(void *data, Evas_Object *obj, void *event_info) +{ + appdata_s* ad = data; + Evas_Object* done_btn = evas_object_data_get(ad->nf, "name_done_btn"); + char buf[256] = {'\0',}; + snprintf(buf, sizeof(buf), "%s", elm_object_text_get(obj)); + char* org_buf = trim(buf); + + if (strlen(org_buf) > 0) { + elm_object_disabled_set(done_btn, EINA_FALSE); + } else { + elm_object_disabled_set(done_btn, EINA_TRUE); + } + free(org_buf); +} + +static void on_naviframe_cancel_clicked(void *data, Evas_Object *obj, void *event_info) +{ + appdata_s* ad = data; + + elm_naviframe_item_pop(ad->nf); +} + +static void on_name_entry_done_clicked(void *data, Evas_Object *obj, void *event_info) +{ + appdata_s* ad = data; + Evas_Object* first_name_entry = evas_object_data_get(ad->nf, "first_name_entry"); + Evas_Object* last_name_entry = evas_object_data_get(ad->nf, "second_name_entry"); + const char* tfirst_name = elm_object_text_get(first_name_entry); + if (!tfirst_name) { + show_toast(ad, "Enter first name"); + return; + } + const char* tlast_name = elm_object_text_get(last_name_entry); + if (!tlast_name) { + tlast_name = ""; + } + char* first_name = trim((char*)tfirst_name); + char* last_name = trim((char*)tlast_name); + + /* FIXME : Write the request for edit name */ + + free(first_name); + free(last_name); +} + +void launch_editname_screen(appdata_s* ad) +{ + if (!ad) { + LOGE("ad is NULL"); + return; + } + + //ad->current_app_state = TG_SETTINGS_SCREEN_STATE; + + char edj_path[PATH_MAX] = {0, }; + app_get_resource(TELEGRAM_INIT_VIEW_EDJ, edj_path, (int)PATH_MAX); + + Evas_Object* scroller = elm_scroller_add(ad->nf); + elm_scroller_bounce_set(scroller, EINA_FALSE, EINA_TRUE); + elm_scroller_policy_set(scroller,ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO); + + elm_win_resize_object_add(ad->win, scroller); + + Evas_Object* layout = elm_layout_add(ad->nf); + elm_layout_file_set(layout, edj_path, "name_reg_screen"); + 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_show(layout); + elm_object_content_set(scroller, layout); + + Evas_Object* first_name_entry = elm_entry_add(layout); + evas_object_size_hint_weight_set(first_name_entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(first_name_entry, EVAS_HINT_FILL, EVAS_HINT_FILL); + + elm_object_part_text_set(first_name_entry, "elm.guide", i18n_get_text("IDS_TGRAM_BODY_FIRST_NAME_ABB")); + + elm_entry_single_line_set(first_name_entry, EINA_TRUE); + elm_entry_scrollable_set (first_name_entry, EINA_FALSE); + elm_entry_cnp_mode_set(first_name_entry, ELM_CNP_MODE_NO_IMAGE); + elm_entry_context_menu_disabled_set(first_name_entry, EINA_TRUE); + elm_entry_text_style_user_push(first_name_entry, "DEFAULT='color=#000000'"); + evas_object_show(first_name_entry); + elm_object_part_content_set(layout, "first_name_entry", first_name_entry); + + evas_object_data_set(ad->nf, "first_name_entry", (void*)first_name_entry); + + evas_object_smart_callback_add(first_name_entry, "changed", on_first_name_change_enable_ok_button, ad); + + Evas_Object* second_name_entry = elm_entry_add(layout); + evas_object_size_hint_weight_set(second_name_entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(second_name_entry, EVAS_HINT_FILL, EVAS_HINT_FILL); + + elm_object_part_text_set(second_name_entry, "elm.guide", i18n_get_text("IDS_TGRAM_BODY_LAST_NAME_ABB")); + + elm_entry_single_line_set(second_name_entry, EINA_TRUE); + elm_entry_scrollable_set (second_name_entry, EINA_FALSE); + elm_entry_cnp_mode_set(second_name_entry, ELM_CNP_MODE_NO_IMAGE); + elm_entry_context_menu_disabled_set(second_name_entry, EINA_TRUE); + elm_entry_text_style_user_push(second_name_entry, "DEFAULT='color=#000000'"); + evas_object_show(second_name_entry); + elm_object_part_content_set(layout, "second_name_entry", second_name_entry); + + evas_object_data_set(ad->nf, "second_name_entry", (void*)second_name_entry); + + + Elm_Object_Item* navi_item = elm_naviframe_item_push(ad->nf, i18n_get_text("IDS_TGRAM_OPT_EDIT_NAME"), NULL, NULL, scroller, NULL); + + Evas_Object *done_btn = elm_button_add(ad->nf); + elm_object_style_set(done_btn, "naviframe/title_right"); + elm_object_text_set(done_btn, i18n_get_text("IDS_TGRAM_ACBUTTON_DONE_ABB")); + evas_object_smart_callback_add(done_btn, "clicked", on_name_entry_done_clicked, ad); + + Evas_Object *cancel_btn = elm_button_add(ad->nf); + elm_object_style_set(cancel_btn, "naviframe/title_left"); + elm_object_text_set(cancel_btn, i18n_get_text("IDS_TGRAM_ACBUTTON_CANCEL_ABB")); + evas_object_smart_callback_add(cancel_btn, "clicked", on_naviframe_cancel_clicked, ad) + ; + elm_object_item_part_content_set(navi_item, "title_right_btn", done_btn); + elm_object_item_part_content_set(navi_item, "title_left_btn", cancel_btn); + + evas_object_data_set(ad->nf, "name_done_btn", (void*)done_btn); + elm_object_disabled_set(done_btn, EINA_TRUE); + +} diff --git a/TelegramTizen/src/tg_settings_view.c b/TelegramTizen/src/tg_settings_view.c index 55207a5..e67db44 100644 --- a/TelegramTizen/src/tg_settings_view.c +++ b/TelegramTizen/src/tg_settings_view.c @@ -9,6 +9,7 @@ #include "tg_settings_view.h" #include "server_requests.h" #include "tg_set_username_view.h" +#include "tg_edit_name_view.h" #include "tg_db_wrapper.h" static Evas_Object* get_image_from_path(const char* path, Evas_Object* parent) @@ -814,7 +815,7 @@ static void ctxpopup_edit_name_select_cb(void *data, Evas_Object *obj, void *eve } _ctxpopup_dismiss_cb(ad, NULL, NULL); - + launch_editname_screen(ad); /* please input here when edit name menu is clicked */ } -- 2.7.4 From bcb8d34bd4e95e7c04b0cd685fcc5d9aaa68870b Mon Sep 17 00:00:00 2001 From: "moon87.park" Date: Fri, 23 Oct 2015 21:42:36 +0900 Subject: [PATCH 11/16] [Telegram] Create the search the chat list Change-Id: I41b9cb03452a4313c42a55a2f855e021234524f7 --- TelegramTizen/inc/tg_search_message_view.h | 16 + TelegramTizen/src/contact_selection_view.c | 2 +- TelegramTizen/src/tg_search_message_view.c | 595 +++++++++++++++++++++++++++++ TelegramTizen/src/tg_search_peer_view.c | 5 +- TelegramTizen/src/tg_user_main_view.c | 2 + 5 files changed, 617 insertions(+), 3 deletions(-) create mode 100644 TelegramTizen/inc/tg_search_message_view.h create mode 100644 TelegramTizen/src/tg_search_message_view.c diff --git a/TelegramTizen/inc/tg_search_message_view.h b/TelegramTizen/inc/tg_search_message_view.h new file mode 100644 index 0000000..4c75d67 --- /dev/null +++ b/TelegramTizen/inc/tg_search_message_view.h @@ -0,0 +1,16 @@ +/* + * tg_search_message_view.h + * + * Created on: Oct 23, 2015 + * Author: moonkyoung + */ + +#ifndef TG_SEARCH_MESSAGE_VIEW_H_ +#define TG_SEARCH_MESSAGE_VIEW_H_ + +#include "tg_common.h" + +extern void launch_search_message_view(appdata_s* ad); + + +#endif /* TG_SEARCH_MESSAGE_VIEW_H_ */ diff --git a/TelegramTizen/src/contact_selection_view.c b/TelegramTizen/src/contact_selection_view.c index 0ca9a4e..51112f7 100644 --- a/TelegramTizen/src/contact_selection_view.c +++ b/TelegramTizen/src/contact_selection_view.c @@ -651,7 +651,7 @@ void launch_contact_selction_view(void *data) elm_layout_theme_set(nocontents, "layout", "nocontents", "default"); evas_object_size_hint_weight_set(nocontents, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(nocontents, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_object_part_text_set(nocontents, "elm.text", "No Items"); + elm_object_part_text_set(nocontents, "elm.text", _("IDS_TGRAM_NPBODY_NO_RESULTS_FOUND_ABB")); evas_object_data_set(ad->nf, "no_contents_layout", nocontents); evas_object_data_set(ad->nf, "fs_layout", fs_layout); diff --git a/TelegramTizen/src/tg_search_message_view.c b/TelegramTizen/src/tg_search_message_view.c new file mode 100644 index 0000000..db681ce --- /dev/null +++ b/TelegramTizen/src/tg_search_message_view.c @@ -0,0 +1,595 @@ +/* + * tg_search_message_view.c + * + * Created on: Oct 23, 2015 + * Author: moonkyoung + */ + +#include "tg_search_message_view.h" +#include "tg_user_main_view.h" +#include "tg_start_messaging_view.h" +#include "tg_messaging_view.h" +#include "contact_selection_view.h" +#include "tg_search_peer_view.h" +#include "tg_settings_view.h" +#include "tg_db_manager.h" +#include "server_requests.h" +#include "tg_db_wrapper.h" +#include "ucol.h" + +static Evas_Object* create_image_object_from_file(const char *icon_name, Evas_Object *parent) +{ + Evas_Object *icon = elm_image_add(parent); + evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(icon, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_image_file_set(icon, icon_name, NULL); + evas_object_show(icon); + return icon; +} + +static void on_buddy_user_name_deleted(void *data, Evas *e, Evas_Object *icon, void *event_info) +{ + tg_main_list_item_s *item = data; + item->user_name_lbl = NULL; +} + +static void on_buddy_user_status_deleted(void *data, Evas *e, Evas_Object *icon, void *event_info) +{ + tg_main_list_item_s *item = data; + item->status_lbl = NULL; +} + +static void on_buddy_date_deleted(void *data, Evas *e, Evas_Object *icon, void *event_info) +{ + tg_main_list_item_s *item = data; + item->date_lbl = NULL; +} + +static void on_main_chat_item_selected(void *data, Evas_Object *obj, void *event_info) +{ + Elm_Object_Item *it = event_info; + elm_genlist_item_selected_set(it, EINA_FALSE); + + appdata_s* ad = evas_object_data_get(obj, "app_data"); + Eina_List *list = evas_object_data_get(obj, "result_list"); + int item_id = (int) data; + //int item_id = (int)elm_object_item_data_get(it); + + tg_main_list_item_s* sel_item = eina_list_nth(list, item_id); + + ad->buddy_in_cahtting_data = NULL; + ad->peer_in_cahtting_data = NULL; + int buddy_id = -1; + if (sel_item) { + + if (sel_item->peer_type == TGL_PEER_CHAT) { + + tg_chat_info_s* chat_info = get_chat_info(sel_item->peer_id); + if (!chat_info) { + // request chat info + //show_toast(ad, "Loading chat info. Please wait."); + show_loading_popup(ad); + send_update_chat_request(ad->service_client, sel_item->peer_id); + return; + } + } + + if (sel_item->peer_type == TGL_PEER_USER) { + for (int i = 0; i < eina_list_count(ad->buddy_list); i++) { + user_data_with_pic_s *item = eina_list_nth(ad->buddy_list, i); + user_data_s* user_data = item->use_data; + + if (user_data->user_id.id == sel_item->peer_id) { + ad->buddy_in_cahtting_data = item; + break; + } + } + + if (ad->buddy_in_cahtting_data == NULL) { + for (int i = 0; i < eina_list_count(ad->unknown_buddy_list); i++) { + user_data_with_pic_s *item = eina_list_nth(ad->unknown_buddy_list, i); + user_data_s* user_data = item->use_data; + + if (user_data->user_id.id == sel_item->peer_id) { + ad->buddy_in_cahtting_data = item; + break; + } + } + } + } + + for (int i = 0; i < eina_list_count(ad->peer_list); i++) { + peer_with_pic_s* pic_item = eina_list_nth(ad->peer_list, i); + tg_peer_info_s* item = pic_item->use_data; + + if (item->peer_id == sel_item->peer_id) { + ad->peer_in_cahtting_data = pic_item; + buddy_id = i; + break; + } + } + ad->main_item_in_cahtting_data = sel_item; + + elm_naviframe_item_pop(ad->nf); + delete_floating_button(ad); + launch_messaging_view_cb(ad, buddy_id); + + } +} + +static Evas_Object* on_chat_item_load_requested(void *data, Evas_Object *obj, const char *part) +{ + int id = (int) data; + appdata_s* ad = evas_object_data_get(obj, "app_data"); + Eina_List *list = evas_object_data_get(obj, "result_list"); + + if (list == NULL || eina_list_count(list) <= 0) { + return NULL; + } + tg_main_list_item_s* item = eina_list_nth(list, id); + if (!item) { + return NULL; + } + + Eina_Bool is_empty_msg = EINA_FALSE; + + if (!strcmp(part, "elm.swallow.content")) { + + char edj_path[PATH_MAX] = {0, }; + app_get_resource(TELEGRAM_INIT_VIEW_EDJ, edj_path, (int)PATH_MAX); + Evas_Object* layout = elm_layout_add(ad->nf); + elm_layout_file_set(layout, edj_path, "main_list_custom_item"); + 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_show(layout); + Evas_Object* item_layout = elm_layout_add(ad->nf); + if (ad->target_direction == TELEGRAM_TARGET_DIRECTION_LANDSCAPE_INVERSE || ad->target_direction == TELEGRAM_TARGET_DIRECTION_LANDSCAPE) { + if ((item->last_message == NULL) || (strlen(item->last_message) <= 0) || (strcmp(item->last_message, " ") == 0) || (item->number_of_unread_msgs == 0 &&(!item->is_out_msg || !item->last_msg_service))) { + elm_layout_file_set(item_layout, edj_path, "main_list_custom_no_msg_item_land"); + is_empty_msg = EINA_TRUE; + } else { + if (item->is_out_msg && !(item->last_msg_service)) { + elm_layout_file_set(item_layout, edj_path, "main_list_custom_sent_item_land"); + } else { + elm_layout_file_set(item_layout, edj_path, "main_list_custom_received_item_land"); + } + } + } else { + if ((item->last_message == NULL) || (strlen(item->last_message) <= 0) || (strcmp(item->last_message, " ") == 0) || (item->number_of_unread_msgs == 0 &&(!item->is_out_msg || !item->last_msg_service))) { + elm_layout_file_set(item_layout, edj_path, "main_list_custom_no_msg_item"); + is_empty_msg = EINA_TRUE; + } else { + if (item->is_out_msg && !(item->last_msg_service)) { + elm_layout_file_set(item_layout, edj_path, "main_list_custom_sent_item"); + } else { + elm_layout_file_set(item_layout, edj_path, "main_list_custom_received_item"); + } + } + } + evas_object_size_hint_weight_set(item_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(item_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(item_layout); + elm_object_part_content_set(layout, "swallow.item", item_layout); + + /*************************** profile pic ***************************************/ + Evas_Object *profile_pic = NULL; + if (item->profile_pic_path && strcmp(item->profile_pic_path, "") != 0) { + profile_pic = elm_image_add(obj); + evas_object_size_hint_weight_set(profile_pic, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(profile_pic, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_object_focus_set(profile_pic, EINA_FALSE); + + Eina_Bool is_success = elm_image_file_set(profile_pic, item->profile_pic_path, NULL); + + if (!is_success) { + if (item->peer_type == TGL_PEER_USER) { + profile_pic = create_image_object_from_file(ui_utils_get_resource(DEFAULT_LIST_THUMB_SINGLE_PIC), obj); + // send download request again To-Do + } else if (item->peer_type == TGL_PEER_CHAT) { + profile_pic = create_image_object_from_file(ui_utils_get_resource(DEFAULT_LIST_THUMB_MULTI_PIC), obj); + // send download request again To-Do + } else { + } + evas_object_color_set(profile_pic, 45, 165, 224, 255); + } + evas_object_show(profile_pic); + } else { + + if (item->peer_type == TGL_PEER_USER) { + profile_pic = create_image_object_from_file(ui_utils_get_resource(DEFAULT_LIST_THUMB_SINGLE_PIC), obj); + } else if (item->peer_type == TGL_PEER_CHAT) { + profile_pic = create_image_object_from_file(ui_utils_get_resource(DEFAULT_LIST_THUMB_MULTI_PIC), obj); + } else { + + } + evas_object_color_set(profile_pic, 45, 165, 224, 255); + } + + Evas_Object* user_pic_layout = elm_layout_add(ad->nf); + elm_layout_file_set(user_pic_layout, edj_path, "circle_layout"); + evas_object_size_hint_weight_set(user_pic_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(user_pic_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(user_pic_layout); + elm_object_part_content_set(user_pic_layout, "content", profile_pic); + + elm_object_part_content_set(item_layout, "swallow.icon", user_pic_layout); + + /*************************** profile pic ***************************************/ + + /*************************** user name ***************************************/ + + char* user_name = replace(item->peer_print_name, '_', ""); + char buf[512] = {'\0'}; + snprintf(buf, 512, "%s", user_name); + free(user_name); + + Evas_Object* name_lbl = elm_label_add(ad->nf); + elm_object_text_set(name_lbl, buf); + evas_object_size_hint_weight_set(name_lbl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(name_lbl, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(name_lbl); + + elm_object_part_content_set(item_layout, "swallow.title", name_lbl); + + item->user_name_lbl = name_lbl; + evas_object_event_callback_add(item->user_name_lbl, EVAS_CALLBACK_DEL, on_buddy_user_name_deleted, item); + + /*************************** user name ***************************************/ + + /*************************** last message ***************************************/ + + char* org_msg = NULL; + if (item->last_message) { + org_msg = item->last_message; + } else { + org_msg = ""; + } + + int len_org_str = strlen(org_msg); + + char res[30] = {'\0'}; + char status_buf[126] = {'\0'}; + if(len_org_str > 30) { + strncpy(res, org_msg, 29); + if(item->last_msg_service) { + sprintf(status_buf,"%s", res); + } else { + sprintf(status_buf,"%s", res); + } + } else { + if(item->last_msg_service) { + sprintf(status_buf, "%s", org_msg); + } else { + sprintf(status_buf, "%s", org_msg); + } + } + + Evas_Object* status_lbl = elm_label_add(ad->nf); + elm_object_text_set(status_lbl, status_buf); + evas_object_size_hint_weight_set(status_lbl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(status_lbl, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(status_lbl); + + item->status_lbl = status_lbl; + evas_object_event_callback_add(item->status_lbl, EVAS_CALLBACK_DEL, on_buddy_user_status_deleted, item); + + elm_object_part_content_set(item_layout, "swallow.last_message", item->status_lbl); + + /*************************** last message ***************************************/ + + /*************************** date ***************************************/ + Eina_Bool is_today = compare_date_with_current_date(item->last_seen_time); + Evas_Object* time_lbl = elm_label_add(ad->nf); + if (is_today) { + //elm_object_text_set(time_lbl, "Today"); + // get time to display + + char *format = NULL; + time_t t = item->last_seen_time; + format = "%I:%M %p"; + struct tm lt; + char res[28] = {'\0'}; + (void) localtime_r(&t, <); + + if (strftime(res, sizeof(res), format, <) == 0) { + (void) fprintf(stderr, "strftime(3): cannot format supplied " + "date/time into buffer of size %u " + "using: '%s'\n", + sizeof(res), format); + } + + char time_str[128]={0,}; + sprintf(time_str, "%s", res); + + elm_object_text_set(time_lbl,time_str); + + + } else { + char *format = NULL; + time_t t = item->last_seen_time; + format = "%b %d"; + struct tm lt; + char res[28] = {'\0'}; + (void) localtime_r(&t, <); + + if (strftime(res, sizeof(res), format, <) == 0) { + (void) fprintf(stderr, "strftime(3): cannot format supplied " + "date/time into buffer of size %u " + "using: '%s'\n", + sizeof(res), format); + } + + char time_str[128]={0,}; + sprintf(time_str, "%s", res); + + elm_object_text_set(time_lbl,time_str); + } + + evas_object_size_hint_weight_set(time_lbl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(time_lbl, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(time_lbl); + + item->date_lbl = time_lbl; + evas_object_event_callback_add(item->date_lbl, EVAS_CALLBACK_DEL, on_buddy_date_deleted, item); + + elm_object_part_content_set(item_layout, "swallow.date", time_lbl); + + /*************************** date ***************************************/ + + /*************************** sent message status ***************************************/ + if (!is_empty_msg) { + if (item->is_out_msg && !(item->last_msg_service)) { + + Evas_Object *status_obj; + status_obj = elm_icon_add(obj); + evas_object_size_hint_weight_set(status_obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(status_obj, EVAS_HINT_FILL, EVAS_HINT_FILL); + + if(item->last_msg_status == TG_MESSAGE_STATE_SENDING) { + elm_image_file_set(status_obj, ui_utils_get_resource(MESSAGE_SENDING_ICON), NULL); + } else if(item->last_msg_status == TG_MESSAGE_STATE_SENT) { + elm_image_file_set(status_obj, ui_utils_get_resource(MESSAGE_SENT_ICON), NULL); + } else if(item->last_msg_status == TG_MESSAGE_STATE_DELIVERED) { + elm_image_file_set(status_obj, ui_utils_get_resource(MESSAGE_DELIVERED_ICON), NULL); + } else if(item->last_msg_status == TG_MESSAGE_STATE_RECEIVED) { + + } else if(item->last_msg_status == TG_MESSAGE_STATE_FAILED) { + elm_image_file_set(status_obj, ui_utils_get_resource(MESSAGE_FAILED_ICON), NULL); + } else if(item->last_msg_status == TG_MESSAGE_STATE_READ) { + elm_image_file_set(status_obj, ui_utils_get_resource(MESSAGE_READ_ICON), NULL); + } else if(item->last_msg_status == TG_MESSAGE_STATE_UNKNOWN) { + + } +#if 0 + Evas_Object *msg_status = elm_layout_add(ad->nf); + elm_layout_file_set(msg_status, edj_path, "status_bg_layout"); + evas_object_size_hint_weight_set(msg_status, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(msg_status, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(msg_status); + elm_object_part_content_set(msg_status, "content", status_obj); +#endif + evas_object_color_set(status_obj, 75, 96,178, 255); + elm_object_part_content_set(item_layout, "swallow.read_unread_status", status_obj); + + } else { + if (item->number_of_unread_msgs > 0) { + Evas_Object* num_lbl = elm_label_add(ad->nf); + elm_object_style_set(num_lbl, "transparent"); + char unread_msgs[256]; + sprintf(unread_msgs, "%d", item->number_of_unread_msgs); + elm_object_text_set(num_lbl, unread_msgs); + evas_object_size_hint_weight_set(num_lbl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(num_lbl, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(num_lbl); + + Evas_Object* msg_status = elm_layout_add(ad->nf); + elm_layout_file_set(msg_status, edj_path, "count_bg_layout"); + evas_object_size_hint_weight_set(msg_status, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(msg_status, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(msg_status); + elm_object_part_content_set(msg_status, "content", num_lbl); + //evas_object_color_set(num_lbl, 37, 137, 186, 255 * 0.8); + elm_object_part_content_set(item_layout, "swallow.unread_count", msg_status); + } + } + } + return layout; + } + return NULL; +} + +static void _append_peer_item(Evas_Object *genlist, appdata_s *ad, Eina_List* item_list) +{ + int i; + static Elm_Genlist_Item_Class itc; + Elm_Object_Item* item = NULL; + + itc.item_style = "full"; + itc.func.text_get = NULL; + itc.func.content_get = on_chat_item_load_requested; + itc.func.state_get = NULL; + itc.func.del = NULL; + + int count = eina_list_count(item_list); + + evas_object_data_set(genlist, "result_list", item_list); + + if(count > 0) { + for (i = 0; i < count; i++) { + item = elm_genlist_item_append(genlist, &itc, (void *) i, NULL, ELM_GENLIST_ITEM_NONE, on_main_chat_item_selected, (void*) i); + } + } +} + +static void _on_search_entry_changed(void *data, Evas_Object *obj, void *event_info) +{ + appdata_s* ad = data; + char* entry_text = NULL; + + Evas_Object *peer_list = evas_object_data_get(ad->nf, "peer_list"); + Evas_Object *main_layout = evas_object_data_get(ad->nf, "main_layout"); + + tg_main_list_item_s* item; + + if (!peer_list) { + DBG("peer_list is null"); + return; + } + + elm_genlist_clear(peer_list); + + entry_text = trim(elm_entry_markup_to_utf8(elm_object_text_get(obj))); + + Eina_List *result_list = NULL; + Eina_List *l = NULL; + + if (ucol_is_jamo(entry_text)) { + LOGD("entry_text is jamo, %s", entry_text); + EINA_LIST_FOREACH(ad->main_list, l, item) { + int result; + result = ucol_compare_first_letters(item->peer_print_name, entry_text); + if (result == 0) { + result_list = eina_list_append(result_list, item); + } + } + } else { + LOGD("entry_text is not jamo, %s", entry_text); + EINA_LIST_FOREACH(ad->main_list, l, item) { + //user = item->use_data; + + if (ucol_ncompare(item->peer_print_name, entry_text, strlen(entry_text)) == 0) { + result_list = eina_list_append(result_list, item); + } + } + } + + if ((entry_text == NULL || strlen(entry_text) == 0) && result_list == NULL) { + result_list = ad->main_list; + } + + LOGD("count of result_list is %d", eina_list_count(result_list)); + + Evas_Object *no_contents = evas_object_data_get(ad->nf, "no_contents_layout"); + Evas_Object *content = elm_object_part_content_get(main_layout, "elm.swallow.content"); + + if (result_list) { + _append_peer_item(peer_list, data, result_list); + + if (no_contents == content) { + elm_object_part_content_unset(main_layout, "elm.swallow.content"); + evas_object_hide(content); + } + + elm_object_part_content_set(main_layout, "elm.swallow.content", peer_list); + + } else { + if (content == peer_list) { + elm_object_part_content_unset(main_layout, "elm.swallow.content"); + evas_object_hide(peer_list); + } + elm_object_part_content_set(main_layout, "elm.swallow.content", no_contents); + } + elm_genlist_realized_items_update(peer_list); + if (entry_text) { + free(entry_text); + } +} + +static void _on_search_entry_focused(void *data, Evas_Object *obj, void *event_info) +{ + Evas_Object *layout = data; + if (elm_object_focus_get(layout)) { + elm_object_signal_emit(layout, "elm,state,focused", ""); + } else{ + elm_object_signal_emit(layout, "elm,state,unfocused", ""); + } +} + +static Evas_Object *_create_searchbar(Evas_Object* parent, void* data) +{ + char edj_path[PATH_MAX] = {0, }; + app_get_resource(TELEGRAM_INIT_VIEW_EDJ, edj_path, (int)PATH_MAX); + + Evas_Object* layout = elm_layout_add(parent); + elm_layout_file_set(layout, edj_path, ""); + + /* editfield layout */ + Evas_Object* searchbar_layout = elm_layout_add(parent); + elm_layout_theme_set(searchbar_layout, "layout", "searchfield", "singleline"); + evas_object_size_hint_align_set(searchbar_layout, EVAS_HINT_FILL, 0.0); + evas_object_size_hint_weight_set(searchbar_layout, EVAS_HINT_EXPAND, 0.0); + + /* entry */ + Evas_Object* searchbar_entry = elm_entry_add(searchbar_layout); + elm_entry_cursor_end_set(searchbar_entry); + evas_object_size_hint_weight_set(searchbar_entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(searchbar_entry, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_entry_single_line_set(searchbar_entry, EINA_TRUE); + elm_entry_scrollable_set (searchbar_entry, EINA_FALSE); + elm_entry_cnp_mode_set(searchbar_entry, ELM_CNP_MODE_NO_IMAGE); + elm_entry_context_menu_disabled_set(searchbar_entry, EINA_TRUE); + elm_object_part_text_set(searchbar_entry, "elm.guide", i18n_get_text("IDS_TGRAM_NPBODY_SEARCH")); + elm_object_focus_set(searchbar_entry, EINA_FALSE); + + limit_filter_data.max_char_count = 255; + elm_entry_markup_filter_append(searchbar_entry, elm_entry_filter_limit_size, &limit_filter_data); + + + evas_object_smart_callback_add(searchbar_entry, "changed", _on_search_entry_changed, data); + evas_object_smart_callback_add(searchbar_entry, "preedit,changed", _on_search_entry_changed, data); + evas_object_smart_callback_add(searchbar_entry, "focused", _on_search_entry_focused, searchbar_layout); + + elm_object_part_content_set(searchbar_layout, "elm.swallow.content", searchbar_entry); + return searchbar_layout; +} + +static Evas_Object* create_genlist(appdata_s *ad, Evas_Object *layout) +{ + Evas_Object *list = elm_genlist_add(ad->nf); + elm_list_mode_set(list, ELM_LIST_COMPRESS); + elm_genlist_mode_set(list, ELM_LIST_COMPRESS); + evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(list); + elm_object_focus_set(list, EINA_TRUE); + return list; +} + +void launch_search_message_view(appdata_s* ad) +{ + if (!ad) + return; + + ad->current_app_state = TG_USER_MAIN_VIEW_SELECTION_STATE; + + Evas_Object* layout = elm_layout_add(ad->nf); + elm_layout_theme_set(layout, "layout", "application", "searchbar_base"); + 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_show(layout); + + Evas_Object* searchbar_layout = _create_searchbar(layout, ad); + elm_object_part_content_set(layout, "searchbar", searchbar_layout); + + Evas_Object* peer_list = create_genlist(ad, layout); + evas_object_data_set(peer_list, "app_data", ad); + elm_object_part_content_set(layout, "elm.swallow.content", peer_list); + + _append_peer_item(peer_list, ad, ad->main_list); + + /* no contents */ + Evas_Object *nocontents = elm_layout_add(ad->nf); + elm_layout_theme_set(nocontents, "layout", "nocontents", "default"); + evas_object_size_hint_weight_set(nocontents, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(nocontents, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_object_part_text_set(nocontents, "elm.text", _("IDS_TGRAM_NPBODY_NO_RESULTS_FOUND_ABB")); + evas_object_hide(nocontents); + + evas_object_data_set(ad->nf, "no_contents_layout", nocontents); + evas_object_data_set(ad->nf, "main_layout", layout); + evas_object_data_set(ad->nf, "peer_list", peer_list); + + Elm_Object_Item *it = elm_naviframe_item_push(ad->nf, NULL, NULL, NULL, layout, NULL); + elm_naviframe_item_title_enabled_set(it, EINA_FALSE, EINA_FALSE); + +} diff --git a/TelegramTizen/src/tg_search_peer_view.c b/TelegramTizen/src/tg_search_peer_view.c index df6d224..388612f 100755 --- a/TelegramTizen/src/tg_search_peer_view.c +++ b/TelegramTizen/src/tg_search_peer_view.c @@ -347,8 +347,9 @@ static void on_peer_item_clicked(void *data, Evas_Object *obj, void *event_info) int item_id = (int) data; appdata_s* ad = evas_object_data_get(obj, "app_data"); + Eina_List *list = evas_object_data_get(obj, "result_list"); - user_data_with_pic_s* sel_item = eina_list_nth(ad->search_peer_list, item_id); + user_data_with_pic_s* sel_item = eina_list_nth(list, item_id); ad->buddy_in_cahtting_data = sel_item; int peer_id = -1; @@ -783,7 +784,7 @@ void launch_start_peer_search_view(appdata_s* ad) elm_layout_theme_set(nocontents, "layout", "nocontents", "default"); evas_object_size_hint_weight_set(nocontents, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(nocontents, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_object_part_text_set(nocontents, "elm.text", "No Items"); + elm_object_part_text_set(nocontents, "elm.text", _("IDS_TGRAM_NPBODY_NO_RESULTS_FOUND_ABB")); evas_object_data_set(ad->nf, "no_contents_layout", nocontents); evas_object_data_set(ad->nf, "fs_layout", fs_layout); diff --git a/TelegramTizen/src/tg_user_main_view.c b/TelegramTizen/src/tg_user_main_view.c index b04153d..ba5ef4a 100644 --- a/TelegramTizen/src/tg_user_main_view.c +++ b/TelegramTizen/src/tg_user_main_view.c @@ -15,6 +15,7 @@ #include "server_requests.h" #include "tg_db_wrapper.h" #include "tg_main_item_deletion_view.h" +#include "tg_search_message_view.h" static Evas_Object *create_image_object_from_file(const char *icon_name, Evas_Object *parent) { @@ -1125,6 +1126,7 @@ static void ctxpopup_search_select_cb(void *data, Evas_Object *obj, void *event_ _ctxpopup_dismiss_cb(ad, NULL, NULL); /* please input here when search menu is clicked */ + launch_search_message_view(ad); } static void ctxpopup_contact_select_cb(void *data, Evas_Object *obj, void *event_info) -- 2.7.4 From 2ab79e2e01eda2f7cc91d94f441d123dd3ecc4df Mon Sep 17 00:00:00 2001 From: "polu.sandeep" Date: Mon, 26 Oct 2015 21:15:55 +0900 Subject: [PATCH 12/16] Apply latest GUI Change-Id: I84f5d1687f8b5c62f576af1988eba5d0350ee662 --- TelegramTizen/src/telegramtizen.c | 163 ++++++++++++++++++++++++++++++++- TelegramTizen/src/tg_messaging_view.c | 47 +++++++++- TelegramTizen/src/tg_user_main_view.c | 15 +-- TelegramTizen/tg_utils/tg_common.h | 3 +- tg-engine-service/mtprotocol/queries.c | 11 ++- 5 files changed, 222 insertions(+), 17 deletions(-) diff --git a/TelegramTizen/src/telegramtizen.c b/TelegramTizen/src/telegramtizen.c index df5eeb7..57cd17f 100644 --- a/TelegramTizen/src/telegramtizen.c +++ b/TelegramTizen/src/telegramtizen.c @@ -334,6 +334,10 @@ void load_main_list_data(appdata_s *ad) free(main_item->profile_pic_path); main_item->profile_pic_path = NULL; } + if (main_item->buddy_display_name) { + free(main_item->buddy_display_name); + main_item->buddy_display_name = NULL; + } main_item->date_lbl = NULL; main_item->msg_status_lbl = NULL; main_item->profile_pic = NULL; @@ -421,6 +425,34 @@ void load_main_list_data(appdata_s *ad) main_list_item->last_msg_status = msg->msg_state; main_list_item->last_msg_service = msg->service; main_list_item->number_of_unread_msgs = get_unread_message_count(tablename); + + + if (peer_info->peer_type == TGL_PEER_USER) { + char *user_name = NULL; + char *first_name = NULL; + char *last_name = NULL; + char *phone_num = NULL; + get_buddy_contact_details_from_db(peer_info->peer_id, &first_name, &last_name, &phone_num); + + if (!first_name && !last_name && phone_num) { + first_name = phone_num; + } + + if (!last_name) { + last_name = ""; + } + user_name = (char*)malloc(strlen(first_name) + strlen(" ") + strlen(last_name) + 1); + strcpy(user_name, first_name); + strcat(user_name, " "); + strcat(user_name, last_name); + main_list_item->buddy_display_name = user_name; + } else if (peer_info->peer_type == TGL_PEER_CHAT) { + main_list_item->buddy_display_name = replace(peer_info->print_name, '_', " "); + } else { + main_list_item->buddy_display_name = strdup(""); + } + + if (peer_info->photo_path) { main_list_item->profile_pic_path = strdup(peer_info->photo_path); } else { @@ -468,6 +500,31 @@ void load_main_list_data(appdata_s *ad) main_list_item->last_msg_id = -1; main_list_item->last_msg_status = -1; main_list_item->number_of_unread_msgs = 0; + if (peer_info->peer_type == TGL_PEER_USER) { + char *user_name = NULL; + char *first_name = NULL; + char *last_name = NULL; + char *phone_num = NULL; + get_buddy_contact_details_from_db(peer_info->peer_id, &first_name, &last_name, &phone_num); + + if (!first_name && !last_name && phone_num) { + first_name = phone_num; + } + + if (!last_name) { + last_name = ""; + } + user_name = (char*)malloc(strlen(first_name) + strlen(" ") + strlen(last_name) + 1); + strcpy(user_name, first_name); + strcat(user_name, " "); + strcat(user_name, last_name); + main_list_item->buddy_display_name = user_name; + } else if (peer_info->peer_type == TGL_PEER_CHAT) { + main_list_item->buddy_display_name = replace(peer_info->print_name, '_', " "); + } else { + main_list_item->buddy_display_name = strdup(""); + } + if (peer_info->photo_path) { main_list_item->profile_pic_path = strdup(peer_info->photo_path); } else { @@ -1500,11 +1557,19 @@ static int _on_service_client_msg_received_cb(void *data, bundle *const rec_msg) } else if(media_type == tgl_message_media_photo) { sel_item->last_message = strdup("Image"); } else if(media_type == tgl_message_media_document) { + +#if 0 if (msg->message && strlen(msg->message) > 0) { sel_item->last_message = strdup(msg->message); } else { sel_item->last_message = strdup("Document"); } +#else + tgl_media_s *media_msg = NULL; + media_msg = get_media_details_from_db(atoll(msg->media_id)); + sel_item->last_message = strdup(media_msg->doc_type); + free_media_details(media_msg); +#endif } else if(media_type == tgl_message_media_geo) { sel_item->last_message = strdup("Geo location"); } else if(media_type == tgl_message_media_contact) { @@ -1549,14 +1614,18 @@ static int _on_service_client_msg_received_cb(void *data, bundle *const rec_msg) if(len_org_str > 40) { strncpy(res, org_msg, 39); if(msg->service == 1 || msg->service == 2) { + sel_item->last_msg_service = 1; sprintf(status_buf,"%s", res); } else { + sel_item->last_msg_service = 0; sprintf(status_buf,"%s", res); } } else { if(msg->service == 1 || msg->service == 2) { + sel_item->last_msg_service = 1; sprintf(status_buf, "%s", org_msg); } else { + sel_item->last_msg_service = 0; sprintf(status_buf, "%s", org_msg); } } @@ -2238,9 +2307,9 @@ static int _on_service_client_msg_received_cb(void *data, bundle *const rec_msg) char status_buf[512] = {'\0'}; if(len_org_str > 25) { strncpy(res, org_msg, 25); - snprintf(status_buf, 512, "%s", res); + snprintf(status_buf, 512, "%s", res); } else { - snprintf(status_buf, 512, "%s", org_msg); + snprintf(status_buf, 512, "%s", org_msg); } elm_object_text_set(sel_item->status_lbl, status_buf); } @@ -2448,6 +2517,32 @@ tg_main_list_item_s* get_latest_item(appdata_s *ad, peer_with_pic_s *item) } else { main_list_item->profile_pic_path = NULL; } + + if (peer_info->peer_type == TGL_PEER_USER) { + char *user_name = NULL; + char *first_name = NULL; + char *last_name = NULL; + char *phone_num = NULL; + get_buddy_contact_details_from_db(peer_info->peer_id, &first_name, &last_name, &phone_num); + + if (!first_name && !last_name && phone_num) { + first_name = phone_num; + } + + if (!last_name) { + last_name = ""; + } + user_name = (char*)malloc(strlen(first_name) + strlen(" ") + strlen(last_name) + 1); + strcpy(user_name, first_name); + strcat(user_name, " "); + strcat(user_name, last_name); + main_list_item->buddy_display_name = user_name; + } else if (peer_info->peer_type == TGL_PEER_CHAT) { + main_list_item->buddy_display_name = replace(peer_info->print_name, '_', " "); + } else { + main_list_item->buddy_display_name = strdup(""); + } + main_list_item->user_name_lbl = NULL; main_list_item->status_lbl = NULL; main_list_item->date_lbl = NULL; @@ -2494,6 +2589,32 @@ tg_main_list_item_s* get_latest_item(appdata_s *ad, peer_with_pic_s *item) } else { main_list_item->profile_pic_path = NULL; } + + if (peer_info->peer_type == TGL_PEER_USER) { + char *user_name = NULL; + char *first_name = NULL; + char *last_name = NULL; + char *phone_num = NULL; + get_buddy_contact_details_from_db(peer_info->peer_id, &first_name, &last_name, &phone_num); + + if (!first_name && !last_name && phone_num) { + first_name = phone_num; + } + + if (!last_name) { + last_name = ""; + } + user_name = (char*)malloc(strlen(first_name) + strlen(" ") + strlen(last_name) + 1); + strcpy(user_name, first_name); + strcat(user_name, " "); + strcat(user_name, last_name); + main_list_item->buddy_display_name = user_name; + } else if (peer_info->peer_type == TGL_PEER_CHAT) { + main_list_item->buddy_display_name = replace(peer_info->print_name, '_', " "); + } else { + main_list_item->buddy_display_name = strdup(""); + } + main_list_item->user_name_lbl = NULL; main_list_item->status_lbl = NULL; main_list_item->date_lbl = NULL; @@ -2546,6 +2667,11 @@ void app_nf_back_cb(void *data, Evas_Object *obj, void *event_info) free(old_item->profile_pic_path); old_item->profile_pic_path = NULL; } + if (old_item->buddy_display_name) { + free(old_item->buddy_display_name); + old_item->buddy_display_name = NULL; + } + old_item->date_lbl = NULL; old_item->msg_status_lbl = NULL; old_item->main_item_layout = NULL; @@ -2802,8 +2928,32 @@ static void create_base_gui(appdata_s *ad) //eina_list_free(user_info); } -static bool -app_create(void *data) +void on_tg_service_result_cb(app_control_h request, app_control_h reply, app_control_result_e result, void *user_data) +{ + appdata_s *ad = user_data; + if (result == APP_CONTROL_RESULT_SUCCEEDED) { + if (ad) { + show_toast(ad, "Server launched successfully."); + } else { + show_toast(ad, "Server not launched."); + } + } +} + +static void launch_tg_server(void *data) +{ + appdata_s *ad = data; + app_control_h app_control; + int ret = app_control_create(&app_control); +/* ret = app_control_set_operation(app_control, "http://tizen.org/appcontrol/operation/launch_on_event"); + ret = app_control_set_mime(app_control, "application/telegram"); + ret = app_control_set_uri(app_control, "http://tizen.org/appcontrol/operation/telegram_start");*/ + ret = app_control_set_app_id(app_control, "org.tizen.tg-engine-service"); + ret = app_control_send_launch_request(app_control, &on_tg_service_result_cb, ad); + ret = app_control_destroy(app_control); +} + +static bool app_create(void *data) { /* Hook to take necessary actions before main event loop starts @@ -2840,6 +2990,7 @@ app_create(void *data) } init_service(ad); + launch_tg_server(data); return true; } @@ -2954,6 +3105,10 @@ app_terminate(void *data) free(main_item->profile_pic_path); main_item->profile_pic_path = NULL; } + if (main_item->buddy_display_name) { + free(main_item->buddy_display_name); + main_item->buddy_display_name = NULL; + } main_item->date_lbl = NULL; main_item->msg_status_lbl = NULL; main_item->main_item_layout = NULL; diff --git a/TelegramTizen/src/tg_messaging_view.c b/TelegramTizen/src/tg_messaging_view.c index 1ad3b1b..5dcb587 100644 --- a/TelegramTizen/src/tg_messaging_view.c +++ b/TelegramTizen/src/tg_messaging_view.c @@ -563,6 +563,43 @@ void on_media_chat_item_clicked(void* data, Evas_Object *entry, void* event_info } } +static void on_video_play_pressed(void *data, Evas_Object *obj, void *event_info) +{ + if (!data) + return; + elm_image_file_set(data, ui_utils_get_resource(TG_PLAY_PRESS_ICON), NULL); +} + +static void on_video_play_unpressed(void *data, Evas_Object *obj, void *event_info) +{ + if (!data) + return; + elm_image_file_set(data, ui_utils_get_resource(TG_PLAY_NORMAL_ICON), NULL); +} + +static Evas_Object* get_video_paly_icon(Evas_Object *parent) +{ + Evas_Object* play_pause_btn = elm_button_add(parent); + elm_object_style_set(play_pause_btn, "transparent"); + evas_object_size_hint_align_set(play_pause_btn, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(play_pause_btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + Evas_Object* play_pause_icon = elm_image_add(parent); + evas_object_size_hint_align_set(play_pause_icon, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(play_pause_icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + elm_image_file_set(play_pause_icon, ui_utils_get_resource(TG_PLAY_NORMAL_ICON), NULL); + + elm_image_resizable_set(play_pause_icon, EINA_TRUE, EINA_TRUE); + evas_object_show(play_pause_icon); + + elm_object_content_set(play_pause_btn, play_pause_icon); + + evas_object_smart_callback_add(play_pause_btn, "pressed", on_video_play_pressed, play_pause_icon); + evas_object_smart_callback_add(play_pause_btn, "unpressed", on_video_play_unpressed, play_pause_icon); + return play_pause_btn; +} + static Evas_Object *get_media_layout_with_play(char *img_path, Evas_Object *parent, Eina_Bool show_play_icon) { char edj_path[PATH_MAX] = {0, }; @@ -577,8 +614,11 @@ static Evas_Object *get_media_layout_with_play(char *img_path, Evas_Object *pare elm_object_part_content_set(rec_video_layout, "swallow.video_thumb_item", vid_thumb_icon); if (show_play_icon) { - Evas_Object* play_img = get_image_from_path(ui_utils_get_resource(MEDIA_PLAY_ICON), parent); - elm_object_part_content_set(rec_video_layout, "swallow.play_btn", play_img); +/* Evas_Object* play_img = get_image_from_path(ui_utils_get_resource(MEDIA_PLAY_ICON), parent); + elm_object_part_content_set(rec_video_layout, "swallow.play_btn", play_img);*/ + + Evas_Object* play_pause_btn = get_video_paly_icon(parent); + elm_object_part_content_set(rec_video_layout, "swallow.play_btn", play_pause_btn); } return rec_video_layout; @@ -1179,7 +1219,8 @@ void on_media_download_completed(appdata_s* ad, int buddy_id, long long media_id } if ((strstr(media_type_str, "video") != NULL) || (strstr(media_type_str, "audio") != NULL)) { - Evas_Object* play_img = get_image_from_path(ui_utils_get_resource(MEDIA_PLAY_ICON), img_item); + Evas_Object* play_img = get_video_paly_icon(img_item); + //Evas_Object* play_img = get_image_from_path(ui_utils_get_resource(MEDIA_PLAY_ICON), img_item); elm_object_part_content_set(img_item, "swallow.play_btn", play_img); } else if (strstr(media_type_str, "image") != NULL) { elm_image_file_set(img_item, file_path, NULL); diff --git a/TelegramTizen/src/tg_user_main_view.c b/TelegramTizen/src/tg_user_main_view.c index ba5ef4a..106453c 100644 --- a/TelegramTizen/src/tg_user_main_view.c +++ b/TelegramTizen/src/tg_user_main_view.c @@ -17,6 +17,7 @@ #include "tg_main_item_deletion_view.h" #include "tg_search_message_view.h" + static Evas_Object *create_image_object_from_file(const char *icon_name, Evas_Object *parent) { Evas_Object *icon = elm_image_add(parent); @@ -310,9 +311,9 @@ char* on_longpress_group_menu_text_get_cb(void *data, Evas_Object *obj, const ch { int id = (int) data; if (id == 0) { - return strdup("Clear history"); + return strdup(i18n_get_text("IDS_TGRAM_OPT_CLEAR_HISTORY_ABB3")); } else { - return strdup("Delete and exit"); + return strdup(i18n_get_text("IDS_TGRAM_OPT_LEAVE_CHAT")); } } @@ -320,9 +321,9 @@ char* on_longpress_single_menu_text_get_cb(void *data, Evas_Object *obj, const c { int id = (int) data; if (id == 0) { - return strdup("Clear history"); + return strdup(i18n_get_text("IDS_TGRAM_OPT_CLEAR_HISTORY_ABB3")); } else { - return strdup("Delete"); + return strdup(i18n_get_text("IDS_TGRAM_OPT_DELETE")); } } @@ -732,10 +733,12 @@ Evas_Object* on_chat_item_load_requested(void *data, Evas_Object *obj, const cha /*************************** user name ***************************************/ +#if 0 char* user_name = replace(item->peer_print_name, '_', ""); +#endif char buf[512] = {'\0'}; - snprintf(buf, 512, "%s", user_name); - free(user_name); + snprintf(buf, 512, "%s", item->buddy_display_name); + //free(user_name); Evas_Object* name_lbl = elm_label_add(ad->nf); elm_object_text_set(name_lbl, buf); diff --git a/TelegramTizen/tg_utils/tg_common.h b/TelegramTizen/tg_utils/tg_common.h index f40b5df..22ae37a 100644 --- a/TelegramTizen/tg_utils/tg_common.h +++ b/TelegramTizen/tg_utils/tg_common.h @@ -75,7 +75,7 @@ #define MEDIA_DOWNLOAD_ICON FM_ICON_PATH"/ic_attach_download.png" #define MEDIA_MANUAL_DOWNLOAD_ICON FM_ICON_PATH"/ic_attach_manual_download.png" -#define MEDIA_PLAY_ICON FM_ICON_PATH"/playvideo.png" +//#define MEDIA_PLAY_ICON FM_ICON_PATH"/playvideo.png" #define DEFAULT_TELEGRAM_ICON FM_ICON_PATH"/tg_icon.png" #define TELEGRAM_BUTTON_ADD_ICON FM_ICON_PATH"/telegram_button_add.png" @@ -510,6 +510,7 @@ typedef struct tg_main_list_item { Evas_Object* msg_status_lbl; Evas_Object* main_item_layout; Eina_Bool is_selected; + char *buddy_display_name; } tg_main_list_item_s; typedef struct appdata { diff --git a/tg-engine-service/mtprotocol/queries.c b/tg-engine-service/mtprotocol/queries.c index 98adabd..0bfe997 100644 --- a/tg-engine-service/mtprotocol/queries.c +++ b/tg-engine-service/mtprotocol/queries.c @@ -369,10 +369,15 @@ int tglq_query_result(struct tgl_state *TLS, long long id) vlogprintf(E_DEBUG, "in_ptr = %p, end_ptr = %p\n", in_ptr, in_end); if (skip_type_any(q->type) < 0) { vlogprintf(E_ERROR, "Skipped %ld int out of %ld(type %s)\n",(long)(in_ptr - save),(long)(in_end - save), q->type->type->id); - assert(0); + //sandeep + //assert(0); + return 0; + } + // sandeep + //assert(in_ptr == in_end); + if (in_ptr != in_end) { + return 0; } - - assert(in_ptr == in_end); in_ptr = save; } q->methods->on_answer(TLS, q); -- 2.7.4 From 285f479f11b4b2d8e52fcf9ebba24af920e76d20 Mon Sep 17 00:00:00 2001 From: Sung-jae Park Date: Mon, 26 Oct 2015 21:45:10 +0900 Subject: [PATCH 13/16] Fix the conflict changes. Change-Id: I9648d75d0446ca80e25a5460c0df30112f224f36 --- TelegramTizen/inc/tg_audio_player.h | 45 + TelegramTizen/res/edje/telegram_init_screen.edc | 346 ++-- TelegramTizen/res/edje/telegram_theme.edc | 1815 ++++++++++++++++++++ .../res/images/telegram_audio_player_pause_dim.png | Bin 0 -> 1861 bytes .../images/telegram_audio_player_pause_normal.png | Bin 0 -> 1895 bytes .../images/telegram_audio_player_pause_press.png | Bin 0 -> 1912 bytes .../res/images/telegram_audio_player_play_dim.png | Bin 0 -> 2215 bytes .../images/telegram_audio_player_play_normal.png | Bin 0 -> 2268 bytes .../images/telegram_audio_player_play_press.png | Bin 0 -> 2214 bytes .../res/images/telegram_icon_expand_close.png | Bin 0 -> 1403 bytes .../res/images/telegram_icon_expand_open.png | Bin 0 -> 1380 bytes TelegramTizen/src/telegramtizen.c | 25 +- TelegramTizen/src/tg_audio_player.c | 185 ++ TelegramTizen/src/tg_messaging_view.c | 722 +++++++- TelegramTizen/src/tg_settings_view.c | 26 +- TelegramTizen/src/tg_user_main_view.c | 2 +- TelegramTizen/tg_utils/tg_common.h | 13 +- tg-engine-service/inc/tg_db_wrapper.h | 2 + tg-engine-service/src/tg_db_wrapper.c | 90 +- tg-engine-service/tg_engine/tg_engine.c | 8 +- 20 files changed, 3062 insertions(+), 217 deletions(-) create mode 100644 TelegramTizen/inc/tg_audio_player.h create mode 100644 TelegramTizen/res/images/telegram_audio_player_pause_dim.png create mode 100644 TelegramTizen/res/images/telegram_audio_player_pause_normal.png create mode 100644 TelegramTizen/res/images/telegram_audio_player_pause_press.png create mode 100644 TelegramTizen/res/images/telegram_audio_player_play_dim.png create mode 100644 TelegramTizen/res/images/telegram_audio_player_play_normal.png create mode 100644 TelegramTizen/res/images/telegram_audio_player_play_press.png create mode 100644 TelegramTizen/res/images/telegram_icon_expand_close.png create mode 100644 TelegramTizen/res/images/telegram_icon_expand_open.png create mode 100644 TelegramTizen/src/tg_audio_player.c diff --git a/TelegramTizen/inc/tg_audio_player.h b/TelegramTizen/inc/tg_audio_player.h new file mode 100644 index 0000000..2d85368 --- /dev/null +++ b/TelegramTizen/inc/tg_audio_player.h @@ -0,0 +1,45 @@ +/* + * tg_audio_player.h + * + * Created on: Oct 22, 2015 + * Author: sandeep + */ + +#ifndef TG_AUDIO_PLAYER_H_ +#define TG_AUDIO_PLAYER_H_ + +#include "tg_common.h" +#include + +typedef enum AUDIO_PLAYER_STATE { + TG_AUDIO_PLAYER_STATE_NONE = 1, + TG_AUDIO_PLAYER_STATE_INITIALIZED, + TG_AUDIO_PLAYER_STATE_PLAYING, + TG_AUDIO_PLAYER_STATE_INTERRUPTED, + TG_AUDIO_PLAYER_STATE_PAUSE, + TG_AUDIO_PLAYER_STATE_ERROR, + TG_AUDIO_PLAYER_STATE_END +} TG_AUDIO_PLAYER_STATE; + +typedef void (*tg_player_state_changed)(void* handler, TG_AUDIO_PLAYER_STATE state, void *user_data); +typedef void (*tg_player_progress_updated)(void* handler, int current, int total, void *user_data); + +typedef struct tg_player_handler_s { + player_h handler; + tg_player_state_changed state_callback; + tg_player_progress_updated progress_callback; + TG_AUDIO_PLAYER_STATE state; + void *user_data; + Ecore_Timer *timer; + int current_pos; +} tg_player_handler; + +tg_player_handler* init_audio_player(const char *audio_file, tg_player_state_changed state_change, tg_player_progress_updated progress_update, void *user_data); + +void play_audio_player(tg_player_handler *handler); + +void pause_audio_player(tg_player_handler *handler); + +void destroy_audio_player(tg_player_handler *handler); + +#endif /* TG_AUDIO_PLAYER_H_ */ diff --git a/TelegramTizen/res/edje/telegram_init_screen.edc b/TelegramTizen/res/edje/telegram_init_screen.edc index 57a38de..9474df1 100644 --- a/TelegramTizen/res/edje/telegram_init_screen.edc +++ b/TelegramTizen/res/edje/telegram_init_screen.edc @@ -20,6 +20,8 @@ styles { collections { +base_scale: 2.6; + #define WIN_WIDTH 720 #define WIN_HEIGHT 1280 @@ -976,85 +978,211 @@ collections { } } } + + +group +{ + name: "message_title_box"; + parts{ + part{ + name: "swallow.back_arrow"; + type: SWALLOW; + description{ + state: "default" 0.0; + rel1 { relative: 0.01 0.0; } + rel2 { relative: 0.05 1.0; } + } + } + + part{ + name: "swallow.profile_pic"; + type: SWALLOW; + description{ + state: "default" 0.0; + rel1 { relative: 0.05 0.032; } + rel2 { relative: 0.196 0.968; } + } + } + + part{ + name: "swallow.profile_name"; + type: SWALLOW; + description{ + state: "default" 0.0; + rel1 { relative: 0.196 0.1; } + rel2 { relative: 0.8 0.5; } + } + } + part{ + name: "swallow.profile_time"; + type: SWALLOW; + description{ + state: "default" 0.0; + rel1 { relative: 0.196 0.5; } + rel2 { relative: 0.8 1.0; } + } + } + part{ + name: "swallow.expand_btn"; + type: SWALLOW; + description{ + state: "default" 0.0; + rel1 { relative: 0.8 0.0; } + rel2 { relative: 1.0 1.0; } + } + } + } +} + + +group +{ + name: "chat_title_box"; + parts{ + part{ + name: "main_bg"; + type: RECT; + description{ + state: "default" 0.0; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 1.0; } + color: 45 165 224 255; + } + } + part{ + name: "swallow.back_arrow"; + type: SWALLOW; + description{ + state: "default" 0.0; + rel1 { relative: 0.0 0.3; } + rel2 { relative: 0.1 0.7; } + } + } + + part{ + name: "swallow.profile_pic"; + type: SWALLOW; + scale: 1; + description{ + state: "default" 0.0; + rel1 { relative: (72+60)/720 (16.8+60)/153.6; } + rel2 { relative: (72+60)/720 (16.8+60)/153.6; } + min: 180 120; + max: 180 120; + fixed: 1 1; + } + } + part{ + name: "swallow.profile_name,space"; + type: SPACER; + description{ + state: "default" 0.0; + rel1 { relative: 1.0 0.1; to_x: "swallow.profile_pic"; } + rel2 { relative: 1.0 0.5; to_x: "swallow.profile_pic"; } + min: 15 0; + max: 15 -1; + fixed: 1 0; + } + } + + part{ + name: "swallow.profile_name"; + type: SWALLOW; + description{ + state: "default" 0.0; + rel1 { relative: 1.0 0.1; to_x: "swallow.profile_name,space"; } + rel2 { relative: 0.8 0.5; } + } + } + part{ + name: "swallow.profile_time"; + type: SWALLOW; + description{ + state: "default" 0.0; + rel1 { relative: 1.0 0.5; to_x: "swallow.profile_name,space"; } + rel2 { relative: 0.8 1.0; } + } + } + + part{ + name: "swallow.expand_btn"; + type: SWALLOW; + description{ + state: "default" 0.0; + rel1 { relative: 0.8 0.3; } + rel2 { relative: 1.0 0.7; } + } + } + } + programs { + program { + name: "pic_default"; + signal: "pro_pic_default"; + source: "pro_pic_resize"; + action: STATE_SET "default" 0.0; + target: "swallow.profile_pic"; + } + program { + name: "pic_land"; + signal: "pro_pic_land"; + source: "pro_pic_resize"; + action: STATE_SET "land" 0.0; + target: "swallow.profile_pic"; + } + } +} group { name: "chat_messaging_layout"; parts{ - part { - name: "bg"; - type:RECT; + part{ + name: "swallow.title_box"; + type: SWALLOW; description{ state: "default" 0.0; rel1 { relative: 0.0 0.0; } - rel2 { relative: 1.0 1.0; } + rel2 { relative: 1.0 0.12; } color: 0 0 0 0; } - } - - + } part{ - name: "swallow.title_box.bg"; - type:RECT; - scale: 1; - description{ - state: "default" 0.0; - min: WIN_WIDTH 62; - max: WIN_WIDTH 62; - fixed: 1 1; - align: 0 0; - rel1 { relative: 0.0 0.0; to: "bg"; } - rel2 { relative: 0.0 0.0; to: "bg"; } - color: 45 165 224 255; - } - } - - part{ - name: "swallow.title_box"; - type:SWALLOW; - scale: 1; + name: "swallow.chat_box"; + type: SWALLOW; description{ state: "default" 0.0; - min: WIN_WIDTH 62; - max: WIN_WIDTH 62; - fixed: 1 1; - align: 0 0; - rel1 { relative: 0.0 0.0; to: "bg"; } - rel2 { relative: 0.0 0.0; to: "bg"; } - color: 50 23 55 255; + rel1 { relative: 0.0 0.12; } + rel2 { relative: 1.0 1.0; } + color: 0 0 0 0; } } - part{ - name: "swallow.chat_box"; - type:SWALLOW; + part{ + name: "swallow.no_msg_text"; + type: SWALLOW; description{ state: "default" 0.0; - rel1 { relative: 0.0 1.0; to_x: "bg"; to_y: "swallow.title_box"; } - rel2 { relative: 1.0 0.0; to_x: "bg"; to_y: "swallow.entry_box"; } - color: 27 54 87 255; + rel1 { relative: 0.0 0.55; } + rel2 { relative: 1.0 0.65; } + color: 0 0 0 0; } } - part{ - name: "swallow.entry_box"; + part{ + name: "swallow.group_detail_box,bg"; type: SWALLOW; description{ state: "default" 0.0; - min: 0 0; - max: 0 0; - fixed: 1 1; - align: 0 1; - rel1 { relative: 0.0 1.0; to: "bg"; } - rel2 { relative: 1.0 1.0; to: "bg"; } - color: 50 100 255 255; + rel1 { relative: 0.0 0.12; } + rel2 { relative: 1.0 0.25; } + color: 0 0 0 0; } } part{ - name: "swallow.no_msg_text"; + name: "swallow.group_detail_box"; type: SWALLOW; description{ state: "default" 0.0; - rel1 { relative: 0.0 0.55; } - rel2 { relative: 1.0 0.65; } + rel1 { relative: 0.0 0.12; } + rel2 { relative: 1.0 0.25; } color: 0 0 0 0; } } @@ -1180,51 +1308,6 @@ collections { } } -group -{ - name: "message_title_box"; - parts{ - - part{ - name: "swallow.back_arrow"; - type:SWALLOW; - description{ - state: "default" 0.0; - rel1 { relative: 0.01 0.0; } - rel2 { relative: 0.05 1.0; } - } - } - - part{ - name: "swallow.profile_pic"; - type:SWALLOW; - description{ - state: "default" 0.0; - rel1 { relative: 0.05 0.032; } - rel2 { relative: 0.196 0.968; } - } - } - - part{ - name: "swallow.profile_name"; - type:SWALLOW; - description{ - state: "default" 0.0; - rel1 { relative: 0.196 0.1; } - rel2 { relative: 0.8 0.5; } - } - } - part{ - name: "swallow.profile_time"; - type:SWALLOW; - description{ - state: "default" 0.0; - rel1 { relative: 0.196 0.5; } - rel2 { relative: 0.8 1.0; } - } - } - } -} images { image: "bubble_sent_bg.#.png" COMP; @@ -1458,40 +1541,38 @@ group images { image: "telegram_button_on_bg.#.png" COMP; } + + + group { name: "chat_service_item_box"; parts{ - part { - name: "chat_service_bg,color"; - type: RECT; - description { - state: "default" 0.0; - rel1 { relative: 0.0 0.0; } - rel2 { relative: 1.0 1.0; } - color: 225 237 241 0; - } - } part { - name: "chat_service_bg"; - type: RECT; - description { - state: "default" 0.0; - rel1 { relative: 0.0 0.0; to, "swallow.chat_service_text"; } - rel2 { relative: 1.0 1.0; to, "swallow.chat_service_text"; } + name: "bg"; + type:RECT; + scale: 1; + description{ + state: "default" 0.0; + rel1 { relative: 0.0 0.5; } + rel2 { relative: 1.0 0.5; } + max: -1 116; + min: 0 116; + align: 0.5 0.5; + fixed: 0 1; color: 0 0 0 0; - } - } + } + } part{ name: "chat_serv_image"; type:IMAGE; description{ state: "default" 0.0; - rel1 { relative: 0.0 -0.2; to, "chat_service_bg"; } - rel2 { relative: 1.0 0.9; to, "chat_service_bg"; } + rel1 { relative: 32/720 27/116; to, "bg"; } + rel2 { relative: (720-32)/720 (116-41)/116; to, "bg"; } image { - border: 5 5 5 5; + border: 46 46 0 0; normal: "telegram_button_on_bg.#.png"; } color: 0 0 0 25; @@ -1502,8 +1583,8 @@ group type:SWALLOW; description{ state: "default" 0.0; - rel1 { relative: 0.1 0.2; } - rel2 { relative: 0.9 0.8; } + rel1 { relative: 0.0 0.0; to: "chat_serv_image"; } + rel2 { relative: 1.0 1.0; to: "chat_serv_image"; } } } } @@ -2419,7 +2500,32 @@ group } } } - + + group { + name: "bubble_audio_item_layout"; + parts { + part { + name: "swallow.play_icon"; + type: SWALLOW; + description { + state: default 0.0; + rel1.relative: 0.0 0.0; + rel2.relative: 0.2 1.0; + color: 255 0 0 255; + } + } + part { + name: "swallow.progress_icon"; + type: SWALLOW; + description { + state: default 0.0; + rel1.relative: 0.25 0.0; + rel2.relative: 0.75 1.0; + color: 0 255 0 255; + } + } + } + } group { name: "settings_screen"; diff --git a/TelegramTizen/res/edje/telegram_theme.edc b/TelegramTizen/res/edje/telegram_theme.edc index 951d624..be2bdd2 100644 --- a/TelegramTizen/res/edje/telegram_theme.edc +++ b/TelegramTizen/res/edje/telegram_theme.edc @@ -457,6 +457,1821 @@ styles { } +/****************** sandeep ****************/ + + +group { name: "elm/entry/base-noedit/readmessage_audio"; + parts { + part{ + name: "swallow.audio_bg"; + type: RECT; + description{ + state: "default" 0.0; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 0.9 1.0; } + color: 0 0 0 0; + } + } + part { + name: "elm.bubble.callerid.pad"; + type: SPACER; + scale: 1; + description { + state: "default" 0.0; + rel2.relative: 0.0 0.0; + align: 0.0 0.0; + min: 0 0; + fixed: 1 1; + } + description { + state: "callerid_on" 0.0; + inherit: "default" 0.0; + min: ENTRY_BUBBLE_CALLERID_PAD 0; + } + } + part { + name: "elm.callerid.icon.pad"; + type: SPACER; + scale: 1; + description { state: "default" 0.0; + rel2.relative: 0.0 0.0; + align: 0.0 0.0; + min: ENTRY_BUBBLE_CALLERID_ICON_PAD 0; + fixed: 1 1; + } + } + part { + name: "elm.swallow.callerid"; + type: SWALLOW; + scale: 1; + description { state: "default" 0.0; + min: ENTRY_BUBBLE_CALLERID_WIDTH ENTRY_BUBBLE_CALLERID_HEIGHT; + max: ENTRY_BUBBLE_CALLERID_WIDTH ENTRY_BUBBLE_CALLERID_HEIGHT; + fixed: 1 1; + align: 0.0 0.0; + rel1 { + to: "elm.callerid.icon.pad"; + relative: 1.0 0.0; + } + rel2 { + to: "elm.callerid.icon.pad"; + relative: 1.0 0.0; + } + visible: 0; + } + description { state: "callerid_on" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { + name: "elm.callerid.bottom.pad"; + type: SPACER; + scale: 1; + description { state: "default" 0.0; + } + description { state: "callerid_on" 0.0; + rel1 { + to: "elm.swallow.callerid"; + relative: 0.0 1.0; + } + rel2 { + to_x: "elm.swallow.callerid"; + relative: 0.0 1.0; + } + align: 0.0 0.0; + min: 0 0; + } + } + part { + name: "elm.bubble.groupchat.pad"; + type: SPACER; + scale: 1; + description { state: "default" 0.0; + rel1 { + to: "elm.bubble.callerid.pad"; + relative: 1.0 0.0; + } + rel2 { + to: "elm.bubble.callerid.pad"; + relative: 1.0 0.0; + } + align: 0.0 0.0; + min: 0 0; + fixed: 1 1; + } + description { + state: "groupchat_on"; + inherit: "default" 0.0; + min: 0 ENTRY_BUBBLE_GROUPCHAT_PAD; + } + } + part { + name: "elm.groupchat.text.pad"; + type: SPACER; + scale: 1; + description { state: "default" 0.0; + rel1.to: "elm.bubble.groupchat.pad"; + rel2 { + to: "elm.bubble.groupchat.pad"; + relative: 0.0 1.0; + } + align: 0.0 0.5; + min: ENTRY_BUBBLE_GROUPCHAT_TEXT_PAD 0; + fixed: 1 0; + } + } + part { + name: "elm.text.groupchat"; + type: TEXT; + scale: 1; + description { state: "default" 0.0; + align: 0.0 0.0; + text { + font: "Tizen:style=Regular"; + size: ENTRY_BUBBLE_GROUPCHAT_SIZE_INC; + align: 0.0 0.0; + text_class: "tizen"; + min: 1 1; + } + rel1 { + to: "elm.groupchat.text.pad"; + relative: 1.0 0.0; + } + rel2 { + to: "elm.groupchat.text.pad"; + relative: 1.0 0.0; + } + color: ENTRY_BUBBLE_GROUPCHAT_COLOR_INC; + visible: 0; + } + description { state: "groupchat_on" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + + part { + name: "elm.bubble.status.pad"; + type: SPACER; + scale: 1; + description { + state: "default" 0.0; + rel1.relative: 1.0 0.0; + align: 1.0 0.5; + min: ENTRY_BUBBLE_STATUS_PAD 0; + fixed: 1 0; + } + } + + part { + name: "elm.bubble.lefttop_gc.pad"; + type: SPACER; + scale: 1; + description { + state: "default" 0.0; + rel1 { + to_x: "elm.bubble.callerid.pad"; + to_y: "elm.bubble.groupchat.pad"; + relative: 1.0 1.0; + } + rel2 { + to_x: "elm.bubble.callerid.pad"; + to_y: "elm.bubble.groupchat.pad"; + } + align: 0.0 0.0; + min: ENTRY_BUBBLE_READ_LEFTTOP_GC_PAD; + fixed: 1 1; + } + } + part { + name: "elm.bubble.righttop_gc.pad"; + type: SPACER; + scale: 1; + description { + state: "default" 0.0; + /* rel1 { + to_x: "elm.bubble.status.pad"; + to_y: "elm.bubble.groupchat.pad"; + relative: 0.0 1.0; + } + rel2 { + to_x: "elm.bubble.status.pad"; + to_y: "elm.bubble.groupchat.pad"; + relative: 0.0 1.0; + } + align: 1.0 0.0;*/ + rel1 { + to: "elm.bubble.lefttop_gc.pad"; + relative: 0.0 0.0; + offset: 374 0; + } + rel2 { + to: "elm.bubble.lefttop_gc.pad"; + relative: 0.0 0.0; + offset: 374 0; + } + align: 0.0 0.0; + min: ENTRY_BUBBLE_READ_RIGHTTOP_GC_PAD; + fixed: 1 1; + } + } + + part { + name: "elm.bubble.lefttop.pad"; + type: SPACER; + scale: 1; + description { + state: "default" 0.0; + rel1 { + to_x: "elm.bubble.callerid.pad"; + to_y: "elm.bubble.groupchat.pad"; + relative: 1.0 1.0; + } + rel2 { + to_x: "elm.bubble.callerid.pad"; + to_y: "elm.bubble.groupchat.pad"; + } + align: 0.0 0.0; + min: ENTRY_BUBBLE_READ_LEFTTOP_PAD; + fixed: 1 1; + } + } + part { + name: "elm.bubble.righttop.pad"; + type: SPACER; + scale: 1; + description { + state: "default" 0.0; + /* rel1 { + to_x: "elm.bubble.status.pad"; + to_y: "elm.bubble.groupchat.pad"; + relative: 0.0 1.0; + } + rel2 { + to_x: "elm.bubble.status.pad"; + to_y: "elm.bubble.groupchat.pad"; + relative: 0.0 1.0; + }*/ + rel1 { + to: "elm.bubble.lefttop.pad"; + relative: 0.0 0.0; + offset: 374 0; + } + rel2 { + to: "elm.bubble.lefttop.pad"; + relative: 0.0 0.0; + offset: 374 0; + } + + align: 0.0 0.0; + min: ENTRY_BUBBLE_READ_RIGHTTOP_PAD; + fixed: 1 1; + } + } + part { + name: "elm.image.bg.ef"; + type: IMAGE; + scale: 1; + description { + state: "default" 0.0; + rel1.to: "elm.bubble.lefttop.pad"; + rel2.to: "swallow.audio_bg"; + image { + normal: "telegram_bubble_bg_receive_ef.#.png"; + } + color: 106 126 204 255; + } + description { state: "pressed" 0.0; + inherit: "default" 0.0; + color_class: "W042"; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color_class: "W0551"; + } + } + part { + name: "elm.image.bg"; + type: IMAGE; + scale: 1; + description { + state: "default" 0.0; + rel1.to: "elm.bubble.lefttop.pad"; + rel2.to: "swallow.audio_bg"; + image { + normal: "telegram_bubble_bg_receive.#.png"; + } + color: 106 126 204 255; + } + description { state: "pressed" 0.0; + inherit: "default" 0.0; + color_class: "W042"; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color_class: "W0551"; + } + } + +part { +name: "elm.text.gc"; +type:TEXT; + mouse_events: 1; + scale: 1; + + description { + state: "default" 0.0; + min: 1 1; + align: 0.0 1.0; + rel1 { + to: "elm.bubble.lefttop_gc.pad"; + relative: 1.0 1.0; + } + rel2 { + to: "elm.bubble.righttop_gc.pad"; + relative: 0.0 1.0; + } + visible: 1; + color_class: "T058"; + text { + font: "Tizen:style=Regular"; + size: ENTRY_BUBBLE_GROUPCHAT_SIZE_INC; + align: 0.0 0.0; + text_class: "tizen"; + min: 1 1; + } +} +} + + part { + name: "elm.text"; + type: TEXTBLOCK; + mouse_events: 1; + scale: 1; + entry_mode: PLAIN; + select_mode: BLOCK_HANDLE; + cursor_mode: BEFORE; + multiline: 1; + description { + state: "default" 0.0; + align: 0.0 0.0; + min: ENTRY_BUBBLE_TEXT_MIN; + rel1 { + to: "elm.bubble.lefttop.pad"; + relative: 1.0 1.0; + } + rel2 { + to: "elm.bubble.righttop.pad"; + relative: 0.0 1.0; + } + text { + style: "entry_bubble_receive_textblock_style"; + min: 0 1; + max: 1 0; + align: 0.0 0.0; + } + } + description { state: "gc" 0.0; + inherit: "default" 0.0; + rel1 { + to: "elm.bubble.lefttop_gc.pad"; + relative: 1.0 1.0; + } + rel2 { + to: "elm.bubble.righttop_gc.pad"; + relative: 0.0 1.0; + } + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + text { + style: "entry_textblock_disabled_style"; + } + } + } + part + { + name: "media_status_icon"; + type: SWALLOW; + description + { + state: "default" 0.0; + visible: 1; + align: 0.5 0; + max: MEDIA_WIDTH MEDIA_HEIGHT-MEDIA_DETAILS_LAYOUT_HT; + rel1 + { + to: "elm.text"; + relative: 0.0 0.0; + } + rel2 + { + to: "elm.text"; + relative: 1.0 1.0; + offset:0 -(MEDIA_DETAILS_LAYOUT_HT); + } + } + description + { + state: "vcontact" 0.0; + inherit: "default" 0.0; + max: VCONTACT_WIDTH VCONTACT_HEIGHT; + rel2 + { + to: "elm.text"; + relative: 1.0 1.0; + } + } + } + part { name: "event.rect"; + type: RECT; + repeat_events: 1; + scale: 1; + description { state: "default" 0.0; + color: 0 0 0 0; + rel1.to: "elm.image.bg"; + rel2.to: "elm.image.bg"; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { + name: "elm.rect.middle.pad"; + type: SPACER; + scale: 1; + description { + state: "default" 0.0; + rel1 { + to: "elm.text"; + relative: 0.0 1.0; + } + rel2.to: "elm.text"; + align: 0.5 0.0; + min: 0 0; + } + description { + state: "show" 0.0; + inherit: "default" 0.0; + min: 0 ENTRY_BUBBLE_MIDDLE_PAD; + } + } + part { + name: "elm.swallow.end"; + type: SWALLOW; + scale: 1; + description { state: "default" 0.0; + rel1 { + to: "elm.rect.middle.pad"; + relative: 0.0 1.0; + } + rel2.to: "elm.rect.middle.pad"; + align: 0.0 0.0; + } + } + part { + name: "elm.bubble.rightbottom.pad"; + type: SPACER; + scale: 1; + description { + /* rel1 { + to: "elm.swallow.end"; + relative: 1.0 1.0; + } + rel2.to: "elm.swallow.end";*/ + rel1{ + to: "elm.text"; + relative: 1.0 1.0; + } + rel2.to: "elm.text"; + align: 0.0 0.0; + min: ENTRY_BUBBLE_READ_RIGHTBOTTOM_PAD; + fixed: 1 1; + } + } + part { + name: "elm.icon.top.pad"; + type: SPACER; + scale: 1; + description { + state: "default" 0.0; + align: 0.0 0.0; + rel1 { + to: "elm.bubble.rightbottom.pad"; + relative: 0.0 1.0; + } + rel2 { + to: "elm.bubble.rightbottom.pad"; + relative: 0.0 1.0; + } + min: 0 0; + } + description { + state: "contents_on" 0.0; + inherit: "default" 0.0; + min: 0 ENTRY_BUBBLE_ICON_TOP_PAD; + } + } + part { + name: "elm.swallow.icon1"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + rel1 { + to_x: "elm.text"; + to_y: "elm.icon.top.pad"; + relative: 0.0 1.0; + } + rel2 { + to_x: "elm.text"; + to_y: "elm.icon.top.pad"; + relative: 0.0 1.0; + } + min: 0 0; + align: 0.0 0.0; + visible: 0; + } + description { + state: "contents_on" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + + part { + name: "pad_top"; + type: SPACER; + description { + state: "default" 0.0; + min: 10 10; + max: -1 10; + rel1 { + to: "elm.text"; + relative: 0.0 1.0; + } + rel2 { + to: "elm.text"; + relative: 1.0 1.0; + } + } + } + + part { + name: "pad_bottom"; + type: SPACER; + description { + state: "default" 0.0; + min: 10 10; + max: -1 10; + rel1 { + to_x: "elm.text"; + relative: 0.0 1.0; + to_y: "elm.image.bg"; + relative: 0.0 1.0; + } + rel2 { + to_x: "elm.text"; + relative: 1.0 1.0; + to_y: "elm.image.bg"; + relative: 1.0 1.0; + } + align: 0.5 1; + } + } +/* + part { + name: "time"; + type:TEXT; + mouse_events: 1; + scale: 1; + description { + state: "default" 0.0; + min: 1 1; + align: 1.0 0.5; + rel1 { + to: "pad_top"; + relative: 1.0 1.0; + } + rel2 { + to: "pad_bottom"; + relative: 1.0 0.0; + } + visible: 1; + //color_class: "T058"; + color: ENTRY_BUBBLE_TIME_COLOR; + text { + min: 1 1; + align: 0.5 0.5; + //text_class: "T058"; + size: 10; + } + } + } +*/ + part{ + name: "time"; + type:TEXT; + mouse_events: 1; + scale: 1; + description{ + state: "default" 0.0; + rel1 { relative: 0.65 0.8; } + rel2 { relative: 0.85 0.95; } + visible: 1; + //color_class: "T058"; + color: ENTRY_BUBBLE_TIME_COLOR; + text { + min: 1 1; + align: 0.5 0.5; + //text_class: "T058"; + size: 10; + } + } + } + part { + name: "elm.icon.pad"; + type: SPACER; + scale: 1; + description { + state: "default" 0.0; + rel1 { + to: "elm.swallow.icon1"; + relative: 1.0 0.0; + } + rel2 { + to: "elm.swallow.icon1"; + relative: 1.0 1.0; + } + min: ENTRY_BUBBLE_ICON_PAD 0; + align: 0.0 0.5; + } + } + part { + name: "elm.swallow.icon2"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + rel1 { + to: "elm.icon.pad"; + relative: 1.0 0.0; + } + rel2 { + to: "elm.icon.pad"; + relative: 1.0 1.0; + } + min: 0 0; + align: 0.0 0.5; + visible: 0; + } + description { + state: "contents_on" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { + name: "elm.bottom.pad"; + type: SPACER; + scale: 1; + description { + rel1 { + to_y: "elm.swallow.icon1"; + relative: 0.0 1.0; + } + min: 0 0; + } + } + part { + name: "elm.status.pad"; + type: SPACER; + scale: 1; + description { + state: "default" 0.0; + rel1 { + to: "elm.bubble.rightbottom.pad"; + relative: 1.0 1.0; + } + rel2.to: "elm.bubble.rightbottom.pad"; + min: ENTRY_BUBBLE_STATUS_TEXT_ICON_PAD; + align: 0.0 1.0; + fixed: 1 1; + } + } + part { name: "elm.text.time"; + type: TEXT; + scale: 1; + description { state: "default" 0.0; + color_class: "T0220"; + text { + text_class: "T0220"; + min: 1 1; + align: 0.0 1.0; + } + rel1 { + to: "elm.status.pad"; + relative: 1.0 0.0; + } + rel2 { + to: "elm.status.pad"; + relative: 1.0 0.0; + } + align: 0.0 1.0; + min: ENTRY_BUBBLE_STATUS_TIME_SIZE; + fixed: 1 1; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { name: "elm.text.status"; + type: TEXT; + scale: 1; + description { state: "default" 0.0; + color_class: "T0220"; + text { + text_class: "T0220"; + min: 0 1; + align: 0.0 1.0; + } + rel1.to: "elm.text.time"; + rel2 { + to: "elm.text.time"; + relative: 1.0 0.0; + } + align: 0.0 1.0; + min: ENTRY_BUBBLE_STATUS_TIME_SIZE; + fixed: 1 1; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { + name: "elm.swallow.status"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + rel1 { + to: "elm.status.pad"; + relative: 1.0 0.0; + } + rel2 { + to: "elm.status.pad"; + relative: 1.0 0.0; + } + align: 0.0 1.0; + fixed: 1 1; + visible: 0; + } + description { state: "enabled" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + } + programs { + program { name: "focus"; + signal: "load"; + source: ""; + action: FOCUS_SET; + target: "elm.text"; + } + program { name: "disable"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "elm.text"; + target: "event.rect"; + } + program { name: "enable"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text"; + target: "event.rect"; + } + program { name: "mouse_down"; + signal: "mouse,down,*"; + source: "event.rect"; + action: STATE_SET "pressed" 0.0; + target: "elm.image.bg"; + } + program { name: "mouse_up"; + signal: "mouse,up,*"; + source: "event.rect"; + action: STATE_SET "default" 0.0; + target: "elm.image.bg"; + } + program { name: "go_callerid_on"; + signal: "elm,state,callerid,enabled"; + source: "elm"; + action: STATE_SET "callerid_on" 0.0; + target: "elm.bubble.callerid.pad"; + target: "elm.swallow.callerid"; + target: "elm.callerid.bottom.pad"; + } + program { name: "go_callerid_off"; + signal: "elm,state,callerid,disabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.bubble.callerid.pad"; + target: "elm.swallow.callerid"; + target: "elm.callerid.bottom.pad"; + } + program { name: "go_groupchat_on"; + signal: "elm,state,groupchat,enabled"; + source: "elm"; + action: STATE_SET "gc" 0.0; + target: "elm.text"; + } + program { name: "go_groupchat_off"; + signal: "elm,state,groupchat,disabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text"; + } + program { name: "go_textstatus_on"; + signal: "elm,state,text,status,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text.time"; + target: "elm.text.status"; + after: "go_contentstatus_off"; + } + program { name: "go_textstatus_off"; + signal: "elm,state,text,status,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "elm.text.time"; + target: "elm.text.status"; + } + program { name: "go_contentstatus_on"; + signal: "elm,state,content,status,enabled"; + source: "elm"; + action: STATE_SET "enabled" 0.0; + target: "elm.swallow.status"; + after: "go_textstatus_off"; + } + program { name: "go_contentstatus_off"; + signal: "elm,state,content,status,disabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.status"; + } + program { name: "show_middle_pad"; + signal: "elm,state,middle,pad,enabled"; + source: "elm"; + action: STATE_SET "show" 0.0; + target: "elm.rect.middle.pad"; + } + program { name: "hide_middle_pad"; + signal: "elm,state,middle,pad,disabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.rect.middle.pad"; + } + program { name: "go_contents_on"; + signal: "elm,state,contents,enabled"; + source: "elm"; + action: STATE_SET "contents_on" 0.0; + target: "elm.icon.top.pad"; + target: "elm.swallow.icon1"; + target: "elm.swallow.icon2"; + } + program { name: "go_contents_off"; + signal: "elm,state,contents,disabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.icon.top.pad"; + target: "elm.swallow.icon1"; + target: "elm.swallow.icon2"; + } + program { name: "media_status_vcontact"; + signal: "elm,state,set,vcontact,status"; + source: "elm"; + action: STATE_SET "vcontact" 0.0; + target: "media_status_icon"; + } + } + } + +/******************* sandeep ***************/ + +/***************** land *******************/ + +group { name: "elm/entry/base-noedit/readmessage_audio_land"; + parts { + part{ + name: "swallow.audio_bg"; + type: RECT; + description{ + state: "default" 0.0; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 0.5 1.0; } + color: 0 0 0 0; + } + } + part { + name: "elm.bubble.callerid.pad"; + type: SPACER; + scale: 1; + description { + state: "default" 0.0; + rel2.relative: 0.0 0.0; + align: 0.0 0.0; + min: 0 0; + fixed: 1 1; + } + description { + state: "callerid_on" 0.0; + inherit: "default" 0.0; + min: ENTRY_BUBBLE_CALLERID_PAD 0; + } + } + part { + name: "elm.callerid.icon.pad"; + type: SPACER; + scale: 1; + description { state: "default" 0.0; + rel2.relative: 0.0 0.0; + align: 0.0 0.0; + min: ENTRY_BUBBLE_CALLERID_ICON_PAD 0; + fixed: 1 1; + } + } + part { + name: "elm.swallow.callerid"; + type: SWALLOW; + scale: 1; + description { state: "default" 0.0; + min: ENTRY_BUBBLE_CALLERID_WIDTH ENTRY_BUBBLE_CALLERID_HEIGHT; + max: ENTRY_BUBBLE_CALLERID_WIDTH ENTRY_BUBBLE_CALLERID_HEIGHT; + fixed: 1 1; + align: 0.0 0.0; + rel1 { + to: "elm.callerid.icon.pad"; + relative: 1.0 0.0; + } + rel2 { + to: "elm.callerid.icon.pad"; + relative: 1.0 0.0; + } + visible: 0; + } + description { state: "callerid_on" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { + name: "elm.callerid.bottom.pad"; + type: SPACER; + scale: 1; + description { state: "default" 0.0; + } + description { state: "callerid_on" 0.0; + rel1 { + to: "elm.swallow.callerid"; + relative: 0.0 1.0; + } + rel2 { + to_x: "elm.swallow.callerid"; + relative: 0.0 1.0; + } + align: 0.0 0.0; + min: 0 0; + } + } + part { + name: "elm.bubble.groupchat.pad"; + type: SPACER; + scale: 1; + description { state: "default" 0.0; + rel1 { + to: "elm.bubble.callerid.pad"; + relative: 1.0 0.0; + } + rel2 { + to: "elm.bubble.callerid.pad"; + relative: 1.0 0.0; + } + align: 0.0 0.0; + min: 0 0; + fixed: 1 1; + } + description { + state: "groupchat_on"; + inherit: "default" 0.0; + min: 0 ENTRY_BUBBLE_GROUPCHAT_PAD; + } + } + part { + name: "elm.groupchat.text.pad"; + type: SPACER; + scale: 1; + description { state: "default" 0.0; + rel1.to: "elm.bubble.groupchat.pad"; + rel2 { + to: "elm.bubble.groupchat.pad"; + relative: 0.0 1.0; + } + align: 0.0 0.5; + min: ENTRY_BUBBLE_GROUPCHAT_TEXT_PAD 0; + fixed: 1 0; + } + } + part { + name: "elm.text.groupchat"; + type: TEXT; + scale: 1; + description { state: "default" 0.0; + align: 0.0 0.0; + text { + font: "Tizen:style=Regular"; + size: ENTRY_BUBBLE_GROUPCHAT_SIZE_INC; + align: 0.0 0.0; + text_class: "tizen"; + min: 1 1; + } + rel1 { + to: "elm.groupchat.text.pad"; + relative: 1.0 0.0; + } + rel2 { + to: "elm.groupchat.text.pad"; + relative: 1.0 0.0; + } + color: ENTRY_BUBBLE_GROUPCHAT_COLOR_INC; + visible: 0; + } + description { state: "groupchat_on" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + + part { + name: "elm.bubble.status.pad"; + type: SPACER; + scale: 1; + description { + state: "default" 0.0; + rel1.relative: 1.0 0.0; + align: 1.0 0.5; + min: ENTRY_BUBBLE_STATUS_PAD 0; + fixed: 1 0; + } + } + + part { + name: "elm.bubble.lefttop_gc.pad"; + type: SPACER; + scale: 1; + description { + state: "default" 0.0; + rel1 { + to_x: "elm.bubble.callerid.pad"; + to_y: "elm.bubble.groupchat.pad"; + relative: 1.0 1.0; + } + rel2 { + to_x: "elm.bubble.callerid.pad"; + to_y: "elm.bubble.groupchat.pad"; + } + align: 0.0 0.0; + min: ENTRY_BUBBLE_READ_LEFTTOP_GC_PAD; + fixed: 1 1; + } + } + part { + name: "elm.bubble.righttop_gc.pad"; + type: SPACER; + scale: 1; + description { + state: "default" 0.0; + /* rel1 { + to_x: "elm.bubble.status.pad"; + to_y: "elm.bubble.groupchat.pad"; + relative: 0.0 1.0; + } + rel2 { + to_x: "elm.bubble.status.pad"; + to_y: "elm.bubble.groupchat.pad"; + relative: 0.0 1.0; + } + align: 1.0 0.0;*/ + rel1 { + to: "elm.bubble.lefttop_gc.pad"; + relative: 0.0 0.0; + offset: 374 0; + } + rel2 { + to: "elm.bubble.lefttop_gc.pad"; + relative: 0.0 0.0; + offset: 374 0; + } + align: 0.0 0.0; + min: ENTRY_BUBBLE_READ_RIGHTTOP_GC_PAD; + fixed: 1 1; + } + } + + part { + name: "elm.bubble.lefttop.pad"; + type: SPACER; + scale: 1; + description { + state: "default" 0.0; + rel1 { + to_x: "elm.bubble.callerid.pad"; + to_y: "elm.bubble.groupchat.pad"; + relative: 1.0 1.0; + } + rel2 { + to_x: "elm.bubble.callerid.pad"; + to_y: "elm.bubble.groupchat.pad"; + } + align: 0.0 0.0; + min: ENTRY_BUBBLE_READ_LEFTTOP_PAD; + fixed: 1 1; + } + } + part { + name: "elm.bubble.righttop.pad"; + type: SPACER; + scale: 1; + description { + state: "default" 0.0; + /* rel1 { + to_x: "elm.bubble.status.pad"; + to_y: "elm.bubble.groupchat.pad"; + relative: 0.0 1.0; + } + rel2 { + to_x: "elm.bubble.status.pad"; + to_y: "elm.bubble.groupchat.pad"; + relative: 0.0 1.0; + }*/ + rel1 { + to: "elm.bubble.lefttop.pad"; + relative: 0.0 0.0; + offset: 374 0; + } + rel2 { + to: "elm.bubble.lefttop.pad"; + relative: 0.0 0.0; + offset: 374 0; + } + + align: 0.0 0.0; + min: ENTRY_BUBBLE_READ_RIGHTTOP_PAD; + fixed: 1 1; + } + } + part { + name: "elm.image.bg.ef"; + type: IMAGE; + scale: 1; + description { + state: "default" 0.0; + rel1.to: "elm.bubble.lefttop.pad"; + rel2.to: "swallow.audio_bg"; + image { + normal: "telegram_bubble_bg_receive_ef.#.png"; + } + color: 106 126 204 255; + } + description { state: "pressed" 0.0; + inherit: "default" 0.0; + color_class: "W042"; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color_class: "W0551"; + } + } + part { + name: "elm.image.bg"; + type: IMAGE; + scale: 1; + description { + state: "default" 0.0; + rel1.to: "elm.bubble.lefttop.pad"; + rel2.to: "swallow.audio_bg"; + image { + normal: "telegram_bubble_bg_receive.#.png"; + } + color: 106 126 204 255; + } + description { state: "pressed" 0.0; + inherit: "default" 0.0; + color_class: "W042"; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color_class: "W0551"; + } + } + +part { +name: "elm.text.gc"; +type:TEXT; + mouse_events: 1; + scale: 1; + + description { + state: "default" 0.0; + min: 1 1; + align: 0.0 1.0; + rel1 { + to: "elm.bubble.lefttop_gc.pad"; + relative: 1.0 1.0; + } + rel2 { + to: "elm.bubble.righttop_gc.pad"; + relative: 0.0 1.0; + } + visible: 1; + color_class: "T058"; + text { + font: "Tizen:style=Regular"; + size: ENTRY_BUBBLE_GROUPCHAT_SIZE_INC; + align: 0.0 0.0; + text_class: "tizen"; + min: 1 1; + } +} +} + + part { + name: "elm.text"; + type: TEXTBLOCK; + mouse_events: 1; + scale: 1; + entry_mode: PLAIN; + select_mode: BLOCK_HANDLE; + cursor_mode: BEFORE; + multiline: 1; + description { + state: "default" 0.0; + align: 0.0 0.0; + min: ENTRY_BUBBLE_TEXT_MIN; + rel1 { + to: "elm.bubble.lefttop.pad"; + relative: 1.0 1.0; + } + rel2 { + to: "elm.bubble.righttop.pad"; + relative: 0.0 1.0; + } + text { + style: "entry_bubble_receive_textblock_style"; + min: 0 1; + max: 1 0; + align: 0.0 0.0; + } + } + description { state: "gc" 0.0; + inherit: "default" 0.0; + rel1 { + to: "elm.bubble.lefttop_gc.pad"; + relative: 1.0 1.0; + } + rel2 { + to: "elm.bubble.righttop_gc.pad"; + relative: 0.0 1.0; + } + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + text { + style: "entry_textblock_disabled_style"; + } + } + } + part + { + name: "media_status_icon"; + type: SWALLOW; + description + { + state: "default" 0.0; + visible: 1; + align: 0.5 0; + max: MEDIA_WIDTH MEDIA_HEIGHT-MEDIA_DETAILS_LAYOUT_HT; + rel1 + { + to: "elm.text"; + relative: 0.0 0.0; + } + rel2 + { + to: "elm.text"; + relative: 1.0 1.0; + offset:0 -(MEDIA_DETAILS_LAYOUT_HT); + } + } + description + { + state: "vcontact" 0.0; + inherit: "default" 0.0; + max: VCONTACT_WIDTH VCONTACT_HEIGHT; + rel2 + { + to: "elm.text"; + relative: 1.0 1.0; + } + } + } + part { name: "event.rect"; + type: RECT; + repeat_events: 1; + scale: 1; + description { state: "default" 0.0; + color: 0 0 0 0; + rel1.to: "elm.image.bg"; + rel2.to: "elm.image.bg"; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { + name: "elm.rect.middle.pad"; + type: SPACER; + scale: 1; + description { + state: "default" 0.0; + rel1 { + to: "elm.text"; + relative: 0.0 1.0; + } + rel2.to: "elm.text"; + align: 0.5 0.0; + min: 0 0; + } + description { + state: "show" 0.0; + inherit: "default" 0.0; + min: 0 ENTRY_BUBBLE_MIDDLE_PAD; + } + } + part { + name: "elm.swallow.end"; + type: SWALLOW; + scale: 1; + description { state: "default" 0.0; + rel1 { + to: "elm.rect.middle.pad"; + relative: 0.0 1.0; + } + rel2.to: "elm.rect.middle.pad"; + align: 0.0 0.0; + } + } + part { + name: "elm.bubble.rightbottom.pad"; + type: SPACER; + scale: 1; + description { + /* rel1 { + to: "elm.swallow.end"; + relative: 1.0 1.0; + } + rel2.to: "elm.swallow.end";*/ + rel1{ + to: "elm.text"; + relative: 1.0 1.0; + } + rel2.to: "elm.text"; + align: 0.0 0.0; + min: ENTRY_BUBBLE_READ_RIGHTBOTTOM_PAD; + fixed: 1 1; + } + } + part { + name: "elm.icon.top.pad"; + type: SPACER; + scale: 1; + description { + state: "default" 0.0; + align: 0.0 0.0; + rel1 { + to: "elm.bubble.rightbottom.pad"; + relative: 0.0 1.0; + } + rel2 { + to: "elm.bubble.rightbottom.pad"; + relative: 0.0 1.0; + } + min: 0 0; + } + description { + state: "contents_on" 0.0; + inherit: "default" 0.0; + min: 0 ENTRY_BUBBLE_ICON_TOP_PAD; + } + } + part { + name: "elm.swallow.icon1"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + rel1 { + to_x: "elm.text"; + to_y: "elm.icon.top.pad"; + relative: 0.0 1.0; + } + rel2 { + to_x: "elm.text"; + to_y: "elm.icon.top.pad"; + relative: 0.0 1.0; + } + min: 0 0; + align: 0.0 0.0; + visible: 0; + } + description { + state: "contents_on" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + + part { + name: "pad_top"; + type: SPACER; + description { + state: "default" 0.0; + min: 10 10; + max: -1 10; + rel1 { + to: "elm.text"; + relative: 0.0 1.0; + } + rel2 { + to: "elm.text"; + relative: 1.0 1.0; + } + } + } + + part { + name: "pad_bottom"; + type: SPACER; + description { + state: "default" 0.0; + min: 10 10; + max: -1 10; + rel1 { + to_x: "elm.text"; + relative: 0.0 1.0; + to_y: "elm.image.bg"; + relative: 0.0 1.0; + } + rel2 { + to_x: "elm.text"; + relative: 1.0 1.0; + to_y: "elm.image.bg"; + relative: 1.0 1.0; + } + align: 0.5 1; + } + } +/* + part { + name: "time"; + type:TEXT; + mouse_events: 1; + scale: 1; + description { + state: "default" 0.0; + min: 1 1; + align: 1.0 0.5; + rel1 { + to: "pad_top"; + relative: 1.0 1.0; + } + rel2 { + to: "pad_bottom"; + relative: 1.0 0.0; + } + visible: 1; + //color_class: "T058"; + color: ENTRY_BUBBLE_TIME_COLOR; + text { + min: 1 1; + align: 0.5 0.5; + //text_class: "T058"; + size: 10; + } + } + } +*/ + part{ + name: "time"; + type:TEXT; + mouse_events: 1; + scale: 1; + description{ + state: "default" 0.0; + rel1 { relative: 0.3 0.8; } + rel2 { relative: 0.5 0.95; } + visible: 1; + //color_class: "T058"; + color: ENTRY_BUBBLE_TIME_COLOR; + text { + min: 1 1; + align: 0.5 0.5; + //text_class: "T058"; + size: 10; + } + } + } + part { + name: "elm.icon.pad"; + type: SPACER; + scale: 1; + description { + state: "default" 0.0; + rel1 { + to: "elm.swallow.icon1"; + relative: 1.0 0.0; + } + rel2 { + to: "elm.swallow.icon1"; + relative: 1.0 1.0; + } + min: ENTRY_BUBBLE_ICON_PAD 0; + align: 0.0 0.5; + } + } + part { + name: "elm.swallow.icon2"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + rel1 { + to: "elm.icon.pad"; + relative: 1.0 0.0; + } + rel2 { + to: "elm.icon.pad"; + relative: 1.0 1.0; + } + min: 0 0; + align: 0.0 0.5; + visible: 0; + } + description { + state: "contents_on" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { + name: "elm.bottom.pad"; + type: SPACER; + scale: 1; + description { + rel1 { + to_y: "elm.swallow.icon1"; + relative: 0.0 1.0; + } + min: 0 0; + } + } + part { + name: "elm.status.pad"; + type: SPACER; + scale: 1; + description { + state: "default" 0.0; + rel1 { + to: "elm.bubble.rightbottom.pad"; + relative: 1.0 1.0; + } + rel2.to: "elm.bubble.rightbottom.pad"; + min: ENTRY_BUBBLE_STATUS_TEXT_ICON_PAD; + align: 0.0 1.0; + fixed: 1 1; + } + } + part { name: "elm.text.time"; + type: TEXT; + scale: 1; + description { state: "default" 0.0; + color_class: "T0220"; + text { + text_class: "T0220"; + min: 1 1; + align: 0.0 1.0; + } + rel1 { + to: "elm.status.pad"; + relative: 1.0 0.0; + } + rel2 { + to: "elm.status.pad"; + relative: 1.0 0.0; + } + align: 0.0 1.0; + min: ENTRY_BUBBLE_STATUS_TIME_SIZE; + fixed: 1 1; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { name: "elm.text.status"; + type: TEXT; + scale: 1; + description { state: "default" 0.0; + color_class: "T0220"; + text { + text_class: "T0220"; + min: 0 1; + align: 0.0 1.0; + } + rel1.to: "elm.text.time"; + rel2 { + to: "elm.text.time"; + relative: 1.0 0.0; + } + align: 0.0 1.0; + min: ENTRY_BUBBLE_STATUS_TIME_SIZE; + fixed: 1 1; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { + name: "elm.swallow.status"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + rel1 { + to: "elm.status.pad"; + relative: 1.0 0.0; + } + rel2 { + to: "elm.status.pad"; + relative: 1.0 0.0; + } + align: 0.0 1.0; + fixed: 1 1; + visible: 0; + } + description { state: "enabled" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + } + programs { + program { name: "focus"; + signal: "load"; + source: ""; + action: FOCUS_SET; + target: "elm.text"; + } + program { name: "disable"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "elm.text"; + target: "event.rect"; + } + program { name: "enable"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text"; + target: "event.rect"; + } + program { name: "mouse_down"; + signal: "mouse,down,*"; + source: "event.rect"; + action: STATE_SET "pressed" 0.0; + target: "elm.image.bg"; + } + program { name: "mouse_up"; + signal: "mouse,up,*"; + source: "event.rect"; + action: STATE_SET "default" 0.0; + target: "elm.image.bg"; + } + program { name: "go_callerid_on"; + signal: "elm,state,callerid,enabled"; + source: "elm"; + action: STATE_SET "callerid_on" 0.0; + target: "elm.bubble.callerid.pad"; + target: "elm.swallow.callerid"; + target: "elm.callerid.bottom.pad"; + } + program { name: "go_callerid_off"; + signal: "elm,state,callerid,disabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.bubble.callerid.pad"; + target: "elm.swallow.callerid"; + target: "elm.callerid.bottom.pad"; + } + program { name: "go_groupchat_on"; + signal: "elm,state,groupchat,enabled"; + source: "elm"; + action: STATE_SET "gc" 0.0; + target: "elm.text"; + } + program { name: "go_groupchat_off"; + signal: "elm,state,groupchat,disabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text"; + } + program { name: "go_textstatus_on"; + signal: "elm,state,text,status,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text.time"; + target: "elm.text.status"; + after: "go_contentstatus_off"; + } + program { name: "go_textstatus_off"; + signal: "elm,state,text,status,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "elm.text.time"; + target: "elm.text.status"; + } + program { name: "go_contentstatus_on"; + signal: "elm,state,content,status,enabled"; + source: "elm"; + action: STATE_SET "enabled" 0.0; + target: "elm.swallow.status"; + after: "go_textstatus_off"; + } + program { name: "go_contentstatus_off"; + signal: "elm,state,content,status,disabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.status"; + } + program { name: "show_middle_pad"; + signal: "elm,state,middle,pad,enabled"; + source: "elm"; + action: STATE_SET "show" 0.0; + target: "elm.rect.middle.pad"; + } + program { name: "hide_middle_pad"; + signal: "elm,state,middle,pad,disabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.rect.middle.pad"; + } + program { name: "go_contents_on"; + signal: "elm,state,contents,enabled"; + source: "elm"; + action: STATE_SET "contents_on" 0.0; + target: "elm.icon.top.pad"; + target: "elm.swallow.icon1"; + target: "elm.swallow.icon2"; + } + program { name: "go_contents_off"; + signal: "elm,state,contents,disabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.icon.top.pad"; + target: "elm.swallow.icon1"; + target: "elm.swallow.icon2"; + } + program { name: "media_status_vcontact"; + signal: "elm,state,set,vcontact,status"; + source: "elm"; + action: STATE_SET "vcontact" 0.0; + target: "media_status_icon"; + } + } + } + +/**************land ********************/ + + + group { name: "elm/entry/base-noedit/readmessage1"; parts { part { diff --git a/TelegramTizen/res/images/telegram_audio_player_pause_dim.png b/TelegramTizen/res/images/telegram_audio_player_pause_dim.png new file mode 100644 index 0000000000000000000000000000000000000000..e5b3c4b55d422ec6de639cacd327ec8f2e17e285 GIT binary patch literal 1861 zcmbVNX;2eq7*0jRK|v4{bWqmCq7ibEtVtm1k^=(-F+@QDB_<15G1-`GAczQR5frb| zK?Rkfjp7A(P{0EZ&|0jDcvMu-pan&ac$Tpq?MA`&hvSd#?Cy8$^E~hSy~pg@$cPXp z$FYti63Iz2Qz#?GskUe65aPY>-gPlCjKM`Qcode1rz-Ra307f?5I~|)Bq1_Hp-NlY zfCQ09c8RDw29J@3^OTr|s<2_GCXJ3@lSo0+O*(}#8Nq=?ND`{$gVvL0Kmb+o!DzOW zF4YMTH9B*d9*J5OAy+O-R&rI~^l3nliAM-%5L^M6G)uGwo{0~B)a4O#+cpgZK0@$h zKKRM07-=LR!1M^frUp=ybOr-}AS#2!h9HJNz@#&nG&*rZ6b6gOhIq`WK>r02*7T}G zo=hn2w?(Y@pc=<@JQ^)EHI*jX|Z;G#cBvKB5h{4EfiMFQN_d zG#x^dAqLE-R}%S1^cf%%vHQ9q8<6mZH%pHaNl`2jVoIY1(c%&zA0)m|Rj7&wv4p{N zCKL<{Af|}TU~q&?0fz&NL?SLj8~`&0G`_@T2m}O@6AW>PL@-2b4$NV2nM@`u=CFc= z5In$@XbreRt3(FuqJ-UkF8oz4PoPH>IHs3l*ph(?h*V=ZW>8}~KoA81lcQ0s3QIMR zZRz=RS|OrGQxKI{k7HvL@s#Nu=FAX=hh^h9e+>&zTZbevHlgyp8YEk#!ryUljL zXbopd=tsoK>nqD|&b_eemV5l#Co*`soyWA5meVIZmJjmCuyZ{z=h_A!+i^u?*_~$h zq62Krfj8SG7N6m|<**9F6Mb(Krdvids5&}6bhK`kAN!JUKARV=a0zn2X>zYNQ^R8-HrXEt6RyZ>R8 zOxtGJNiHvWc+@{AGuODK5}yC9=8aQM2PC+Z+vGW8(=kY5m9)>U-)}~*lRtFlwAnB4 zX_xq!J0@E!WnO*cGfuP@tWHm~q1>bAbcXvfGNGJQ%yqxePY3_S$uXkM0q%L~wnp0bQ*^ScU6mGew zptKKra1C5s+7cRH(VFqD8|kYZHljCfmbz)%^V<9Br+vjinX}8fC|hrlF2){vJaVtG zKpEy+nLDO?;W=N@!7h_?W4fi*KaHkXv;9>9f3$nl`fHc7w!7%(IYbO=I|b=p&yYsh zwbTfu*IQT@=M)c8RkAGk`E`5b&d1H!d0~zo(RP&?mN&AYI#)@X{49H7cJiQzt?m&H zadTufQ!JPA>k7W9_6vxU$ZAGfR)jiMBf}>jO{*^@rSmx(vtyEqa zo>TwYNn%;2&QIhtdsOe~o%_^jNmF5kBDvyrZR_plUd4T+^7>tP`>r_Gw)@*!Csx#U z3a`dbU*RI~+UG!t9Nlxsp=pHkuIAgD>)IQV5kF4zW0$Mx`>dCW?c=@sz;V0BZ`tGY zG;Bfg-IZ=$;k4|Mzu99BB|XE8qjM_F?OF8{x0oXjHm!zo9N!J1<|g!n)+?<;vNxop zoIbr&x6|!hGx^5x-`pKq)qT01_O+vX&NsfV99JIFboEO8j!dO<+J%=T4`Ap6tudjh zTD05w?q4C=uE*z}yr7(PsG1egv7j_#Xy$jGy@%DMj*0y7y7?`yTn4`_Cf}QPDeup= z6W>2t?Gq|&M9?{~kl*1;(!3f_-O YAo;#+43~q{3AP`bL=+(`4^CM14;+%_-T(jq literal 0 HcmV?d00001 diff --git a/TelegramTizen/res/images/telegram_audio_player_pause_normal.png b/TelegramTizen/res/images/telegram_audio_player_pause_normal.png new file mode 100644 index 0000000000000000000000000000000000000000..37304c14abcb5f114ba8d14c4d34863bd79cdbcc GIT binary patch literal 1895 zcmbVNX;2eq7*0_^w4U`UV|5Kh1SHAkSjg6(IW{(86d^)@Q3#tgtdeZpEF>I?Ab5gB zMX;h!6fGWr6~SiE3be`)5E%rkmZ@6AY8!cm|%;D`Gyy!*N$U06L=#+ ztrIcd8l_eS0aAj*00E2Vi*i5^fFKsg7eEj=AK-F8E}KIS$QR_p0tn{%0YeXy)<$aA zz`-*4kS=;BV#ZRG5oWW^W;4soV-ci|4GM)q2M3qyOH25g5)G8b;%hLu4>QOx6H4Mn z3MUMJgHaPh#8VURo23Z`oUhnYhjkJjh#{MUVO@dvT6l*BX?L8=HMZny%1VhM^c#S%t98Ug|H!f=C@Fq^y_ z>3Qp|3?uObOe-e|J@6*JF#aC>Tsb6^OCW^9f&3kQi}`#+$dy2RAy>>3NM+0+toHxJ zj7=NEb`-~die>nSu0Y4~UFp-Ccg=$t=#C-j)>v#wq5E`1zCtEeS#EV6XbM!VnAy;? zwCln1d7EQD_c@x`uBtwLHg%DA88T8{FvrPf^kJj`I1N?dcfIGCE4LpGojdg=+B>bBN(Z8&&U^m}20s3GL~dPSx1#G+4P8R9g2 zYJED#C15k&>wKP(`s6}*+&7+Gf2TmM9qCZ36EtFZ9vZJGto(={_#%qqDzBaR+#m=E z?RFEp+;BZVt>Ti)8HNAH@;YhnE!+yXj;daF$#uu$$%ScO1aH{s9p(&+YqD3uVHveZ z@5uhm7Vw@r!c%xHPjPZa zYv-gCmzp^bc<$z)%bA8T;|Iof?-{$q<H*$$4I(X-B@k=T=ggV9E$e z%6_;d%H`B*>zVV-FIgljE9zq5)8v5ai3<{Z_axcvWqo)5*p!+W&6%Fv;8uTO(jY6m z*;(iHbGFAhx%^Jv;bUz*yd7Yc)6KTTSy#^$_a9i1R3*1oPo9~ne%KkAP5K^)_%1U4 zB&E5SS9x37aq5Y!VdhscWIz7ITfMevRY92C!&@GNSz%jQsH*&Oq@-wqeHWv9aEEPR z-t-U^OKcs5bl>-S7P7(`m0Pea~rT3-_f5RP;L|Rc!@XLYO9-1)Z6vuz1EUwa(+)?Oq&7wQ&eI~+moY`2t;xRU40rlu|} zJAEVf9@^PlH=q(cO$#fTO(o@Ac{$GZN=Yc2%^rKNJX&@9&&9Qn=N8qS)pJZOl6*YT zeb?RUO|K$IpNd0G(Q&Q~+KKk(%fdw#lvQ5Qu_v%9x%RRX;?=+6e$2tRja4r)?6*wy z1J~S(BVMMO;cK?c(%M50qDppK#ul39YIPf4d)6|hv|cN|9-DX5arG&XWwLTfboxK& CRsgsF literal 0 HcmV?d00001 diff --git a/TelegramTizen/res/images/telegram_audio_player_pause_press.png b/TelegramTizen/res/images/telegram_audio_player_pause_press.png new file mode 100644 index 0000000000000000000000000000000000000000..d77f0d292981927433e1ae3eff4095273fe46fee GIT binary patch literal 1912 zcmbVNYfuyC8V;zS6{@s@g9Pc1boDuA7@ujUq`&Xu%<5mym|+#?3-P4#T7> zJ!%Pvr&QEJQ5b|)DvC-|tBh?G1#QPzg;GZ8X;Q5Uh*mvnIdr37`@`|a+4*+A%f8R^ z-sjtrzIu7+OAB6NFc_g}D`Xk;EbzZGgXnL|PaXw5&8OsAN=4*THXVsE5R}Nnm}zF6 z0n5O2XvzAsSR#WlE#IitQd;FIv7Ruqb$%JP-E5)J3`Sy#-J;W*Fp8On8H{)mFnX*D zU>eaRK*LvZl@=*hU|iuKF_mMrTJJFFMJSMx%uKY4X#z7w>6mtNA#N4hlYl3@VtVaA z<^aqmB9ti!cxseZna-3FB*x^k<5_wx2r^-q4f6Of48}1bE(meB^nh6)Pt1qKkbpV) z0JJs|%@=3L6qCB>T@p}0Q5G?WW3$=Vws0Bz}07t9u=@)DawkkzbIuM!beJ(n--3$_Rat8N;bGSrS11VWUP= z4D)0XE(A*uDGbT^ASjeUQlSu$%jF_a5s!dV9M8joh%g?K@FlR2P6R0Dix31v5Lf^z zM4$kch^DYwm(sm6$- zgv}c3PtQ|tWf*BJ#!v-Gn3+%FD>gnyKcs*~3JEOda$%w0Z-mE_iy#Ti6G2EkUn&D8 zvFQI3GY)MG$6p+OE0(Dvx&r;nXQfYXo;44K(;Y+7tx+euwwLa>mNXfnwhs*MdS|72 zZN&RK8Y}af)f*@$AaQMLSKo+o?3_cTT~ul^_Bt+QHbRC!q5{hzURyi+LFD7nD}CJ$TK88R-qQ826P2IJ-(vM7 z!1&PxzxTg;ZZLa(`R=W1n=eK5CM)A8++9B1WPnLASHBeNl|2P9*6w6$g*UD-S=R>b%` zyc(+tm#IV?U$SYLK;}l2zM$B?eXZGxe2@4wH}_>%HIs8(ZRu#*H19UHeNaOrfXyzYo|aJyqsh@Jo5B+c4B3_3f%YawV6n z2)aM=@~irkoJIEakbAVJvqj{c3)V0BEcLSDn`(Wc=7cr7cw+ouS;9Zy--c59^9ltm zN5{VS_q|Ww@2_daXCCpKtL|O5uyS2Ll-bJc=6zkQza9Ce+x1bjJ<~c{7ya}9A z&AST3MhssLPf%9=oVoD>=zP0lfXu4zN**|S_($dSV|RX8*HHS-_u;wjts`GW?7si{ zPz5*l{=!2y7=mkSmT!t{&wN;Ha&JTv>+0EUbraO1mBz)dITwCBD{JTft_FrMaxV1j Ujhy|B)qfYJ$yduhm*j5v6B*n5#{d8T literal 0 HcmV?d00001 diff --git a/TelegramTizen/res/images/telegram_audio_player_play_dim.png b/TelegramTizen/res/images/telegram_audio_player_play_dim.png new file mode 100644 index 0000000000000000000000000000000000000000..85533f31b37c1f07267a4720883dfdedff4dfac6 GIT binary patch literal 2215 zcmbVOdpMN&9v?;78M+{q*rw6hEaqzFH8Yu*YY5qi4AC~1ml@2wV`i8MrAUt0mh92R z<%qDIqMNm%+vp;;i?)L;C)X7%B1b6Uyi@6%KYI3$^FHtU{x0w5^Z8zX&-14H`)xKy z+8_}Kgt?a|hYydghR1Xf{Qj~1R~|g9)^G)yZBV#ID^!69rUVj!XfL@i0_1~2$?lj& z&<%lD7%mGCXav4KbTK5y2@M#WPOgO62!xxvPAL>eff}?3jF2f9n31~c7_>~nzywiz z3BF1;D3y7}tH5pXegWe6C^1cfao>b?)6ro8Ij9k$b@FJ1nyzDD-s{rgxnUcRLBEG+ zq8OMDP6>Sd(QHTsqA55Rte8L~q5%L$BvSx@=!_;2h$K7#z5y(eOs4>Jk}LY-g@LW9 zB;j;EhxgGIykcOa8jX^U$7{7(oYn;gsUq-18jWVqAd#>z0;}Gw&r?dQpG?*8160SJ3T->QIQc`i)iyvFCaL>CU3N@TJCDqIL6m%^gas7zNX zo5p3a0V0z$&-GHMHA00LoVP23?SAAk|CCE-t3aU!QUyRz^n3^SOCb%UmO@H2dmDgu z2$CrzkXHS*p*$a=<$x+#94O(bAUXPde(AE$*eCG-8jl5V2?T&@h?_|!b7>?NK&FwH zE)+Hg^N}n0e{zP0oxvNL@sdf3M5eVZpFAg(6 z_w=79!hG@qS2b+?_HFLUkXpVDOQ<&EJ;?%Z$F>N#J)skNg-@>TWMefd_GJ?a^2uc8 zJd<7I;9F{Lp)7r`>;PPjIv1yZVI-`-akyubgBj8ZJ3OG>QyA0a$eOMmnap{YQ`W40 zFyhwVOY3)AR6S>jxp3SgF3VhEbo_;u_YZO)a(q=4GQ?B`|UtwFB{BTRnMehryqJ+3ZcDaHZYEHsIKN`ny`ybP!?eRY4 zoBDo9J!4|GUCFiT)!#%&t&t7>gxrCf%E-$`S<4r+d6gJ5R#$7k{hEq;R`gmr+{M^J ztWntAyCnMe$c;E9P#Zk>L^oO}ccPYCmDWAYbDpTRp|~dYhf^!NLIW?*qQfU{y6&9V zNl&^mIrL3X)C#fx!Uskjy~yr3Z{?Tv&uuKnR#97}e@s&Au3u@M>xp8><5IiL-ZVQe zZNqHFnzz~v)@^uJm=W>4Z8TKbZ)N0+c%UFIsY4#Dz!DefQ112x&SaarNu6}6 z6dko|EP?}Ux-CKk0X?TRV{h+fj!fqznUI3L;wFvjyN4?xk5)Vh#Z8ybbc+&-DAQGwg>F^Q~R=-fV8G#rH{X_o&AHXdXY3*>Yg{%WS^? zX&+#weTp&nb6dm9zwlq=-)l)7LwO4xh?nwx7^aJ^)zW)V&gZ^bG0>nKYw~bgTVVWq z@(w|IMWR+bG?4`<0`=MMn~^O1fx#nVp(`^s^dj@ytJgSON>xtP9EO^GMcxHrht`+% zvzMlH3x)=x?B_UbMn+hbgrr zm{q6gqk`8d4=j3olYT5I7+DQ=g$+%te0+pQS>lS^)m}MTic4EiwJ?;kf5!_F1K=Gx zB{SWhpc*RH|CA@~EpzrQ_i1DV50n^NlRaB4-CL>xpDtnQc{Dt(CheW~q&~miU(ji0 zVwrzJdUn^@P8^jxirm*-4+J-M?08{Ye`prblJh!%nRW~1cX$cIEP2JlAD&U0QV!mI zY#WjI$V#1KeX?Z1PhVB1oeG&5eMk09Jw7m1beXpC>LIuLeh;(eBFcNg>{CI@=8yyg XZz?c*3Sm-b_;v8&`f(~*yORF{q=l3m literal 0 HcmV?d00001 diff --git a/TelegramTizen/res/images/telegram_audio_player_play_normal.png b/TelegramTizen/res/images/telegram_audio_player_play_normal.png new file mode 100644 index 0000000000000000000000000000000000000000..7f42d8ef11425147272c7b275becf6c07ed502a8 GIT binary patch literal 2268 zcmbVOdpJ~iA0Jxdnzk^OebqElBj$cFGnq11rWh7QQQI+dn2DJ)W=1pQmh|S5bg^9| ziI+;dvdX2DOQ}}%#3Pm1kSdQpcX*u6){Q;OV7r9;$^|I;h2Cye^Sv# zvoW8Y3iS&>^B^^drr{|#36VrX)9H8;l}4wN+|gtriA*5EHyuZ!vS@S`*#rIM!ob$l z(nwYyU--oqyklczTCIvjAn0^DypDp0)KLTylgTu2kjXe$1E+~sY5_e?sd1iW;DZ{8 zTCUQ{Atlk2@q5v^`ND`+2m0A&>je)=5rE)2Y zPUUlnWIC6_qmuk~GGNFBO;?$8}Zj@OCZLTc7uHG=6^aeea@)1&_QpjZA$Q zK0jD68IX=j_F~ldpq<){GHnyfjxey4rUgW6s~KCGw3WXwd!B|&9nNy*JWD;~HMhvb zHo4)MU1p;QsU8{=thXI9vP#WSlyqgSFtOMi`?U*%(3<=fBhw`jMxJ~rQa(=)TmU1m_%jgVCLes^N?LvP)?x7hmBlFo~wX6kA7lCCV?n-470!kxLm8bMF(!dM3{Fm=C68Bo9Y zmS7QOi=F+fPP3uecgOn=qKTW2Gwfbv-RIB!x2DqZyYl@RJ^o`{rbAicrOhoa9SEGa zTWar$my0UGkz+A5OC#%F7mB^NR2SfE5(sfFv6FS!BwY<2Pr?V{ikmJx8iAGbYWHNjFQ5mO7_+mmIcvtmcTcq)%#U7S zeQxJ3?p#&heK&lr{l|0j=^wHsCx@YrqXEgQHgNM&jcemC2}Ygn6!sL~8;=fJIdQi( zdn^KTA$|1nnji9aEkAqU;^d!ZGk+?#ejGJ;Pf>w8>6R2}({^*VrGJRUp&UU;Flf8>KU#X=KhI^J;mC-KUGCDK3W7EapzO_`49{~&UVkw1 zCfyzxye%(b-g_-$D#-xc!82Zv&N@oRp+$&Plq`J@*L1 zax^`(INVaHI{~zh4-Yz>e{kCsfAo*^kOJ)OsG9Aa)u(m3S=+ny*xs}OVLIwnuA;kF zHN3BautfP{^_wJH55A{q%DF{t6wR18DeC7D^C_B5;>NKjs?D3$ZA*g!u9Zape6HKW zQ~&G4?iampFRnI1UO9H^x8C8kVXsDAhI2_LObRaLTs!|*WaORP7HE4k<%i6{V|!1v z+S<}x@>@T=u2VDe zLE^{o;I6FJ#>OHxVn`m4R}9pTqpzQSx|Ek{Y&C8YJV(CvPG}LKw_j(omBYDLS8h_C zN!@t$amHX)o@=}Pf!9dX_-x|Bs!CF~wap%aDW#K$q<1ieP@%TB?}(m7CDKS;4;E-^ z`#OGKXAy(Klo~gLUE9&TrtNBFagdi|Znyv{0*ZJi3ikf+^v9huGv6}L^StYK&V0uYUTtM= zZ;nEttO5f#0%W8aAJaL=yZCN94;hxg+-NuqN`O;@N)Y8IhT=hVpiHfXo;AGiJ}G( zf)s2pQ4*k0f?=BAaFIqTVu&$5tI*zRCL$mMVIf*AOOmUYY8K|BE)$s>xA7SCM+hus zVLmw(9mGeoAti{W;>cJLfk;FH0FFqZ0szqqO(GCUcmi?*SR#c<1(+lndg{U;)|BD| zrhvnnvW2Wzm_!&>F!A`5loVVF83!phBv{6wQ4<*Aa4C3jh5M+v=pwGf`)l{O8l;PDv1)hi_;AJvnTp!UYSOEU*#uw45 z@a+l^F920gvQmW9Bf({wjO6a04H_EMmr5kkIV3in?#JbF8AKl0k2tOIB`$$OpimiXGC)TPLF7{DBp%I=O{7u) zhCdmg(Wbe9auqC;i@<5S62$Hlm-LTZCR+&#VMrMcK}pjcz)yr=NRgMauz|l5L=vr-WqakNIUvzF?ok0~kDifJ-0%bYt9p6bhF?@&_mkk{_AM z=3u6{;{PXSc*GgJu{r*yS*Ev;4m3_bw?4A?e0V@Pa$=Oo(IEJownCw1cLs9&!qr{3 zj_+7^6m)1xt*jf~zkifSmeps{N%b2>zUtWG;2!iO--hjZ-lr7Ua7Nl@V{mA57TP-X^X5hdqMcaGh0^`3Ean{r5vN)J{7+y1z{h*S;C6=Iq_`BJEM_ zjk-U}7xi_8gWWkMH~6W8>GSHPeJjUGyS43bw~uZ2?EG}k-auy8ty}ZL&UA_NhwjYK znho;rN!$!gy=529Z( zo8o4Kodf>Omdcs0mzXqp>9`=>J#mjF|Iyivi)AZTWK{22*bwuwxG#NhBpJetF0X7% zi*p{n)~P=A&BH7^oMU$)yZ>>}?Ax=3CZqe*^-T3?9s73^>5MzHMLGfXrXt6!4s7df ztowI=u&s;c*blvtb-Om2YiFn4S!fW`Lkw7_v$QK;>#SYYJJB?{pWN=+Ph{)+c*QX~ zoYj*5gv{MJ^vgumTU(EpU{-Ei%Y4SHwxvtvMkO}Ci;dxN+a)hzv$BFV^eF5AttcYjX`95y}F2KXacip#E)n`e z0e0-7P1p=+y3?-~Ki`imDlMCgSlQVT@bt=49&nGN6KzWyp9i$`-Yen?`hsI-c4cO+N7&YeWn}KU`Ri=XMeKM` z=X1OCvBQXC$GOzZMNvJ+Orla=AFLd2ZuLEImH$^on5mE`+_yN|ne{#@&x^ZdQ+2i9 z!RBX|Qf$WZ6gri)mj$b!sN-_tw2u6&w6va%{H>)%pA{pZ0`OC!F9F z#r?ow#O!hzYvX)b(J``iTv1eC^W&0DhfSL(@o5F>xnN<}zZB`}NV3!9%C3EvI!zaA zBE6O-&5`m4FR^m7?tAP}Se__ttlhAPJ$yOt+NmOFspy(V_rTnn&oLuU$FVc-o;$6+ z-ru8^Ka)Kc-mj#PnPRIHZt82`Ti~3Uk?B!Ylp0*+7m{3+ootz+WN)WnQ(*-(AUCxn zQK2F?C$HG5!d3}vt`(3C64qBz04piUwpD^SD#ABF!8yMuRl!uxSU1_g&``n5OwZ87 z)XdCKN5ROz&`93^h|F{iO{`4Ktc=VRpg;*|TTx1yRgjAt)Gi>;Rw<*Tq`*pFzr4I$ zuiRKKzbIYb(9+TpWQLKEE>MMTab;dfVufyAu`kBtHuNWFoz#!AFNG#Ad)HBe}%?0@jth%@)C>7xhtg4GcDhpEegHnt0 zON)|$@sXws(+mtd{1$-}0$pR}Uz7=ql*AmD{N&Qy)VvZ;7h5Huj9yA+ij}jug|UID zvyrQjsk5u8p`nGTi@BSji?M}?qlu%VfhEigYlw-5d=KT}>^_jEpS} zot+)cjLZ$(T+Lv5J@bl767!N%VfJPM?S<;Kz^m8FxhOTUB)=#mKR*YS0s=DfOY(~| z@(UE4gUu8)!ZY(y^2>`gLD2*8txIZAW?5>ATTyfE>&<%@^s84X}^;~0W`&{*pd_`N^ z6V>PLUJoy@Bua#x_%gGZ!GVF1WdZ|-LIZ;kkR{;21Y|LJFaTK$oIn`-kmTrgU@R&Ft&0J^jSF z$G;|T)mNrxZpB%h$#;$H8nd(P|IGYlpBA^|%6n&CdfVdD6%<9vv`-@#~KE= zSY3vTEc5ga2tIP=I&_lddR*EA-Cq&i`Uh-|xScb7JLR+Wz7I9bZfpNBUX+=~dO$Eq zpY?gkn>nj__ORanE-z6TymD3C>f4=<(_d|>nqYA+@cUK%`{r^IRadiJ_j)?6i8#7> zoAl>p?^f)M|L|?igUCDQx&+FN1@e>kDE@AoY}?tqFI5q|9Nrw1CQyT;?UF8&t;ucLK6Tjwd9xp literal 0 HcmV?d00001 diff --git a/TelegramTizen/res/images/telegram_icon_expand_open.png b/TelegramTizen/res/images/telegram_icon_expand_open.png new file mode 100644 index 0000000000000000000000000000000000000000..f3727a09dd121d930cb6e1b65662899e3644b9f7 GIT binary patch literal 1380 zcmeAS@N?(olHy`uVBq!ia0vp^0U*r51|<6gKdl8)k|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*9U+nA0*tB1$5BeXNr6bM+EIYV;~{3xK*A7;Nk-3KEmEQ%e+* zQqwc@Y?a>c-mj#PnPRIHZt82`Ti~3Uk?B!Ylp0*+7m{3+ootz+WN)WnQ(*-(AUCxn zQK2F?C$HG5!d3}vt`(3C64qBz04piUwpD^SD#ABF!8yMuRl!uxSU1_g&``n5OwZ87 z)XdCKN5ROz&`93^h|F{iO{`4Ktc=VRpg;*|TTx1yRgjAt)Gi>;Rw<*Tq`*pFzr4I$ zuiRKKzbIYb(9+TpWQLKEE>MMTab;dfVufyAu`kBtHuNWFoz#!AFNG#Ad)HBe}%?0@jth%@)C>7xhtg4GcDhpEegHnt0 zON)|$@sXws(+mtd{1$-}0$pR}Uz7=ql*AmD{N&Qy)VvZ;7h5Huj9yA+ij}jug|UID zvyrQjsk5u8p`nGTi@BSji?M}?qlu%VfhEigY`gLD2*8txIZAW?5>ATTyrkx?PiucQD-Ps?PY!8K~$c*gSRLJY$o}xqnp7UEK3`>0i5( z=9&JpCx5%FmwQX6#o*AYd=VxFMiv1FHiZTTrV|W67K0>^#i76qWHF|ISPeWt7Rv-i zi3wrhi2;(@|kz6{P>M`PnhSPJX7Y4lcfw*?@epG zzNSN5*-oNk^~!nS(>|PUd!MDW>t2xdtFQB)uU+YFDlfY`yu10E=M&3acisrb?GxX+ z=2mO6=d@3 #include -static void -popup_block_clicked_cb(void *data, Evas_Object *obj, void *event_info) + +static void popup_block_clicked_cb(void *data, Evas_Object *obj, void *event_info) { evas_object_del(obj); } -static void -popup_timeout_cb(void *data, Evas_Object *obj, void *event_info) +static void popup_timeout_cb(void *data, Evas_Object *obj, void *event_info) { evas_object_del(obj); } @@ -387,11 +386,18 @@ void load_main_list_data(appdata_s *ad) } else if(media_type == tgl_message_media_photo) { item->last_message = strdup("Image"); } else if(media_type == tgl_message_media_document) { - if (msg->message && strlen(msg->message) > 0) { + tgl_media_s *media_msg = NULL; + media_msg = get_media_details_from_db(atoll(msg->media_id)); + +/* if (msg->message && strlen(msg->message) > 0) { item->last_message = strdup(msg->message); } else { item->last_message = strdup("Document"); - } + }*/ + + item->last_message = strdup(media_msg->doc_type); + + free_media_details(media_msg); } else if(media_type == tgl_message_media_geo) { item->last_message = strdup("Geo location"); } else if(media_type == tgl_message_media_contact) { @@ -2002,7 +2008,10 @@ static int _on_service_client_msg_received_cb(void *data, bundle *const rec_msg) } if (app->current_app_state == TG_SETTINGS_SCREEN_STATE) { - + Evas_Object* set_pro_pic = evas_object_data_get(app->nf, "settings_user_profile_pic"); + if (set_pro_pic) { + elm_image_file_set(profile_pic, file_path, NULL); + } } } } else if (strcmp(rec_key_val, "self_username_updated") == 0) { @@ -2983,7 +2992,7 @@ static bool app_create(void *data) ad->s_notififcation = NULL; ad->panel = NULL; ad->is_server_ready = EINA_FALSE; - ad->msg_count = 0; + //ad->msg_count = 0; create_base_gui(ad); int err = badge_new(TELEGRAM_APP_ID); if (BADGE_ERROR_NONE != err) { diff --git a/TelegramTizen/src/tg_audio_player.c b/TelegramTizen/src/tg_audio_player.c new file mode 100644 index 0000000..158e4d4 --- /dev/null +++ b/TelegramTizen/src/tg_audio_player.c @@ -0,0 +1,185 @@ +/* + * tg_audio_player.c + * + * Created on: Oct 22, 2015 + * Author: sandeep + */ + + +#include "tg_audio_player.h" + +static void _player_interrupted_cb(player_interrupted_code_e code, void *data) +{ + tg_player_handler *player = data; + + if (!player) + return; + + player_state_e state; + player_get_state(player->handler, &state); + player->state = TG_AUDIO_PLAYER_STATE_INTERRUPTED; + player->state_callback(player, player->state, player->user_data); + return; +} + +static void _player_completed_cb(void *data) +{ + tg_player_handler *player = data; + + if (!player) + return; + + player->state = TG_AUDIO_PLAYER_STATE_END; + player->state_callback(player, player->state, player->user_data); + return; +} + +static void _player_error_cb(int error_code, void *user_data) +{ + tg_player_handler *player = user_data; + + if (!player) + return; + + player->state = TG_AUDIO_PLAYER_STATE_ERROR; + player->state_callback(player, player->state, player->user_data); + return; +} + +tg_player_handler* init_audio_player(const char *audio_file, tg_player_state_changed state_change, tg_player_progress_updated progress_update, void *user_data) +{ + if (!audio_file) + return NULL; + tg_player_handler *player = NULL; + if (access(audio_file, F_OK) != -1) { + tg_player_handler *player = (tg_player_handler*)malloc(sizeof(tg_player_handler)); + if (player) { + player->timer = NULL; + player->current_pos = 0; + player->state = TG_AUDIO_PLAYER_STATE_NONE; + player->progress_callback = progress_update; + player->state_callback = state_change; + player->user_data = user_data; + + int error_code = 0; + error_code = player_create(&player->handler); + if (error_code == PLAYER_ERROR_NONE) { + player_set_sound_type(player->handler, SOUND_TYPE_MEDIA); + player_set_volume(player->handler, 1.0, 1.0); + player_set_looping(player->handler, false); + } + error_code = player_set_interrupted_cb(player->handler, _player_interrupted_cb, player); + if (error_code != PLAYER_ERROR_NONE) { + free(player); + return NULL; + } + error_code = player_set_completed_cb(player->handler, _player_completed_cb, player); + if (error_code != PLAYER_ERROR_NONE) { + free(player); + return NULL; + } + error_code = player_set_error_cb(player->handler, _player_error_cb, NULL); + if (error_code != PLAYER_ERROR_NONE) { + free(player); + return NULL; + } + error_code = player_set_uri(player->handler, audio_file); + if (error_code != PLAYER_ERROR_NONE) { + free(player); + return NULL; + } + error_code = player_prepare(player->handler); + if (error_code == PLAYER_ERROR_NONE) { + usleep(1000); + player->state = TG_AUDIO_PLAYER_STATE_INITIALIZED; + player->state_callback(player, player->state, user_data); + } else { + //failed to create player, free all items. + free(player); + return NULL; + } + + } + } + return player; +} + + +static Eina_Bool audio_progress_updated(void *data) +{ + tg_player_handler *player = data; + + if (!player) { + return ECORE_CALLBACK_CANCEL; + } + + int total_duration = 0; + player_get_duration(player->handler, &total_duration); + + int cur_pos = 0; + player_get_play_position(player->handler, &cur_pos); + + player->progress_callback(player, cur_pos, total_duration, player->user_data); + + return ECORE_CALLBACK_RENEW; +} +void play_audio_player(tg_player_handler *player) +{ + if (!player) + return; + int error_code = 0; + if (player->state == TG_AUDIO_PLAYER_STATE_INITIALIZED || player->state == TG_AUDIO_PLAYER_STATE_INTERRUPTED || player->state == TG_AUDIO_PLAYER_STATE_PAUSE) { + error_code = player_start(player->handler); + if (error_code == PLAYER_ERROR_NONE) { + player->state = TG_AUDIO_PLAYER_STATE_PLAYING; + + if (player->timer) { + ecore_timer_del(player->timer); + player->timer = NULL; + } + player->timer = ecore_timer_add(0.001, audio_progress_updated, player); + player->state_callback(player, player->state, player->user_data); + } + } +} + +void pause_audio_player(tg_player_handler *player) +{ + if (!player) + return; + int error_code = 0; + if (player->state == TG_AUDIO_PLAYER_STATE_PLAYING) { + error_code = player_pause(player->handler); + if (error_code == PLAYER_ERROR_NONE) { + player->state = TG_AUDIO_PLAYER_STATE_PAUSE; + if (player->timer) { + ecore_timer_del(player->timer); + player->timer = NULL; + } + player->state_callback(player, player->state, player->user_data); + } + } +} + +void destroy_audio_player(tg_player_handler *player) +{ + if (!player) + return; + int error_code = 0; + + error_code = player_stop(player->handler); + if (error_code == PLAYER_ERROR_NONE) { + + } + + error_code = player_unprepare(player->handler); + if (error_code == PLAYER_ERROR_NONE) { + if (player->timer) { + ecore_timer_del(player->timer); + player->timer = NULL; + } + } + player_destroy(player->handler); + player->state = TG_AUDIO_PLAYER_STATE_NONE; +} + diff --git a/TelegramTizen/src/tg_messaging_view.c b/TelegramTizen/src/tg_messaging_view.c index 5dcb587..3d1add4 100644 --- a/TelegramTizen/src/tg_messaging_view.c +++ b/TelegramTizen/src/tg_messaging_view.c @@ -13,7 +13,8 @@ #include #include "tg_user_info_view.h" #include "tg_chat_info_view.h" - +#include "tg_audio_player.h" +#include /************************ Menu Handler ********************/ void on_messaging_menu_option_selected_cb(void *data, Evas_Object *obj, void *event_info) @@ -495,8 +496,6 @@ int get_image_size(long long media_id) return media_size; } - - void on_media_chat_item_clicked(void* data, Evas_Object *entry, void* event_info) { Evas_Object *button = evas_object_data_get(entry, "button_object"); @@ -517,7 +516,6 @@ void on_media_chat_item_clicked(void* data, Evas_Object *entry, void* event_info return; } - long long media_id = atoll(temp_media_id); char *media_file = get_media_path_from_db(media_id); @@ -623,6 +621,348 @@ static Evas_Object *get_media_layout_with_play(char *img_path, Evas_Object *pare return rec_video_layout; } + +void audio_player_progress_updated(void* handler, int current, int total, void *user_data) +{ + Evas_Object *parent = user_data; + Evas_Object *progressbar = evas_object_data_get(parent, "progress_control"); + + + int seconds = (int) (current / 1000) % 60 ; + int minutes = (int) ((current / (1000*60)) % 60); + + char tot_dur[256] = {0,}; + char *format = NULL; + if (seconds < 10 && minutes < 10) { + format = "0%d:0%d"; + } else if (seconds > 10 && minutes < 10) { + format = "%d:0%d"; + } else if (seconds < 10 && minutes > 10) { + format = "0%d:%d"; + } else { + format = "0%d:0%d"; + } + + sprintf(tot_dur, format, minutes, seconds); + elm_object_part_text_set(progressbar, "elm.text.bottom.left", tot_dur); + + double current_status = (double)((double)current/(double)total); + + elm_progressbar_value_set(progressbar, current_status); + +} + +void audio_player_state_changed(void* handler, TG_AUDIO_PLAYER_STATE state, void *user_data) +{ + tg_player_handler *audio_payer = handler; + Evas_Object *parent = user_data; + + if (!audio_payer || !parent) { + return; + } + + Eina_Bool is_play_mode = (Eina_Bool)evas_object_data_get(parent, "is_play_mode"); + switch(audio_payer->state) { + case TG_AUDIO_PLAYER_STATE_NONE: + break; + case TG_AUDIO_PLAYER_STATE_INITIALIZED: + evas_object_data_set(parent, "tg_audio_player", audio_payer); + play_audio_player(audio_payer); + break; + case TG_AUDIO_PLAYER_STATE_PLAYING: + elm_image_file_set(parent, ui_utils_get_resource(TG_PAUSE_NORMAL_ICON), NULL); + is_play_mode = !is_play_mode; + evas_object_data_set(parent, "is_play_mode", is_play_mode); + break; + case TG_AUDIO_PLAYER_STATE_INTERRUPTED: + elm_image_file_set(parent, ui_utils_get_resource(TG_PLAY_NORMAL_ICON), NULL); + is_play_mode = !is_play_mode; + evas_object_data_set(parent, "is_play_mode", is_play_mode); + break; + case TG_AUDIO_PLAYER_STATE_PAUSE: + elm_image_file_set(parent, ui_utils_get_resource(TG_PLAY_NORMAL_ICON), NULL); + is_play_mode = !is_play_mode; + evas_object_data_set(parent, "is_play_mode", is_play_mode); + break; + case TG_AUDIO_PLAYER_STATE_ERROR: + break; + case TG_AUDIO_PLAYER_STATE_END: + destroy_audio_player(audio_payer); + free(audio_payer); + + is_play_mode = EINA_FALSE; + evas_object_data_set(parent, "is_play_mode", is_play_mode); + evas_object_data_set(parent, "tg_audio_player", NULL); + elm_image_file_set(parent, ui_utils_get_resource(TG_PLAY_NORMAL_ICON), NULL); + audio_player_progress_updated(NULL, 0, 1, parent); + break; + default: + break; + } + +} + +static void on_message_play_pause_clicked(void *data, Evas_Object *obj, void *event_info) +{ + if (!data) + return; + + appdata_s * ad = evas_object_data_get(data, "app_data"); + char *audio_file = evas_object_data_get(data, "audio_file_path"); + char *media_id = evas_object_data_get(data, "media_id"); + if (!audio_file || strlen(audio_file) <= 0 || strstr(audio_file, "_null_") != NULL) { + //there is no file. download it. + Evas_Object *progressbar = evas_object_data_get(data, "progress_control"); + Eina_Bool is_download_in_progress = (Eina_Bool)evas_object_data_get(progressbar, "is_download_in_progress"); + + if (is_download_in_progress) { + + } else { + elm_object_style_set(progressbar, "pending"); + Eina_Bool ret = send_request_for_media_downloading(ad->service_client, ad->peer_in_cahtting_data->use_data->peer_id, atoll(media_id)); + if (!ret) { + show_toast(ad, "Please check your network connection."); + return; + } + } + return; + } + + tg_player_handler *audio_payer = evas_object_data_get(data, "tg_audio_player"); + + if (!audio_payer) { + audio_payer = init_audio_player(audio_file, &audio_player_state_changed, &audio_player_progress_updated, data); + + if (!audio_payer) { + show_toast(ad, "Unsupported file."); + } + return; + } + + if (audio_payer->state == TG_AUDIO_PLAYER_STATE_PAUSE || audio_payer->state == TG_AUDIO_PLAYER_STATE_INTERRUPTED) { + + play_audio_player(audio_payer); + + } else if (audio_payer->state == TG_AUDIO_PLAYER_STATE_PLAYING) { + + pause_audio_player(audio_payer); + + } +} + +static void on_message_play_pause_pressed(void *data, Evas_Object *obj, void *event_info) +{ + if (!data) + return; + + Eina_Bool is_play_mode = (Eina_Bool)evas_object_data_get(data, "is_play_mode"); + if (is_play_mode) { + elm_image_file_set(data, ui_utils_get_resource(TG_PAUSE_PRESS_ICON), NULL); + } else { + elm_image_file_set(data, ui_utils_get_resource(TG_PLAY_PRESS_ICON), NULL); + } +} + +static void on_message_play_pause_unpressed(void *data, Evas_Object *obj, void *event_info) +{ + if (!data) + return; + + Eina_Bool is_play_mode = (Eina_Bool)evas_object_data_get(data, "is_play_mode"); + if (is_play_mode) { + + elm_image_file_set(data, ui_utils_get_resource(TG_PAUSE_NORMAL_ICON), NULL); + } else { + elm_image_file_set(data, ui_utils_get_resource(TG_PLAY_NORMAL_ICON), NULL); + } +} + +/* +static Eina_Bool progress_timer_cb(void *data) +{ + double value = 0.0; + Evas_Object *progressbar = data; + + value = elm_progressbar_value_get(progressbar); + if (value == 1.0) value = 0.0; + value = value + 0.01; + elm_progressbar_value_set(progressbar, value); + + return ECORE_CALLBACK_RENEW; +} +*/ + +static void progressbar_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + + +} + +static Evas_Object *create_audio_progressbar(Evas_Object *parent, int duration) +{ + Evas_Object *progressbar; + + progressbar = elm_progressbar_add(parent); + evas_object_size_hint_align_set(progressbar, EVAS_HINT_FILL, 0.5); + evas_object_size_hint_weight_set(progressbar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_progressbar_value_set(progressbar, 0.0); + evas_object_event_callback_add(progressbar, EVAS_CALLBACK_DEL, progressbar_del_cb, NULL); + evas_object_show(progressbar); + + elm_object_part_text_set(progressbar, "elm.text.top.left", ""); + elm_object_part_text_set(progressbar, "elm.text.top.right", ""); + + elm_object_part_text_set(progressbar, "elm.text.bottom.left", "00:00"); + + int seconds = (int) (duration / 1000) % 60 ; + int minutes = (int) ((duration / (1000*60)) % 60); + + char tot_dur[256] = {0,}; + char *format = NULL; + if (seconds < 10 && minutes < 10) { + format = "0%d:0%d"; + } else if (seconds > 10 && minutes < 10) { + format = "%d:0%d"; + } else if (seconds < 10 && minutes > 10) { + format = "0%d:%d"; + } else { + format = "0%d:0%d"; + } + + sprintf(tot_dur, format, minutes, seconds); + + elm_object_part_text_set(progressbar, "elm.text.bottom.right", tot_dur); + + return progressbar; +} + + +static Evas_Object *get_audio_layout_with_play(Evas_Object *parent) +{ + Evas_Object* chat_list = parent; + Evas_Object *rec_video_layout = NULL; + tgl_media_s *media_msg = NULL; + appdata_s* ad = evas_object_data_get(chat_list, "app_data"); + int user_id = (int)evas_object_data_get(chat_list, "user_id"); + int message_id = (int)evas_object_data_get(chat_list, "message_id"); + + peer_with_pic_s *sel_item = eina_list_nth(ad->peer_list, user_id); + int buddy_id = sel_item->use_data->peer_id; + + char* tablename = get_table_name_from_number(buddy_id); + tg_message_s* msg = get_message_from_message_table(message_id, tablename); + free(tablename); + if (!msg) { + return NULL; + } + + Evas_Object *parent_obj = evas_object_data_get(chat_list, "parent_obj"); //entry + + //if (msg->out) { + + media_msg = get_media_details_from_db(atoll(msg->media_id)); + + char *audio_file = media_msg->file_path; + + char edj_path[PATH_MAX] = {0, }; + app_get_resource(TELEGRAM_INIT_VIEW_EDJ, edj_path, (int)PATH_MAX); + rec_video_layout = elm_layout_add(parent); + elm_layout_file_set(rec_video_layout, edj_path, "bubble_audio_item_layout"); + evas_object_size_hint_weight_set(rec_video_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(rec_video_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(rec_video_layout); + + + /**************** play icon **********************/ + Evas_Object* play_pause_btn = elm_button_add(parent); + elm_object_style_set(play_pause_btn, "transparent"); + evas_object_size_hint_align_set(play_pause_btn, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(play_pause_btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + Evas_Object* play_pause_icon = elm_image_add(parent); + evas_object_size_hint_align_set(play_pause_icon, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(play_pause_icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + elm_image_file_set(play_pause_icon, ui_utils_get_resource(TG_PLAY_NORMAL_ICON), NULL); + + elm_image_resizable_set(play_pause_icon, EINA_TRUE, EINA_TRUE); + evas_object_show(play_pause_icon); + + elm_object_content_set(play_pause_btn, play_pause_icon); + + Eina_Bool is_play_mode = EINA_TRUE; + evas_object_data_set(play_pause_icon, "is_play_mode", is_play_mode); + + evas_object_data_set(play_pause_icon, "audio_file_path", strdup(audio_file)); + evas_object_data_set(play_pause_icon, "app_data", ad); + evas_object_data_set(play_pause_icon, "user_id", (void*)user_id); + evas_object_data_set(play_pause_icon, "message_id", (void*)message_id); + evas_object_data_set(play_pause_icon, "media_id", strdup(msg->media_id)); + + evas_object_smart_callback_add(parent_obj, "clicked", on_message_play_pause_clicked, play_pause_icon); + evas_object_smart_callback_add(parent_obj, "pressed", on_message_play_pause_pressed, play_pause_icon); + evas_object_smart_callback_add(parent_obj, "unpressed", on_message_play_pause_unpressed, play_pause_icon); + + evas_object_smart_callback_add(play_pause_btn, "clicked", on_message_play_pause_clicked, play_pause_icon); + evas_object_smart_callback_add(play_pause_btn, "pressed", on_message_play_pause_pressed, play_pause_icon); + evas_object_smart_callback_add(play_pause_btn, "unpressed", on_message_play_pause_unpressed, play_pause_icon); + + elm_object_part_content_set(rec_video_layout, "swallow.play_icon", play_pause_btn); + /**************** play icon **********************/ + + /*************** progress bar ********************/ + int total_duration = 0; + if (audio_file) { + metadata_extractor_h metadata; + metadata_extractor_create(&metadata); + int ret = metadata_extractor_set_path(metadata, audio_file); + char *value = NULL; + ret = metadata_extractor_get_metadata(metadata, METADATA_DURATION, &value); + metadata_extractor_destroy(metadata); + + + if (value) { + total_duration = atoi(value); + free(value); + } + } else { + total_duration = media_msg->doc_duration; + //convert into milli secs + total_duration = 1000 * total_duration; + } + Evas_Object *progress = create_audio_progressbar(parent, total_duration); + + evas_object_data_set(parent_obj, "play_pause_icon", play_pause_icon); + evas_object_data_set(parent_obj, "progress_bar", progress); + + elm_object_part_content_set(rec_video_layout, "swallow.progress_icon", progress); + + evas_object_data_set(play_pause_icon, "progress_control", (void*)progress); + Eina_Bool is_download_in_progress = EINA_FALSE; + evas_object_data_set(progress, "is_download_in_progress", (void*)is_download_in_progress); + + /*************** progress bar ********************/ + + //} + + if(msg->message) { + free(msg->message); + msg->message = NULL; + } + + if(msg->media_id) { + free(msg->media_id); + msg->media_id = NULL; + } + + free(msg); + free_media_details(media_msg); + + + return rec_video_layout; +} + + static Evas_Object * item_provider(void *data, Evas_Object *entry, const char *item) { @@ -686,25 +1026,40 @@ static Evas_Object * item_provider(void *data, Evas_Object *entry, const char *i } - if (msg->out) { + if (media_msg && strstr(media_msg->doc_type, "audio") != NULL) { + + evas_object_data_set(chat_list, "parent_obj", (void*)entry); + item_to_display = get_audio_layout_with_play(chat_list); + + } else if (msg->out) { + if (msg->media_type == tgl_message_media_photo) { + item_to_display = get_image_from_path(img_path, entry); + } else { - if ((media_msg && strstr(media_msg->doc_type, "video") != NULL )|| (media_msg && strstr(media_msg->doc_type, "audio") != NULL)) { + if (media_msg && strstr(media_msg->doc_type, "video") != NULL) { + item_to_display = get_media_layout_with_play(img_path, entry, EINA_TRUE); + } else { } } + } else { if (!is_blur_image) { if (msg->media_type == tgl_message_media_photo) { + item_to_display = get_image_from_path(img_path, entry); evas_object_data_set(entry, "image_object", (void*)item_to_display); + } else { - if ((media_msg && strstr(media_msg->doc_type, "video") != NULL )|| (media_msg && strstr(media_msg->doc_type, "audio") != NULL)) { + if (media_msg && strstr(media_msg->doc_type, "video") != NULL) { + item_to_display = get_media_layout_with_play(img_path, entry, EINA_TRUE); + } else { } @@ -809,25 +1164,29 @@ static Evas_Object * item_provider(void *data, Evas_Object *entry, const char *i evas_object_data_set(entry, "media_id", (void*)strdup(msg->media_id)); - evas_object_smart_callback_add(entry, "clicked", on_media_chat_item_clicked, NULL); if (item_to_display) { - char edj_path[PATH_MAX] = {0, }; - app_get_resource(TELEGRAM_INIT_VIEW_EDJ, edj_path, (int)PATH_MAX); - layout = elm_layout_add(entry); - elm_layout_file_set(layout, edj_path, "chat_image_layout"); - 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_show(layout); + if (media_msg && strstr(media_msg->doc_type, "audio") != NULL) { + layout = item_to_display; + } else { + char edj_path[PATH_MAX] = {0, }; + app_get_resource(TELEGRAM_INIT_VIEW_EDJ, edj_path, (int)PATH_MAX); + layout = elm_layout_add(entry); + elm_layout_file_set(layout, edj_path, "chat_image_layout"); + 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_show(layout); - Evas_Object *rounded_layout = elm_layout_add(entry); - elm_layout_file_set(rounded_layout, edj_path, "rounded_corner_layout"); - evas_object_size_hint_weight_set(rounded_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(rounded_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_show(rounded_layout); - elm_object_part_content_set(rounded_layout, "content", item_to_display); + Evas_Object *rounded_layout = elm_layout_add(entry); + elm_layout_file_set(rounded_layout, edj_path, "rounded_corner_layout"); + evas_object_size_hint_weight_set(rounded_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(rounded_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(rounded_layout); + elm_object_part_content_set(rounded_layout, "content", item_to_display); - elm_object_part_content_set(layout, "swallow.chat_image", rounded_layout); + elm_object_part_content_set(layout, "swallow.chat_image", rounded_layout); + evas_object_smart_callback_add(entry, "clicked", on_media_chat_item_clicked, NULL); + } } if(msg->message) { @@ -975,12 +1334,16 @@ Evas_Object *on_message_item_content_get_cb(void *data, Evas_Object *obj, const evas_object_show(layout); // To be handled for group chat -#if 0 + char temp_name[256] = {0,}; - snprintf(temp_name, sizeof(temp_name), "%s
", sender_name); -#endif + if (msg->media_type == tgl_message_media_photo || msg->media_type == tgl_message_media_document) { + snprintf(temp_name, sizeof(temp_name), "%s

", sender_name); + } else { + snprintf(temp_name, sizeof(temp_name), "%s
", sender_name); + } + Eina_Strbuf *buf = eina_strbuf_new(); - eina_strbuf_append(buf, ""); + eina_strbuf_append(buf, temp_name); if (sender_name) { free(sender_name); @@ -999,9 +1362,37 @@ Evas_Object *on_message_item_content_get_cb(void *data, Evas_Object *obj, const tgl_media_s *media_msg = get_media_details_from_db(atoll(msg->media_id)); if (msg->out) { - eina_strbuf_append(buf, ""); + if (media_msg) { + if (strstr(media_msg->doc_type, "audio") != NULL) { + if (ad->target_direction == TELEGRAM_TARGET_DIRECTION_PORTRAIT || ad->target_direction == TELEGRAM_TARGET_DIRECTION_PORTRAIT_INVERSE) { + eina_strbuf_append(buf, ""); + } else { + eina_strbuf_append(buf, ""); + } + + } else if (strstr(media_msg->doc_type, "video") != NULL) { + eina_strbuf_append(buf, ""); + } else { + eina_strbuf_append(buf, ""); + } + } } else { - eina_strbuf_append(buf, ""); + if (media_msg) { + if (strstr(media_msg->doc_type, "audio") != NULL) { + + if (ad->target_direction == TELEGRAM_TARGET_DIRECTION_PORTRAIT || ad->target_direction == TELEGRAM_TARGET_DIRECTION_PORTRAIT_INVERSE) { + elm_object_style_set(entry, "readmessage_audio"); + } else { + elm_object_style_set(entry, "readmessage_audio_land"); + } + + eina_strbuf_append(buf, ""); + } else if (strstr(media_msg->doc_type, "video") != NULL) { + eina_strbuf_append(buf, ""); + } else { + eina_strbuf_append(buf, ""); + } + } } free_media_details(media_msg); elm_entry_entry_set(entry, eina_strbuf_string_get(buf)); @@ -1194,12 +1585,23 @@ void on_media_download_completed(appdata_s* ad, int buddy_id, long long media_id long long lmedia_id = atoll(media_id_str); if (media_id == lmedia_id) { - if (img_item) { + if (img_item || (strstr(media_type_str, "audio") != NULL)) { + if (strstr(file_path, "failed_to_load") != NULL) { + + if ((strstr(media_type_str, "audio") != NULL)) { + Evas_Object *play_pause_icon = evas_object_data_get(entry, "play_pause_icon"); + Evas_Object *progressbar = evas_object_data_get(entry, "progress_bar"); + evas_object_data_set(progressbar, "is_download_in_progress", EINA_FALSE); + evas_object_data_set(play_pause_icon, "audio_file_path", NULL); + //sandeep + elm_object_style_set(progressbar, "default"); + return; + } + // download failed. if (size_btn) { - Evas_Object* progress = elm_object_content_get(size_btn); if (progress) { evas_object_del(progress); @@ -1214,11 +1616,60 @@ void on_media_download_completed(appdata_s* ad, int buddy_id, long long media_id } else { + + if ((strstr(media_type_str, "audio") != NULL)) { + Evas_Object *play_pause_icon = evas_object_data_get(entry, "play_pause_icon"); + Evas_Object *progressbar = evas_object_data_get(entry, "progress_bar"); + evas_object_data_set(progressbar, "is_download_in_progress", EINA_FALSE); + elm_object_style_set(progressbar, "default"); + evas_object_data_set(play_pause_icon, "audio_file_path", file_path); + //sandeep + metadata_extractor_h metadata; + metadata_extractor_create(&metadata); + int ret = metadata_extractor_set_path(metadata, file_path); + char *value = NULL; + ret = metadata_extractor_get_metadata(metadata, METADATA_DURATION, &value); + metadata_extractor_destroy(metadata); + + int duration = 0; + if (value) { + duration = atoi(value); + free(value); + } + + elm_object_part_text_set(progressbar, "elm.text.top.left", ""); + elm_object_part_text_set(progressbar, "elm.text.top.right", ""); + + elm_object_part_text_set(progressbar, "elm.text.bottom.left", "00:00"); + + int seconds = (int) (duration / 1000) % 60 ; + int minutes = (int) ((duration / (1000*60)) % 60); + + char tot_dur[256] = {0,}; + char *format = NULL; + if (seconds < 10 && minutes < 10) { + format = "0%d:0%d"; + } else if (seconds > 10 && minutes < 10) { + format = "%d:0%d"; + } else if (seconds < 10 && minutes > 10) { + format = "0%d:%d"; + } else { + format = "0%d:0%d"; + } + + sprintf(tot_dur, format, minutes, seconds); + + elm_object_part_text_set(progressbar, "elm.text.bottom.right", tot_dur); + + + return; + } + if (size_btn) { evas_object_del(size_btn); } - if ((strstr(media_type_str, "video") != NULL) || (strstr(media_type_str, "audio") != NULL)) { + if ((strstr(media_type_str, "video") != NULL)) { Evas_Object* play_img = get_video_paly_icon(img_item); //Evas_Object* play_img = get_image_from_path(ui_utils_get_resource(MEDIA_PLAY_ICON), img_item); elm_object_part_content_set(img_item, "swallow.play_btn", play_img); @@ -1341,8 +1792,7 @@ static Eina_Bool on_new_text_message_send_cb(void *data) if (!text_to_send || (strlen(text_to_send) == 0)) return ECORE_CALLBACK_CANCEL; - ad->msg_count = ad->msg_count + 1001; - int unique_id = time(NULL) + ad->msg_count; + int unique_id = time(NULL); tg_message_s msg; msg.msg_id = unique_id; msg.from_id = ad->current_user_data->user_id.id; @@ -1407,11 +1857,10 @@ static void on_text_message_send_clicked(void *data, Evas_Object *obj, void *eve return; if(add_date_item_to_chat(data)) { - ecore_timer_add(1, on_new_text_message_send_cb, chat_list); + ecore_timer_add(2, on_new_text_message_send_cb, chat_list); return; } - ad->msg_count = ad->msg_count + 1001; - int unique_id = time(NULL) + ad->msg_count; + int unique_id = time(NULL); tg_message_s msg; msg.msg_id = unique_id; msg.from_id = ad->current_user_data->user_id.id; @@ -1550,13 +1999,31 @@ void on_user_presence_state_changed(appdata_s* ad, int buddy_id) int user_list_size = chat_info->user_list_size; int online_members = 0; + char *names_of_buddies = NULL; + + for (int i = 0; i < user_list_size; i++) { + int is_online = get_buddy_online_status(chat_info->chat_users[i]); if (is_online > 0) { online_members++; } + + char *buddy_name = get_buddy_name_from_id(chat_info->chat_users[i]); + + if (buddy_name) { + if (!names_of_buddies) { + names_of_buddies = (char*)malloc(strlen(buddy_name) + 1); + strcpy(names_of_buddies, buddy_name); + } else { + names_of_buddies = (char*)realloc(names_of_buddies, strlen(names_of_buddies) + strlen(" / ") + strlen(buddy_name) + 1); + strcat(names_of_buddies, " / "); + strcat(names_of_buddies, buddy_name); + } + } } + evas_object_data_set(ad->nf, "names_of_buddies", (void*)names_of_buddies); if (online_members == 0) { @@ -1648,8 +2115,7 @@ static Eina_Bool on_new_contact_message_send_cb(void *data) peer_with_pic_s *sel_item = eina_list_nth(ad->peer_list, user_id); - ad->msg_count = ad->msg_count + 1001; - int unique_id = time(NULL) + ad->msg_count; + int unique_id = time(NULL); char unique_id_str[50]; sprintf(unique_id_str, "%d", unique_id); @@ -1713,20 +2179,17 @@ void send_contact_message_to_buddy(void *data, char *first_name, char *last_name int user_id = (int)evas_object_data_get(chat_list, "user_id"); if(add_date_item_to_chat(data)) { - evas_object_data_set(chat_list, "contact_first_name", strdup(first_name)); evas_object_data_set(chat_list, "contact_last_name", strdup(last_name)); evas_object_data_set(chat_list, "contact_phone_number", strdup(phone_number)); - ecore_timer_add(1, on_new_contact_message_send_cb, chat_list); + ecore_timer_add(2, on_new_contact_message_send_cb, chat_list); return; } - peer_with_pic_s *sel_item = eina_list_nth(ad->peer_list, user_id); - ad->msg_count = ad->msg_count + 1001; - int unique_id = time(NULL) + ad->msg_count; + int unique_id = time(NULL); char unique_id_str[50]; sprintf(unique_id_str, "%d", unique_id); @@ -1783,8 +2246,7 @@ static Eina_Bool on_new_location_message_send_cb(void *data) peer_with_pic_s *sel_item = eina_list_nth(ad->peer_list, user_id); - ad->msg_count = ad->msg_count + 1001; - int unique_id = time(NULL) + ad->msg_count; + int unique_id = time(NULL); char unique_id_str[50]; sprintf(unique_id_str, "%d", unique_id); @@ -1846,14 +2308,13 @@ void send_location_message_to_buddy(void *data, char *latitude, char *longitude) if(add_date_item_to_chat(data)) { evas_object_data_set(chat_list, "contact_latitude", strdup(latitude)); evas_object_data_set(chat_list, "contact_longitude", strdup(longitude)); - ecore_timer_add(1, on_new_location_message_send_cb, chat_list); + ecore_timer_add(2, on_new_location_message_send_cb, chat_list); return; } peer_with_pic_s *sel_item = eina_list_nth(ad->peer_list, user_id); - ad->msg_count = ad->msg_count + 1001; - int unique_id = time(NULL) + ad->msg_count; + int unique_id = time(NULL); char unique_id_str[50]; sprintf(unique_id_str, "%d", unique_id); @@ -1909,8 +2370,7 @@ static Eina_Bool on_new_media_message_send_cb(void *data) peer_with_pic_s *sel_item = eina_list_nth(ad->peer_list, user_id); - ad->msg_count = ad->msg_count + 1001; - int unique_id = time(NULL) + ad->msg_count; + int unique_id = time(NULL); char unique_id_str[50]; sprintf(unique_id_str, "%d", unique_id); @@ -1986,13 +2446,12 @@ void send_media_message_to_buddy(void *data, const char* file_path, enum tgl_mes evas_object_data_set(chat_list, "file_type", strdup(file_type_char)); evas_object_data_set(chat_list, "file_path", strdup(file_path)); - ecore_timer_add(1, on_new_media_message_send_cb, chat_list); + ecore_timer_add(2, on_new_media_message_send_cb, chat_list); return; } peer_with_pic_s *sel_item = eina_list_nth(ad->peer_list, user_id); - ad->msg_count = ad->msg_count + 1001; - int unique_id = time(NULL) + ad->msg_count; + int unique_id = time(NULL); char unique_id_str[50]; sprintf(unique_id_str, "%d", unique_id); @@ -2583,13 +3042,115 @@ void refresh_messaging_view(appdata_s *ad) return; Evas_Object *chat_conv_list = evas_object_data_get(ad->nf, "chat_list"); - if (!chat_conv_list) { + if (chat_conv_list) { + /* Evas_Coord w, h; elm_win_screen_size_get(ad->win, NULL, NULL, &w, &h); evas_object_size_hint_min_set(chat_conv_list, w, h); + */ + elm_genlist_realized_items_update(chat_conv_list); + Elm_Object_Item *item = elm_genlist_last_item_get(chat_conv_list); + elm_genlist_item_show(item, ELM_GENLIST_ITEM_SCROLLTO_TOP); + } + + Evas_Object *user_pic_layout = evas_object_data_get(ad->nf, "profile_pic_layout"); + + if (!user_pic_layout) + return; + + switch (ad->target_direction) { + case TELEGRAM_TARGET_DIRECTION_PORTRAIT: + case TELEGRAM_TARGET_DIRECTION_PORTRAIT_INVERSE: + { + elm_layout_signal_emit(user_pic_layout, "pro_pic_default", "pro_pic_resize"); + break; + } + case TELEGRAM_TARGET_DIRECTION_LANDSCAPE: + case TELEGRAM_TARGET_DIRECTION_LANDSCAPE_INVERSE: + { + elm_layout_signal_emit(user_pic_layout, "pro_pic_land", "pro_pic_resize"); + break; + } + + default: + { + break; + } } + } +static void on_expand_buton_clicked(void *data, Evas_Object *obj, void *event_info) +{ + Evas_Object *expand_pic = data; + if (!expand_pic) + return; + + appdata_s *ad = evas_object_data_get(expand_pic, "app_data"); + Evas_Object *parent_layout = evas_object_data_get(expand_pic, "parent_layout"); + + Eina_Bool is_expanded = (Eina_Bool)evas_object_data_get(expand_pic, "is_expanded"); + + if (!is_expanded) { + + elm_image_file_set(expand_pic, ui_utils_get_resource(TG_EXPAND_CLOSE), NULL); + + Evas_Object *grp_names_bg = elm_bg_add(ad->nf); + evas_object_size_hint_align_set(grp_names_bg, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(grp_names_bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_color_set(grp_names_bg, 45, 165, 224, 255); + elm_image_resizable_set(grp_names_bg, EINA_TRUE, EINA_TRUE); + elm_image_fill_outside_set(grp_names_bg, EINA_TRUE); + evas_object_show(grp_names_bg); + elm_object_part_content_set(parent_layout, "swallow.group_detail_box,bg", grp_names_bg); + + Evas_Object* grp_names_lbl = elm_entry_add(ad->nf); + elm_entry_cursor_end_set(grp_names_lbl); + evas_object_size_hint_weight_set(grp_names_lbl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(grp_names_lbl, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_entry_single_line_set(grp_names_lbl, EINA_FALSE); + elm_entry_scrollable_set (grp_names_lbl, EINA_TRUE); + elm_entry_cnp_mode_set(grp_names_lbl, ELM_CNP_MODE_NO_IMAGE); + elm_entry_context_menu_disabled_set(grp_names_lbl, EINA_TRUE); + elm_object_focus_set(grp_names_lbl, EINA_FALSE); + elm_entry_editable_set(grp_names_lbl, EINA_FALSE); + + evas_object_show(grp_names_lbl); + + char *names_of_buddies = evas_object_data_get(ad->nf, "names_of_buddies"); + if (names_of_buddies) { + int len = strlen(names_of_buddies); + char *names_str = (char*)malloc(len + 256); + sprintf(names_str, "%s",names_of_buddies); + elm_object_text_set(grp_names_lbl, names_str); + free(names_str); + } + + elm_object_part_content_set(parent_layout, "swallow.group_detail_box", grp_names_lbl); + + } else { + + elm_image_file_set(expand_pic, ui_utils_get_resource(TG_EXPAND_OPEN), NULL); + + Evas_Object *grp_names_lbl = elm_object_part_content_get(parent_layout, "swallow.group_detail_box"); + if (grp_names_lbl) { + evas_object_del(grp_names_lbl); + grp_names_lbl = NULL; + } + + Evas_Object *grp_names_bg = elm_object_part_content_get(parent_layout, "swallow.group_detail_box,bg"); + if (grp_names_bg) { + evas_object_del(grp_names_bg); + grp_names_bg = NULL; + } + } + is_expanded = !is_expanded; + evas_object_data_set(expand_pic, "is_expanded", is_expanded); + + +} + + void launch_messaging_view_cb(appdata_s* ad, int user_id) { if (!ad) @@ -2624,12 +3185,9 @@ void launch_messaging_view_cb(appdata_s* ad, int user_id) evas_object_show(layout); elm_object_content_set(scroller, layout); - - peer_with_pic_s *sel_item = eina_list_nth(ad->peer_list, user_id); tg_peer_info_s* user = sel_item->use_data; - /*************************** message list ************************************/ Evas_Object* msg_box_layout = elm_layout_add(ad->nf); @@ -2675,11 +3233,15 @@ void launch_messaging_view_cb(appdata_s* ad, int user_id) /********************** title layout ******************************/ Evas_Object *title_layout = elm_layout_add(ad->nf); - elm_layout_file_set(title_layout, edj_path, "message_title_box"); + elm_layout_file_set(title_layout, edj_path, "chat_title_box"); evas_object_size_hint_weight_set(title_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(title_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(title_layout); + Evas_Object *back_btn = create_button(ad->nf, "naviframe/back_btn/default", NULL); + evas_object_smart_callback_add(back_btn, "clicked", on_message_back_button_clicked, ad); + elm_object_part_content_set(title_layout, "swallow.back_arrow", back_btn); + Evas_Object *profile_pic = NULL; profile_pic = elm_image_add(layout); evas_object_size_hint_weight_set(profile_pic, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); @@ -2709,14 +3271,7 @@ void launch_messaging_view_cb(appdata_s* ad, int user_id) elm_object_part_content_set(user_pic_layout, "content", profile_pic); evas_object_data_set(ad->nf, "profile_picture", (void*)profile_pic); elm_object_part_content_set(title_layout, "swallow.profile_pic", user_pic_layout); - - elm_object_part_content_set(main_layout, "swallow.item", title_layout); - - Evas_Object *back_btn = create_button(ad->nf, "naviframe/back_btn/default", NULL); - evas_object_smart_callback_add(back_btn, "clicked", on_message_back_button_clicked, ad); - elm_object_part_content_set(title_layout, "swallow.back_arrow", back_btn); - - + evas_object_data_set(ad->nf, "profile_pic_layout", (void*)user_pic_layout); Evas_Object *profile_name = elm_label_add(title_layout); if ((user->peer_type == TGL_PEER_USER) && get_buddy_unknown_status(user->peer_id)) { @@ -2747,11 +3302,38 @@ void launch_messaging_view_cb(appdata_s* ad, int user_id) evas_object_data_set(ad->nf, "profile_time", (void*)profile_time); evas_object_smart_callback_add(profile_time, "clicked", on_user_info_button_clicked, ad); - //elm_object_content_set(title_scroller, title_layout); on_user_presence_state_changed(ad, sel_item->use_data->peer_id); - elm_object_part_content_set(layout, "swallow.title_box", main_layout); + + + /******************** expand ************************/ + if (user->peer_type == TGL_PEER_CHAT) { + Evas_Object *expand_pic = NULL; + expand_pic = elm_image_add(layout); + evas_object_size_hint_weight_set(expand_pic, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(expand_pic, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_object_focus_set(expand_pic, EINA_FALSE); + elm_image_file_set(expand_pic, ui_utils_get_resource(TG_EXPAND_OPEN), NULL); + evas_object_show(expand_pic); + evas_object_data_set(expand_pic, "app_data", ad); + evas_object_data_set(expand_pic, "parent_layout", layout); + + Eina_Bool is_expanded = EINA_FALSE; + evas_object_data_set(expand_pic, "is_expanded", is_expanded); + Evas_Object* expand_btn = elm_button_add(ad->layout); + elm_object_style_set(expand_btn, "transparent"); + evas_object_smart_callback_add(expand_btn, "clicked", on_expand_buton_clicked, expand_pic); + elm_object_content_set(expand_btn, expand_pic); + evas_object_show(expand_btn); + elm_object_part_content_set(title_layout, "swallow.expand_btn", expand_btn); + + } + /******************** expand ************************/ + + + elm_object_part_content_set(layout, "swallow.title_box", title_layout); + /********************** title layout ******************************/ @@ -2861,7 +3443,6 @@ void launch_messaging_view_cb(appdata_s* ad, int user_id) evas_object_smart_callback_add(send_btn, "unpressed", on_message_smiley_unpressed, send_icon); elm_object_part_content_set(entry_box_layout, "swallow.send_icon", send_btn); - //elm_object_part_content_set(layout, "swallow.entry_box", entry_box_layout); /********************** entry layout*******************************/ evas_object_data_set(ad->nf, "chat_list", (void*)chat_conv_list); @@ -2870,10 +3451,11 @@ void launch_messaging_view_cb(appdata_s* ad, int user_id) evas_object_data_set(chat_conv_list, "text_entry", (void*)text_entry); evas_object_data_set(chat_conv_list, "profile_time", (void*)profile_time); - Elm_Object_Item *nf_it = elm_naviframe_item_simple_push(ad->nf, scroller); + Elm_Object_Item *nf_it = elm_naviframe_item_simple_push(ad->nf, scroller); elm_object_item_part_content_set(nf_it, "toolbar", entry_box_layout); + Eina_Bool ret = load_chat_history(chat_conv_list); if (!ret) { diff --git a/TelegramTizen/src/tg_settings_view.c b/TelegramTizen/src/tg_settings_view.c index e67db44..0af3ab8 100644 --- a/TelegramTizen/src/tg_settings_view.c +++ b/TelegramTizen/src/tg_settings_view.c @@ -261,11 +261,8 @@ void on_image_select_result_cb(app_control_h request, app_control_h reply, app_c if (file_path) { appdata_s *ad = (appdata_s*)user_data; if (ad) { - Evas_Object *profile_pic = evas_object_data_get(ad->nf, "user_profile_pic"); - if (profile_pic) { - elm_image_file_set(profile_pic, file_path, NULL); - send_set_profile_pic_request(ad->service_client, ad->current_user_data->user_id.id, file_path); - } + show_loading_popup(ad); + send_set_profile_pic_request(ad->service_client, ad->current_user_data->user_id.id, file_path); } break; } @@ -317,7 +314,10 @@ char* on_camera_load_text_get_cb(void *data, Evas_Object *obj, const char *part) void on_camera_button_clicked(void *data, Evas_Object *obj, void *event_info) { - Evas_Object* cam_icon = data; + appdata_s* ad = data; + + if (!ad) + return; static Elm_Genlist_Item_Class itc; Evas_Object *popup; @@ -325,7 +325,7 @@ void on_camera_button_clicked(void *data, Evas_Object *obj, void *event_info) Evas_Object *genlist; int i; - appdata_s* ad = evas_object_data_get(obj, "app_data"); + Evas_Object *win = ad->win; Elm_Object_Item *it = event_info; @@ -685,7 +685,7 @@ char* _text_requested_cb(void *data, Evas_Object *obj, const char *part) if (!strcmp(part,"elm.text.main.left.top") || !strcmp(part,"elm.text")){ switch(id) { case 0: - return strdup(ad->current_user_data->print_name); + return replace(ad->current_user_data->print_name, '_', " "); case 1: return strdup(i18n_get_text("IDS_TGRAM_OPT_SET_BACKGROUND_IMAGE_ABB")); default: @@ -722,18 +722,19 @@ Evas_Object* _content_requested_cb(void *data, Evas_Object *obj, const char *par if (ad->current_user_data->photo_path && strlen(ad->current_user_data->photo_path) > 0 && strstr(ad->current_user_data->photo_path, "_null_") == NULL) { profile_pic = get_image_from_path(ad->current_user_data->photo_path, ad->nf); } else { - profile_pic = get_image_from_path(ui_utils_get_resource(DEFAULT_PROFILE_PIC), ad->nf); + profile_pic = get_image_from_path(ui_utils_get_resource(DEFAULT_LIST_THUMB_SINGLE_PIC), ad->nf); + evas_object_color_set(profile_pic, 45, 165, 224, 255); } char edj_path[PATH_MAX] = {0, }; app_get_resource(TELEGRAM_INIT_VIEW_EDJ, edj_path, (int)PATH_MAX); Evas_Object* user_pic_layout = elm_layout_add(ad->nf); - elm_layout_file_set(user_pic_layout, edj_path, "circle_layout"); + elm_layout_file_set(user_pic_layout, edj_path, "search_circle_layout"); evas_object_size_hint_weight_set(user_pic_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(user_pic_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(user_pic_layout); elm_object_part_content_set(user_pic_layout, "content", profile_pic); - evas_object_data_set(ad->nf, "user_profile_pic", profile_pic); + evas_object_data_set(ad->nf, "settings_user_profile_pic", profile_pic); eo = elm_layout_add(obj); elm_layout_theme_set(eo, "layout", "list/B/type.1", "default"); @@ -802,6 +803,7 @@ static void ctxpopup_profile_select_cb(void *data, Evas_Object *obj, void *event } _ctxpopup_dismiss_cb(ad, NULL, NULL); + on_camera_button_clicked(ad, obj, event_info); /* please input here when set profile picture menu is clicked */ } @@ -917,7 +919,7 @@ void launch_settings_screen(appdata_s* ad) itc.func.state_get = NULL; itc.func.del = NULL; - elm_genlist_item_append(list, &itc, (void*) 0, NULL, ELM_GENLIST_ITEM_NONE, on_camera_button_clicked, (void*) 0); + elm_genlist_item_append(list, &itc, (void*) 0, NULL, ELM_GENLIST_ITEM_NONE, on_camera_button_clicked, (void*) ad); elm_genlist_item_append(list, &itc, (void*) 1, NULL, ELM_GENLIST_ITEM_NONE, on_settings_info_item_clicked, (void*)1); Elm_Object_Item* navi_item = elm_naviframe_item_push(ad->nf, i18n_get_text("IDS_TGRAM_OPT_SETTINGS"), NULL, NULL, list, NULL); diff --git a/TelegramTizen/src/tg_user_main_view.c b/TelegramTizen/src/tg_user_main_view.c index 106453c..d07a50c 100644 --- a/TelegramTizen/src/tg_user_main_view.c +++ b/TelegramTizen/src/tg_user_main_view.c @@ -1154,7 +1154,7 @@ static void ctxpopup_settings_select_cb(void *data, Evas_Object *obj, void *even } _ctxpopup_dismiss_cb(ad, NULL, NULL); - + delete_floating_button(ad); launch_settings_screen(ad); } diff --git a/TelegramTizen/tg_utils/tg_common.h b/TelegramTizen/tg_utils/tg_common.h index 22ae37a..484cb24 100644 --- a/TelegramTizen/tg_utils/tg_common.h +++ b/TelegramTizen/tg_utils/tg_common.h @@ -53,6 +53,9 @@ #define SEARCH_ICON FM_ICON_PATH"/search_icon.png" #define TG_ATTACH_ICON FM_ICON_PATH"/telegram_add_object.png" +#define TG_EXPAND_OPEN FM_ICON_PATH"telegram_icon_expand_close.png" +#define TG_EXPAND_CLOSE FM_ICON_PATH"telegram_icon_expand_open.png" + //#define SMILEY_ICON_UNPRESSED FM_ICON_PATH"/ic_msg_panel_smiles_pressed.png" //#define SMILEY_ICON_PRESSED FM_ICON_PATH"/ic_msg_panel_smiles_unpressed.png" @@ -107,6 +110,14 @@ //#define TG_AUDIO_ICON FM_ICON_PATH"Audio-Icon.png" #define TG_AUDIO_ICON FM_ICON_PATH"Audio-wave.png" +#define TG_PAUSE_DIM_ICON FM_ICON_PATH"telegram_audio_player_pause_dim.png" +#define TG_PAUSE_NORMAL_ICON FM_ICON_PATH"telegram_audio_player_pause_normal.png" +#define TG_PAUSE_PRESS_ICON FM_ICON_PATH"telegram_audio_player_pause_press.png" + +#define TG_PLAY_DIM_ICON FM_ICON_PATH"telegram_audio_player_play_dim.png" +#define TG_PLAY_NORMAL_ICON FM_ICON_PATH"telegram_audio_player_play_normal.png" +#define TG_PLAY_PRESS_ICON FM_ICON_PATH"telegram_audio_player_play_press.png" + #define INIT_SCREEN_1 FM_ICON_PATH"screenshot_1.png" #define INIT_SCREEN_2 FM_ICON_PATH"screenshot_2.png" @@ -561,7 +572,7 @@ typedef struct appdata { Elm_Theme *theme; int screen_mode_for_fb; // for floating button icon Evas_Object *menu_popup; - int msg_count; + //int msg_count; } appdata_s; extern void show_toast(appdata_s* ad, char* value); diff --git a/tg-engine-service/inc/tg_db_wrapper.h b/tg-engine-service/inc/tg_db_wrapper.h index 8bc69db..bb08845 100644 --- a/tg-engine-service/inc/tg_db_wrapper.h +++ b/tg-engine-service/inc/tg_db_wrapper.h @@ -270,4 +270,6 @@ void delete_media_from_unsent_db(int message_id); Eina_Bool is_user_present_peer_table(int id); Eina_Bool is_user_present_chat_table(int id); +int update_current_date_to_table(char* tb_name, int recent_msg_date); + #endif /* TG_DB_WRAPPER_H_ */ diff --git a/tg-engine-service/src/tg_db_wrapper.c b/tg-engine-service/src/tg_db_wrapper.c index d31942f..bdd6660 100644 --- a/tg-engine-service/src/tg_db_wrapper.c +++ b/tg-engine-service/src/tg_db_wrapper.c @@ -690,7 +690,7 @@ void create_buddy_msg_table(const char* table_name) eina_list_free(col_types); } -int insert_current_date_to_table(char* tb_name) +int update_current_date_to_table(char* tb_name, int recent_msg_date) { struct tgl_message* last_msg = get_latest_message_from_message_table(tb_name); if (last_msg) { @@ -707,6 +707,94 @@ int insert_current_date_to_table(char* tb_name) struct tm new_lt; (void) localtime_r(&new_t, &new_lt); + if (old_lt.tm_mday == new_lt.tm_mday && old_lt.tm_mon == new_lt.tm_mon && old_lt.tm_year == new_lt.tm_year) { + // no need of new date + return -1; + } else { + int cur_time = time(NULL); + time_t t = cur_time; + + char *format = NULL; + format = "%a, %d%b. %Y"; + + struct tm lt; + char res[256]; + (void) localtime_r(&t, <); + + if (strftime(res, sizeof(res), format, <) == 0) { + (void) fprintf(stderr, "strftime(3): cannot format supplied " + "date/time into buffer of size %u " + "using: '%s'\n", + sizeof(res), format); + } + + srand(time(NULL)); + int r = rand(); + struct tgl_message date_msg; + date_msg.id = r; + date_msg.media.type = tgl_message_media_none; + date_msg.date = recent_msg_date - 1; + date_msg.message = res; + date_msg.message_len = strlen(res); + date_msg.service = 2; + date_msg.unread = 0; + date_msg.out = 0; + insert_msg_into_db(&date_msg, tb_name, t); + return date_msg.id; + } + + } else { + int cur_time = time(NULL); + time_t t = cur_time; + + char *format = NULL; + format = "%a, %d%b. %Y"; + + struct tm lt; + char res[256]; + (void) localtime_r(&t, <); + + if (strftime(res, sizeof(res), format, <) == 0) { + (void) fprintf(stderr, "strftime(3): cannot format supplied " + "date/time into buffer of size %u " + "using: '%s'\n", + sizeof(res), format); + } + srand(time(NULL)); + int r = rand(); + struct tgl_message date_msg; + date_msg.id = r; + date_msg.media.type = tgl_message_media_none; + date_msg.date = recent_msg_date - 1; + date_msg.message = res; + date_msg.message_len = strlen(res); + date_msg.service = 2; + date_msg.unread = 0; + date_msg.out = 0; + insert_msg_into_db(&date_msg, tb_name, t); + return date_msg.id; + } + return -1; +} + + + +int insert_current_date_to_table(char* tb_name) +{ + struct tgl_message* last_msg = get_latest_message_from_message_table(tb_name); + if (last_msg) { + int old_date = last_msg->date; + time_t old_t = old_date; + + struct tm old_lt; + (void) localtime_r(&old_t, &old_lt); + + + int cur_time = time(NULL); + time_t new_t = cur_time; + + struct tm new_lt; + (void) localtime_r(&new_t, &new_lt); if (old_lt.tm_mday == new_lt.tm_mday && old_lt.tm_mon == new_lt.tm_mon && old_lt.tm_year == new_lt.tm_year) { // no need of new date diff --git a/tg-engine-service/tg_engine/tg_engine.c b/tg-engine-service/tg_engine/tg_engine.c index f899101..806d852 100644 --- a/tg-engine-service/tg_engine/tg_engine.c +++ b/tg-engine-service/tg_engine/tg_engine.c @@ -1438,7 +1438,7 @@ void tg_msg_receive(struct tgl_state *TLS, struct tgl_message *M) return; } #endif - int msg_id = insert_current_date_to_table(tb_name); + int msg_id = update_current_date_to_table(tb_name, M->date); free(tb_name); if (msg_id > 0) { send_message_received_response(TLS->callback_data, M->from_id.id, M->to_id.id, msg_id, tgl_get_peer_type(M->to_id)); @@ -1446,7 +1446,7 @@ void tg_msg_receive(struct tgl_state *TLS, struct tgl_message *M) struct tg_temp_msg_data *msg_data = (struct tg_temp_msg_data*)malloc(sizeof(struct tg_temp_msg_data)); msg_data->M = M; msg_data->TLS = TLS; - msg_data->send_timer = ecore_timer_add(3, on_msg_received_cb, msg_data); + msg_data->send_timer = ecore_timer_add(6, on_msg_received_cb, msg_data); } else { if (M->media.type != tgl_message_media_none && (M->media.document.flags & FLAG_DOCUMENT_AUDIO)) { M->message = strdup("Audio"); @@ -1506,14 +1506,14 @@ void tg_msg_receive(struct tgl_state *TLS, struct tgl_message *M) } char* tb_name = get_table_name_from_number(user_id); - int msg_id = insert_current_date_to_table(tb_name); + int msg_id = update_current_date_to_table(tb_name, M->date); free(tb_name); if (msg_id > 0) { send_message_received_response(TLS->callback_data, M->from_id.id, M->to_id.id, msg_id, tgl_get_peer_type(M->to_id)); struct tg_temp_msg_data *msg_data = (struct tg_temp_msg_data*)malloc(sizeof(struct tg_temp_msg_data)); msg_data->M = M; msg_data->TLS = TLS; - msg_data->send_timer = ecore_timer_add(3, on_msg_received_cb, msg_data); + msg_data->send_timer = ecore_timer_add(6, on_msg_received_cb, msg_data); } else { if (M->media.type != tgl_message_media_none && (M->media.document.flags & FLAG_DOCUMENT_AUDIO)) { M->message = strdup("Audio"); -- 2.7.4 From f14008f931a5e3f5b8adf19356b53afb73a08479 Mon Sep 17 00:00:00 2001 From: "moon87.park" Date: Tue, 27 Oct 2015 14:50:29 +0900 Subject: [PATCH 14/16] [Telegram] Create the logout popup Change-Id: Ie5c6faa572c0d7274605af80525c614df69ccc6e --- TelegramTizen/src/tg_settings_view.c | 53 ++++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/TelegramTizen/src/tg_settings_view.c b/TelegramTizen/src/tg_settings_view.c index 0af3ab8..7065aaa 100644 --- a/TelegramTizen/src/tg_settings_view.c +++ b/TelegramTizen/src/tg_settings_view.c @@ -745,6 +745,56 @@ Evas_Object* _content_requested_cb(void *data, Evas_Object *obj, const char *par return eo; } +static void _cancel_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + Evas_Object *popup = data; + evas_object_del(popup); +} + +static void _logout_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + appdata_s *ad = data; + Evas_Object *popup = NULL; + + popup = evas_object_data_del(obj, "popup"); + if (popup) { + evas_object_del(popup); + } + /* FIXME : Please input the logout API here */ +} + +static void _create_logout_popup(appdata_s *ad) +{ + Evas_Object *popup; + Evas_Object *logout_btn; + Evas_Object *btn; + + /* popup */ + popup = elm_popup_add(ad->win); + elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0); + eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, eext_popup_back_cb, NULL); + evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_object_translatable_text_set(popup,"IDS_TGRAM_POP_USE_TELEGRAM_SEAMLESSLY_ACROSS_ANY_NUMBER_OF_DEVICES_MSG"); + elm_object_part_text_set(popup, "title,text", i18n_get_text("IDS_TGRAM_OPT_LOG_OUT")); + + /* logout button */ + logout_btn = elm_button_add(popup); + elm_object_style_set(logout_btn, "popup"); + elm_object_translatable_text_set(logout_btn, "IDS_TGRAM_BUTTON_LOG_OUT_ABB2"); + elm_object_part_content_set(popup, "button2", logout_btn); + evas_object_smart_callback_add(logout_btn, "clicked", _logout_btn_clicked_cb, ad); + evas_object_data_set(logout_btn, "popup", popup); + + /* cancel button */ + btn = elm_button_add(popup); + elm_object_style_set(btn, "popup"); + elm_object_translatable_text_set(btn, "IDS_TGRAM_BUTTON_CANCEL_ABB5"); + elm_object_part_content_set(popup, "button1", btn); + evas_object_smart_callback_add(btn, "clicked", _cancel_btn_clicked_cb, popup); + + evas_object_show(popup); +} + static void _more_popup_rotate(void *data, Evas_Object *obj, void *event_info) { int pos; @@ -830,8 +880,7 @@ static void ctxpopup_logout_select_cb(void *data, Evas_Object *obj, void *event_ } _ctxpopup_dismiss_cb(ad, NULL, NULL); - - /* please input here when logout menu is clicked */ + _create_logout_popup(ad); } static void _create_more_popup(void *data, Evas_Object *obj, void *event_info) -- 2.7.4 From f50fe10ae1d70bfce5db0bfead77764e5f3abead Mon Sep 17 00:00:00 2001 From: "polu.sandeep" Date: Tue, 27 Oct 2015 18:48:59 +0900 Subject: [PATCH 15/16] Apply latest changes Change-Id: Icbf46c6cfdf4a7660f96709f25b818a3a0a42a96 --- TelegramTizen/inc/server_requests.h | 1 + TelegramTizen/inc/tg_settings_view.h | 1 + TelegramTizen/src/server_requests.c | 53 +++++++++++++++ TelegramTizen/src/telegramtizen.c | 79 +++++++++++++++++++++-- TelegramTizen/src/tg_edit_name_view.c | 10 ++- TelegramTizen/src/tg_settings_view.c | 23 ++++++- TelegramTizen/src/tg_user_main_view.c | 16 +++-- TelegramTizen/tg_utils/tg_common.c | 15 ++++- TelegramTizen/tg_utils/tg_common.h | 1 + tg-engine-service/inc/server_response.h | 2 + tg-engine-service/inc/tg_db_wrapper.h | 3 + tg-engine-service/src/server_response.c | 50 +++++++++++++++ tg-engine-service/src/tg-engine-service.c | 19 ++++++ tg-engine-service/src/tg_db_wrapper.c | 103 +++++++++++++++++++++++++++++- tg-engine-service/tg_engine/tg_engine.c | 61 ++++++++++++++++++ tg-engine-service/tg_engine/tg_engine.h | 1 + 16 files changed, 417 insertions(+), 21 deletions(-) diff --git a/TelegramTizen/inc/server_requests.h b/TelegramTizen/inc/server_requests.h index 37f2142..2ac52d5 100644 --- a/TelegramTizen/inc/server_requests.h +++ b/TelegramTizen/inc/server_requests.h @@ -35,5 +35,6 @@ void send_remove_buddy_from_group_chat_request(service_client* service_client, i void send_request_for_delete_notifications(service_client* service_client); void send_request_for_server_connection_status(service_client* service_client); void send_update_chat_request(service_client* service_client, const int chat_id); +void send_update_display_name_request(service_client* service_client, int user_id, const char* first_name, const char* last_name); #endif /* SERVER_REQUESTS_H_ */ diff --git a/TelegramTizen/inc/tg_settings_view.h b/TelegramTizen/inc/tg_settings_view.h index dab52b1..48b588f 100644 --- a/TelegramTizen/inc/tg_settings_view.h +++ b/TelegramTizen/inc/tg_settings_view.h @@ -13,5 +13,6 @@ extern void launch_settings_screen(appdata_s* ad); +extern void refresh_settings_screen(appdata_s* ad); #endif /* TG_SETTINGS_VIEW_H_ */ diff --git a/TelegramTizen/src/server_requests.c b/TelegramTizen/src/server_requests.c index 0782d0a..d391dc8 100644 --- a/TelegramTizen/src/server_requests.c +++ b/TelegramTizen/src/server_requests.c @@ -1114,6 +1114,59 @@ void send_set_profile_pic_request(service_client* service_client, int user_id, c bundle_free(msg); } +void send_update_display_name_request(service_client* service_client, int user_id, const char* first_name, const char* last_name) +{ + bundle *msg; + char tmp[50]; + int result; + + if (!service_client || !first_name || !last_name) { + // error + return; + } + + msg = bundle_create(); + if (!msg) { + return; + } + + if (bundle_add_str(msg, "app_name", "Tizen Telegram") != 0) { + ERR("Failed to add data by key to bundle"); + bundle_free(msg); + return; + } + + if (bundle_add_str(msg, "command", "update_display_name_request") != 0) { + ERR("Failed to add data by key to bundle"); + bundle_free(msg); + return; + } + + snprintf(tmp, sizeof(tmp) - 1, "%d", user_id); + + if (bundle_add_str(msg, "buddy_id", tmp) != 0) { + ERR("Failed to add data by key to bundle"); + bundle_free(msg); + } + + if (bundle_add_str(msg, "first_name", first_name) != 0) { + ERR("Failed to add data by key to bundle"); + bundle_free(msg); + } + + if (bundle_add_str(msg, "last_name", last_name) != 0) { + ERR("Failed to add data by key to bundle"); + bundle_free(msg); + } + + result = service_client_send_message(service_client, msg); + if(result != SVC_RES_OK) { + // error + } + bundle_free(msg); +} + + void send_set_username_request(service_client* service_client, int user_id, const char* username) { bundle *msg; diff --git a/TelegramTizen/src/telegramtizen.c b/TelegramTizen/src/telegramtizen.c index a2d5c8c..77b5d02 100644 --- a/TelegramTizen/src/telegramtizen.c +++ b/TelegramTizen/src/telegramtizen.c @@ -14,6 +14,7 @@ #include "ucol.h" #include #include +#include "tg_settings_view.h" static void popup_block_clicked_cb(void *data, Evas_Object *obj, void *event_info) { @@ -389,15 +390,17 @@ void load_main_list_data(appdata_s *ad) tgl_media_s *media_msg = NULL; media_msg = get_media_details_from_db(atoll(msg->media_id)); -/* if (msg->message && strlen(msg->message) > 0) { - item->last_message = strdup(msg->message); + if (media_msg && media_msg->doc_type) { + item->last_message = strdup(media_msg->doc_type); + free_media_details(media_msg); } else { - item->last_message = strdup("Document"); - }*/ - - item->last_message = strdup(media_msg->doc_type); + if (msg->message && strlen(msg->message) > 0) { + item->last_message = strdup(msg->message); + } else { + item->last_message = strdup("Document"); + } + } - free_media_details(media_msg); } else if(media_type == tgl_message_media_geo) { item->last_message = strdup("Geo location"); } else if(media_type == tgl_message_media_contact) { @@ -2014,6 +2017,63 @@ static int _on_service_client_msg_received_cb(void *data, bundle *const rec_msg) } } } + } else if (strcmp(rec_key_val, "self_profile_name_updated") == 0) { + + Eina_Bool is_success = EINA_FALSE; + char *is_success_val = NULL; + result = bundle_get_str(rec_msg, "is_success", &is_success_val); + if (strncmp("true", is_success_val, strlen("true")) == 0) { + is_success = EINA_TRUE; + show_toast(app, "Username updated successfully."); + } else { + is_success = EINA_FALSE; + show_toast(app, "Username not updated. Username already exist or please check your network connection."); + } + + if (is_success) { + + char *first_name = NULL; + result = bundle_get_str(rec_msg, "first_name", &first_name); + if (!first_name) { + first_name = ""; + } + + char *last_name = NULL; + result = bundle_get_str(rec_msg, "last_name", &last_name); + if (!last_name) { + last_name = ""; + } + + if (app->current_user_data->first_name) { + free(app->current_user_data->first_name); + app->current_user_data->first_name = NULL; + } + + if (app->current_user_data->last_name) { + free(app->current_user_data->last_name); + app->current_user_data->last_name = NULL; + } + + if (first_name) { + app->current_user_data->first_name = strdup(first_name); + } + + if (last_name) { + app->current_user_data->last_name = strdup(last_name); + } + + if (app->current_app_state == TG_SETTINGS_EDIT_NAME_STATE) { + appdata_s* ad = data; + elm_naviframe_item_pop(ad->nf); + ad->current_app_state = TG_SETTINGS_SCREEN_STATE; + refresh_settings_screen(ad); + } + + } else { + + } + hide_loading_popup(app); + } else if (strcmp(rec_key_val, "self_username_updated") == 0) { Eina_Bool is_success = EINA_FALSE; @@ -2740,6 +2800,11 @@ void app_nf_back_cb(void *data, Evas_Object *obj, void *event_info) //evas_object_show(ad->panel); //elm_panel_hidden_set(ad->panel, EINA_FALSE); break; + case TG_SETTINGS_EDIT_NAME_STATE: + elm_naviframe_item_pop(ad->nf); + ad->current_app_state = TG_SETTINGS_SCREEN_STATE; + delete_floating_button(ad); + break; case TG_REGISTRATION_STATE: elm_win_lower(ad->win); elm_exit(); diff --git a/TelegramTizen/src/tg_edit_name_view.c b/TelegramTizen/src/tg_edit_name_view.c index 479fd1a..77075c6 100644 --- a/TelegramTizen/src/tg_edit_name_view.c +++ b/TelegramTizen/src/tg_edit_name_view.c @@ -7,7 +7,7 @@ #include "tg_edit_name_view.h" - +#include "server_requests.h" static void on_first_name_change_enable_ok_button(void *data, Evas_Object *obj, void *event_info) @@ -29,8 +29,9 @@ static void on_first_name_change_enable_ok_button(void *data, Evas_Object *obj, static void on_naviframe_cancel_clicked(void *data, Evas_Object *obj, void *event_info) { appdata_s* ad = data; - elm_naviframe_item_pop(ad->nf); + ad->current_app_state = TG_SETTINGS_SCREEN_STATE; + delete_floating_button(ad); } static void on_name_entry_done_clicked(void *data, Evas_Object *obj, void *event_info) @@ -52,8 +53,11 @@ static void on_name_entry_done_clicked(void *data, Evas_Object *obj, void *event /* FIXME : Write the request for edit name */ + send_update_display_name_request(ad->service_client, ad->current_user_data->user_id.id, first_name, last_name); + free(first_name); free(last_name); + show_loading_popup(ad); } void launch_editname_screen(appdata_s* ad) @@ -63,7 +67,7 @@ void launch_editname_screen(appdata_s* ad) return; } - //ad->current_app_state = TG_SETTINGS_SCREEN_STATE; + ad->current_app_state = TG_SETTINGS_EDIT_NAME_STATE; char edj_path[PATH_MAX] = {0, }; app_get_resource(TELEGRAM_INIT_VIEW_EDJ, edj_path, (int)PATH_MAX); diff --git a/TelegramTizen/src/tg_settings_view.c b/TelegramTizen/src/tg_settings_view.c index 7065aaa..1a53de4 100644 --- a/TelegramTizen/src/tg_settings_view.c +++ b/TelegramTizen/src/tg_settings_view.c @@ -681,11 +681,18 @@ char* _text_requested_cb(void *data, Evas_Object *obj, const char *part) int id = (int) data; appdata_s* ad = evas_object_data_get(obj, "app_data"); - + char *user_name = NULL; if (!strcmp(part,"elm.text.main.left.top") || !strcmp(part,"elm.text")){ switch(id) { case 0: - return replace(ad->current_user_data->print_name, '_', " "); + //return replace(ad->current_user_data->print_name, '_', " "); + + user_name = (char*)malloc(strlen(ad->current_user_data->first_name) + strlen(" ") + strlen(ad->current_user_data->last_name) + 1); + strcpy(user_name, ad->current_user_data->first_name); + strcat(user_name, " "); + strcat(user_name, ad->current_user_data->last_name); + return user_name; + case 1: return strdup(i18n_get_text("IDS_TGRAM_OPT_SET_BACKGROUND_IMAGE_ABB")); default: @@ -940,6 +947,16 @@ static Eina_Bool _pop_cb(void *data, Elm_Object_Item *it) return EINA_TRUE; } +void refresh_settings_screen(appdata_s* ad) +{ + if (!ad) + return; + Evas_Object *list = evas_object_data_get(ad->nf, "settings_list"); + if (list) { + elm_genlist_realized_items_update(list); + } +} + void launch_settings_screen(appdata_s* ad) { if (!ad) { @@ -962,6 +979,8 @@ void launch_settings_screen(appdata_s* ad) evas_object_data_set(list, "app_data", ad); + evas_object_data_set(ad->nf, "settings_list", list); + itc.item_style = "type1"; itc.func.text_get = _text_requested_cb; itc.func.content_get = _content_requested_cb; diff --git a/TelegramTizen/src/tg_user_main_view.c b/TelegramTizen/src/tg_user_main_view.c index d07a50c..05680ca 100644 --- a/TelegramTizen/src/tg_user_main_view.c +++ b/TelegramTizen/src/tg_user_main_view.c @@ -346,7 +346,7 @@ void on_chat_long_press_option_selected_cb(void *data, Evas_Object *obj, void *e free(tablename); //change item in list - sel_item->last_message = strdup(" "); + sel_item->last_message = strdup(""); sel_item->last_msg_id = -1; sel_item->last_msg_type = -1; sel_item->is_out_msg = -1; @@ -383,6 +383,7 @@ void on_chat_long_press_option_selected_cb(void *data, Evas_Object *obj, void *e elm_object_text_set(sel_item->date_lbl,time_str); } } +#if 0 if (sel_item->msg_status_lbl) { Evas_Object* temp_lbl = elm_object_part_content_get(sel_item->msg_status_lbl, "swallow.status"); if (temp_lbl) { @@ -396,6 +397,11 @@ void on_chat_long_press_option_selected_cb(void *data, Evas_Object *obj, void *e evas_object_show(num_lbl); elm_object_part_content_set(sel_item->msg_status_lbl, "swallow.status", num_lbl); } +#endif + Evas_Object *buddy_list = evas_object_data_get(ad->nf, "buddy_list"); + if (buddy_list) { + elm_genlist_realized_items_update(buddy_list); + } } else { @@ -653,7 +659,7 @@ Evas_Object* on_chat_item_load_requested(void *data, Evas_Object *obj, const cha evas_object_show(layout); Evas_Object* item_layout = elm_layout_add(ad->nf); if (ad->target_direction == TELEGRAM_TARGET_DIRECTION_LANDSCAPE_INVERSE || ad->target_direction == TELEGRAM_TARGET_DIRECTION_LANDSCAPE) { - if ((item->last_message == NULL) || (strlen(item->last_message) <= 0) || (strcmp(item->last_message, " ") == 0) || (item->number_of_unread_msgs == 0 &&(!item->is_out_msg || !item->last_msg_service))) { + if ((item->last_message == NULL) || (strlen(item->last_message) <= 0) || (strcmp(item->last_message, " ") == 0)) { elm_layout_file_set(item_layout, edj_path, "main_list_custom_no_msg_item_land"); is_empty_msg = EINA_TRUE; } else { @@ -664,7 +670,7 @@ Evas_Object* on_chat_item_load_requested(void *data, Evas_Object *obj, const cha } } } else { - if ((item->last_message == NULL) || (strlen(item->last_message) <= 0) || (strcmp(item->last_message, " ") == 0) || (item->number_of_unread_msgs == 0 &&(!item->is_out_msg || !item->last_msg_service))) { + if ((item->last_message == NULL) || (strlen(item->last_message) <= 0) || (strcmp(item->last_message, " ") == 0)) { elm_layout_file_set(item_layout, edj_path, "main_list_custom_no_msg_item"); is_empty_msg = EINA_TRUE; } else { @@ -734,7 +740,7 @@ Evas_Object* on_chat_item_load_requested(void *data, Evas_Object *obj, const cha /*************************** user name ***************************************/ #if 0 - char* user_name = replace(item->peer_print_name, '_', ""); + char* user_name = replace(item->peer_print_name, '_', " "); #endif char buf[512] = {'\0'}; snprintf(buf, 512, "%s", item->buddy_display_name); @@ -1125,7 +1131,7 @@ static void ctxpopup_search_select_cb(void *data, Evas_Object *obj, void *event_ LOGE("ad is NULL"); return; } - + delete_floating_button(ad); _ctxpopup_dismiss_cb(ad, NULL, NULL); /* please input here when search menu is clicked */ diff --git a/TelegramTizen/tg_utils/tg_common.c b/TelegramTizen/tg_utils/tg_common.c index 55508d0..68302ae 100644 --- a/TelegramTizen/tg_utils/tg_common.c +++ b/TelegramTizen/tg_utils/tg_common.c @@ -465,7 +465,8 @@ void create_floating_button(appdata_s* ad) return; Evas_Object *icon = elm_image_add(ad->nf); - elm_image_file_set(icon, ui_utils_get_resource(TG_ICON_FLOATING_PENCIL), NULL); + + // elm_image_file_set(icon, ui_utils_get_resource(TG_ICON_FLOATING_PENCIL), NULL); evas_object_show(icon); ad->floating_btn = eext_floatingbutton_add(ad->layout); evas_object_color_set(ad->floating_btn, 255, 255, 255, 255); @@ -478,6 +479,7 @@ void create_floating_button(appdata_s* ad) elm_object_part_content_set(btn, "icon", icon); evas_object_data_set(ad->floating_btn, "image", icon); + update_floating_button(ad, ad->current_app_state); } void delete_floating_button(appdata_s* ad) @@ -486,7 +488,9 @@ void delete_floating_button(appdata_s* ad) return; if (ad->floating_btn){ - elm_layout_signal_emit(ad->floating_btn, "elm,state,floatingbutton,hidden", "elm"); + //elm_layout_signal_emit(ad->floating_btn, "elm,state,floatingbutton,hidden", "elm"); + evas_object_del(ad->floating_btn); + ad->floating_btn = NULL; } } @@ -494,11 +498,16 @@ void show_floating_button(appdata_s* ad) { if (!ad) return; - +#if 0 if (ad->floating_btn){ update_floating_button(ad, ad->current_app_state); elm_layout_signal_emit(ad->floating_btn, "elm,state,floatingbutton,visible", "elm"); } +#else + delete_floating_button(ad); + create_floating_button(ad); +#endif + } void update_floating_button(appdata_s* ad, int mode) diff --git a/TelegramTizen/tg_utils/tg_common.h b/TelegramTizen/tg_utils/tg_common.h index 484cb24..bb0f425 100644 --- a/TelegramTizen/tg_utils/tg_common.h +++ b/TelegramTizen/tg_utils/tg_common.h @@ -296,6 +296,7 @@ typedef enum state_of_app { TG_CHAT_MESSAGING_VIEW_STATE, TG_PEER_SEARCH_VIEW_STATE, TG_SETTINGS_SCREEN_STATE, + TG_SETTINGS_EDIT_NAME_STATE, TG_SET_USERNAME_STATE, TG_SET_USER_INFO_STATE, TG_SET_CHAT_INFO_STATE, diff --git a/tg-engine-service/inc/server_response.h b/tg-engine-service/inc/server_response.h index d5fc258..2ec926e 100644 --- a/tg-engine-service/inc/server_response.h +++ b/tg-engine-service/inc/server_response.h @@ -31,6 +31,7 @@ extern void process_add_new_buddy_to_chat_command(tg_engine_data_s *tg_data, int extern void process_remove_buddy_from_chat_command(tg_engine_data_s *tg_data, int s_buddy_id, int s_chat_id); extern void process_set_group_chat_profile_pic_command(tg_engine_data_s *tg_data, int buddy_id, const char *file_path); extern void process_set_username_command(tg_engine_data_s *tg_data, int buddy_id, const char *username); +extern void process_update_display_name_command(tg_engine_data_s *tg_data, int buddy_id, const char *first_name, const char *last_name); extern void send_add_contacts_request(tg_engine_data_s *tg_data); extern void send_registration_response(tg_engine_data_s *tg_data, Eina_Bool is_success); @@ -66,5 +67,6 @@ extern void send_group_chat_new_buddy_response(tg_engine_data_s *tg_data, int pe extern void send_group_chat_delete_buddy_response(tg_engine_data_s *tg_data, int peer_id, Eina_Bool is_success); extern void send_response_for_server_connection_status(tg_engine_data_s *tg_data, Eina_Bool connection_status); +extern void send_self_profile_name_updated_response(tg_engine_data_s *tg_data, char *first_name, char *last_name, Eina_Bool is_success); extern void send_response_to_group_chat_updated_response(tg_engine_data_s *tg_data, int chat_id); #endif /* SERVER_RESPONSE_H_ */ diff --git a/tg-engine-service/inc/tg_db_wrapper.h b/tg-engine-service/inc/tg_db_wrapper.h index bb08845..8d8645e 100644 --- a/tg-engine-service/inc/tg_db_wrapper.h +++ b/tg-engine-service/inc/tg_db_wrapper.h @@ -262,6 +262,7 @@ void update_buddy_delete_db(char* table_name, int id, int delete_item); Eina_List* get_all_peer_ids(); int get_number_of_unread_messages(); int get_unread_message_count(char* table_name); +int get_number_of_messages(char* table_name); Eina_List* get_all_unsent_media_messages(); Eina_List* get_all_unsent_text_messages(); @@ -272,4 +273,6 @@ Eina_Bool is_user_present_chat_table(int id); int update_current_date_to_table(char* tb_name, int recent_msg_date); +int set_date_item_to_table(char* tb_name, int recent_msg_date); + #endif /* TG_DB_WRAPPER_H_ */ diff --git a/tg-engine-service/src/server_response.c b/tg-engine-service/src/server_response.c index c2762fc..c33126a 100644 --- a/tg-engine-service/src/server_response.c +++ b/tg-engine-service/src/server_response.c @@ -177,6 +177,11 @@ void process_set_profile_pic_command(tg_engine_data_s *tg_data, int buddy_id, co set_profile_picture(tg_data, buddy_id, file_path); } +void process_update_display_name_command(tg_engine_data_s *tg_data, int buddy_id, const char *first_name, const char *last_name) +{ + update_user_display_name(tg_data, buddy_id, first_name, last_name); +} + void process_set_username_command(tg_engine_data_s *tg_data, int buddy_id, const char *username) { set_user_name(tg_data, buddy_id, username); @@ -457,6 +462,51 @@ void send_contacts_and_chats_load_done_response(tg_engine_data_s *tg_data, Eina_ bundle_free(msg); } +void send_self_profile_name_updated_response(tg_engine_data_s *tg_data, char *first_name, char *last_name, Eina_Bool is_success) +{ + bundle *msg = bundle_create(); + if (bundle_add_str(msg, "app_name", "Tizen Telegram") != 0) { + ERR("Failed to add data by key to bundle"); + bundle_free(msg); + } + + if (bundle_add_str(msg, "command", "self_profile_name_updated") != 0) { + ERR("Failed to add data by key to bundle"); + bundle_free(msg); + } + + if (bundle_add_str(msg, "first_name", first_name) != 0) { + ERR("Failed to add data by key to bundle"); + bundle_free(msg); + } + + if (bundle_add_str(msg, "last_name", last_name) != 0) { + ERR("Failed to add data by key to bundle"); + bundle_free(msg); + } + + if (is_success) { + if (bundle_add_str(msg, "is_success", "true") != 0) { + ERR("Failed to add data by key to bundle"); + bundle_free(msg); + } + } else { + if (bundle_add_str(msg, "is_success", "false") != 0) { + ERR("Failed to add data by key to bundle"); + bundle_free(msg); + } + } + + int result = SVC_RES_FAIL; + result = tg_server_send_message(tg_data->tg_server, msg); + + if(result != SVC_RES_OK) { + // error: cient not ready + } + bundle_free(msg); +} + + void send_self_user_name_updated_response(tg_engine_data_s *tg_data, char *username, Eina_Bool is_success) { bundle *msg = bundle_create(); diff --git a/tg-engine-service/src/tg-engine-service.c b/tg-engine-service/src/tg-engine-service.c index f7fecdf..29a9ea4 100644 --- a/tg-engine-service/src/tg-engine-service.c +++ b/tg-engine-service/src/tg-engine-service.c @@ -374,6 +374,25 @@ static int _on_tg_server_msg_received_cb(void *data, bundle *const rec_msg) char *file_path = NULL; res = bundle_get_str(rec_msg, "file_path", &file_path); process_set_profile_pic_command(tg_data, buddy_id, file_path); + + } else if (strcmp(cmd_key_val, "update_display_name_request") == 0) { + + char *buddy_id_str = NULL; + res = bundle_get_str(rec_msg, "buddy_id", &buddy_id_str); + + int buddy_id = 0; + if (buddy_id_str) { + buddy_id = atoi(buddy_id_str); + } + + char *first_name = NULL; + res = bundle_get_str(rec_msg, "first_name", &first_name); + + char *last_name = NULL; + res = bundle_get_str(rec_msg, "last_name", &last_name); + + process_update_display_name_command(tg_data, buddy_id, first_name, last_name); + } else if (strcmp(cmd_key_val, "set_username_request") == 0) { char *buddy_id_str = NULL; diff --git a/tg-engine-service/src/tg_db_wrapper.c b/tg-engine-service/src/tg_db_wrapper.c index bdd6660..afe1187 100644 --- a/tg-engine-service/src/tg_db_wrapper.c +++ b/tg-engine-service/src/tg_db_wrapper.c @@ -690,6 +690,95 @@ void create_buddy_msg_table(const char* table_name) eina_list_free(col_types); } + +int set_date_item_to_table(char* tb_name, int recent_msg_date) +{ + struct tgl_message* last_msg = get_latest_message_from_message_table(tb_name); + if (last_msg) { + int old_date = last_msg->date; + time_t old_t = old_date; + + struct tm old_lt; + (void) localtime_r(&old_t, &old_lt); + + + int cur_time = recent_msg_date; + time_t new_t = cur_time; + + struct tm new_lt; + (void) localtime_r(&new_t, &new_lt); + + if (old_lt.tm_mday == new_lt.tm_mday && old_lt.tm_mon == new_lt.tm_mon && old_lt.tm_year == new_lt.tm_year) { + // no need of new date + return -1; + } else { + int cur_time = recent_msg_date; + time_t t = cur_time; + + char *format = NULL; + format = "%a, %d%b. %Y"; + + struct tm lt; + char res[256]; + (void) localtime_r(&t, <); + + if (strftime(res, sizeof(res), format, <) == 0) { + (void) fprintf(stderr, "strftime(3): cannot format supplied " + "date/time into buffer of size %u " + "using: '%s'\n", + sizeof(res), format); + } + + srand(time(NULL)); + int r = rand(); + struct tgl_message date_msg; + date_msg.id = r; + date_msg.media.type = tgl_message_media_none; + date_msg.date = recent_msg_date - 1; + date_msg.message = res; + date_msg.message_len = strlen(res); + date_msg.service = 2; + date_msg.unread = 0; + date_msg.out = 0; + insert_msg_into_db(&date_msg, tb_name, t); + return date_msg.id; + } + + } else { + int cur_time = recent_msg_date; + time_t t = cur_time; + + char *format = NULL; + format = "%a, %d%b. %Y"; + + struct tm lt; + char res[256]; + (void) localtime_r(&t, <); + + if (strftime(res, sizeof(res), format, <) == 0) { + (void) fprintf(stderr, "strftime(3): cannot format supplied " + "date/time into buffer of size %u " + "using: '%s'\n", + sizeof(res), format); + } + srand(time(NULL)); + int r = rand(); + struct tgl_message date_msg; + date_msg.id = r; + date_msg.media.type = tgl_message_media_none; + date_msg.date = recent_msg_date - 1; + date_msg.message = res; + date_msg.message_len = strlen(res); + date_msg.service = 2; + date_msg.unread = 0; + date_msg.out = 0; + insert_msg_into_db(&date_msg, tb_name, t); + return date_msg.id; + } + return -1; +} + + int update_current_date_to_table(char* tb_name, int recent_msg_date) { struct tgl_message* last_msg = get_latest_message_from_message_table(tb_name); @@ -4860,6 +4949,18 @@ int get_unread_message_count(char* table_name) return num_of_rows; } +int get_number_of_messages(char* table_name) +{ + // number of rows, having out == 1 and unread == 0 + if (!table_name) { + return 0; + } + int num_of_rows = 0; + num_of_rows = get_number_of_rows(table_name, NULL); + return num_of_rows; +} + + Eina_List* get_all_peer_ids() { Eina_List* peer_details = NULL; @@ -4909,7 +5010,7 @@ Eina_Bool is_user_present_peer_table(int peer_id) Eina_Bool ret = EINA_FALSE; Eina_List* peer_details = NULL; - char* table_name = BUDDY_INFO_TABLE_NAME; + char* table_name = PEER_INFO_TABLE_NAME; Eina_List* col_names = NULL; col_names = eina_list_append(col_names, USER_INFO_TABLE_PRINT_NAME); diff --git a/tg-engine-service/tg_engine/tg_engine.c b/tg-engine-service/tg_engine/tg_engine.c index 806d852..2922b39 100644 --- a/tg-engine-service/tg_engine/tg_engine.c +++ b/tg-engine-service/tg_engine/tg_engine.c @@ -831,6 +831,10 @@ void tg_chat_update(struct tgl_state *TLS, struct tgl_chat* chat_info, unsigned tg_engine_data_s *tg_data; tg_data = TLS->callback_data; + if (chat_info && chat_info->flags == 144) { + return; + } + if (flags == TGL_GROUP_CHAT_CREATED) { #if 0 insert_chat_info_to_db(chat_info, NULL); @@ -1714,8 +1718,45 @@ void on_chat_info_received(struct tgl_state *TLS, void *callback_extra, int succ if (!chat_info) { return; } + if (chat_info->flags == 144) { + return; + } msg_table = get_table_name_from_number(chat_info->id.id); create_buddy_msg_table(msg_table); + + int msg_count = get_number_of_messages(msg_table); + if (msg_count <= 0) { + if (chat_info->admin_id > 0) { + set_date_item_to_table(msg_table, chat_info->date); + tgl_peer_id_t admin_id; + admin_id.id = chat_info->admin_id; + admin_id.type = TGL_PEER_USER; + + tgl_peer_t* UC = tgl_peer_get(TLS, admin_id); + int msg_len = strlen(UC->user.first_name) + strlen(" created the group") + 1; + char* creator_name = (char*)malloc(msg_len); + strcpy(creator_name, UC->user.first_name); + strcat(creator_name, " created the group"); + struct tgl_message msg; + int cur_time = chat_info->date; + msg.to_id = chat_info->id; + msg.from_id = admin_id; + msg.id = cur_time; + msg.message = creator_name; + msg.message_len = msg_len; + msg.unread = 0; + msg.date = cur_time; + msg.media.type = tgl_message_media_none; + msg.service = 1; + msg.out = 0; + + insert_buddy_msg_to_db(&msg); + free(creator_name); + send_message_received_response(TLS->callback_data, msg.from_id.id, msg.to_id.id, msg.id, tgl_get_peer_type(msg.to_id)); + } + + } + free(msg_table); if (!chat_info->user_list) { tgl_do_get_chat_info(TLS, chat_info->id, 0, &on_chat_info_received, NULL); @@ -2433,6 +2474,26 @@ void set_user_name(tg_engine_data_s *tg_data, int buddy_id, const char *username } } +void on_profile_name_changed(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_user *buddy) +{ + tg_engine_data_s *tg_data = callback_extra; + if (success) { + // update db + update_buddy_into_db(USER_INFO_TABLE_NAME, buddy); + update_buddy_into_db(BUDDY_INFO_TABLE_NAME, buddy); + send_self_profile_name_updated_response(tg_data, buddy->first_name, buddy->last_name, EINA_TRUE); + } else { + send_self_profile_name_updated_response(tg_data, "", "", EINA_FALSE); + } +} + +void update_user_display_name(tg_engine_data_s *tg_data, int buddy_id, const char *first_name, const char *last_name) +{ + if (first_name && last_name) { + tgl_do_set_profile_name(tgl_engine_get_TLS(), first_name, last_name, on_profile_name_changed, tg_data); + } +} + void create_new_group(tg_engine_data_s *tg_data, Eina_List* buddy_ids, const char *group_name, const char *group_icon) { diff --git a/tg-engine-service/tg_engine/tg_engine.h b/tg-engine-service/tg_engine/tg_engine.h index 5e25f65..33438c9 100644 --- a/tg-engine-service/tg_engine/tg_engine.h +++ b/tg-engine-service/tg_engine/tg_engine.h @@ -169,6 +169,7 @@ extern void add_contacts_to_user(tg_engine_data_s *tg_data, int size, Eina_List* extern void create_new_group(tg_engine_data_s *tg_data, Eina_List* buddy_ids, const char* group_name, const char* group_icon); extern void set_profile_picture(tg_engine_data_s *tg_data, int buddy_id, const char *file_path); extern void set_user_name(tg_engine_data_s *tg_data, int buddy_id, const char *username); +extern void update_user_display_name(tg_engine_data_s *tg_data, int buddy_id, const char *first_name, const char *last_name); extern void request_for_code_via_call(struct tgl_state *TLS, char* phone_no, Eina_Bool trough_sms); extern void free_contact_data(Eina_List *contact_data); extern void leave_group_chat(tg_engine_data_s *tg_data, int group_chat_id); -- 2.7.4 From 1c5bedb76a073d0c86a98056717c6d7b1d8631ca Mon Sep 17 00:00:00 2001 From: "polu.sandeep" Date: Wed, 28 Oct 2015 16:50:39 +0900 Subject: [PATCH 16/16] Implemented native contact interface. Change-Id: I85342896f125c6c31a63dbc27ed9062c6e7da373 --- TelegramTizen/.cproject | 195 ++++++++++++++++++++- TelegramTizen/contacts_utils/contacts-db-utils.c | 101 +++++++++++ TelegramTizen/contacts_utils/contacts-db-utils.h | 47 +++++ TelegramTizen/contacts_utils/contacts-list-utils.c | 140 +++++++++++++++ TelegramTizen/contacts_utils/contacts-list-utils.h | 71 ++++++++ .../contacts_utils/contacts-record-utils.c | 104 +++++++++++ .../contacts_utils/contacts-record-utils.h | 79 +++++++++ TelegramTizen/contacts_utils/contacts_common.c | 159 +++++++++++++++++ TelegramTizen/contacts_utils/contacts_common.h | 83 +++++++++ .../contacts_utils/device_contacts_manager.c | 191 ++++++++++++++++++++ .../contacts_utils/device_contacts_manager.h | 34 ++++ TelegramTizen/src/telegramtizen.c | 15 +- TelegramTizen/src/tg_search_peer_view.c | 149 +++++++++++++++- TelegramTizen/tg_utils/tg_common.h | 1 + 14 files changed, 1358 insertions(+), 11 deletions(-) create mode 100644 TelegramTizen/contacts_utils/contacts-db-utils.c create mode 100644 TelegramTizen/contacts_utils/contacts-db-utils.h create mode 100644 TelegramTizen/contacts_utils/contacts-list-utils.c create mode 100644 TelegramTizen/contacts_utils/contacts-list-utils.h create mode 100644 TelegramTizen/contacts_utils/contacts-record-utils.c create mode 100644 TelegramTizen/contacts_utils/contacts-record-utils.h create mode 100644 TelegramTizen/contacts_utils/contacts_common.c create mode 100644 TelegramTizen/contacts_utils/contacts_common.h create mode 100644 TelegramTizen/contacts_utils/device_contacts_manager.c create mode 100644 TelegramTizen/contacts_utils/device_contacts_manager.h diff --git a/TelegramTizen/.cproject b/TelegramTizen/.cproject index 2b1d20b..4cdbb91 100644 --- a/TelegramTizen/.cproject +++ b/TelegramTizen/.cproject @@ -32,7 +32,86 @@ -