type: SWALLOW;
description {
state: default 0.0;
- rel1.relative: 0.1 0.4;
- rel2.relative: 0.9 0.6;
+ rel1.relative: 0.5 0.5;
+ rel2.relative: 0.5 0.5;
+ min: 100 100;
}
}
}
color: 255 255 255 255;
}
}
+ part {
+ name: "left,pad";
+ type: SPACER;
+ description {
+ state: "default" 0.0;
+ rel1 { relative: 0.0 0.0; }
+ rel2 { relative: 0.0 1.0; }
+ min: 32 0;
+ align: 0.0 0.5;
+ }
+ }
part{
name: "swallow.phone_type";
type: SWALLOW;
description{
state: "default" 0.0;
- rel1 { relative: 0.0 0.0; }
+ rel1 { relative: 1.0 0.1; to: "left,pad"; }
rel2 { relative: 0.65 0.5; }
color: 0 0 0 0;
}
type: SWALLOW;
description{
state: "default" 0.0;
- rel1 { relative: 0.0 0.5; }
- rel2 { relative: 0.65 1.0; }
+ rel1 { relative: 1.0 0.5; to: "left,pad"; }
+ rel2 { relative: 0.65 0.9; }
color: 0 0 0 0;
}
}
part{
- name: "swallow.phone_msg";
+ name: "swallow.phone_call";
type: SWALLOW;
description{
state: "default" 0.0;
}
}
part{
- name: "swallow.phone_call";
+ name: "swallow.phone_msg";
type: SWALLOW;
description{
state: "default" 0.0;
description{
state: "default" 0.0;
rel1 { relative: 0.0 0.0; }
- rel2 { relative: 1.0 0.4; }
- color: 255 0 0 255;
+ rel2 { relative: 1.0 0.0; }
+ align: 0.5 0.0;
+ min: 0 440;
}
}
part{
type: SWALLOW;
description{
state: "default" 0.0;
- rel1 { relative: 0.0 0.4; }
- rel2 { relative: 1.0 0.5; }
- color: 0 255 0 255;
+ rel1 { relative: 0.0 1.0; to_y: "swallow.profile_pic"; }
+ rel2 { relative: 1.0 1.0; to_y: "swallow.profile_pic"; }
+ align: 0.5 0.0;
+ min: 0 150;
}
}
}
}
- if (id == 0) {
+ if (id == 1) { // Clear history
if (user_data->peer_type == TGL_PEER_USER || user_data->peer_type == TGL_PEER_CHAT) {
#if 0
}
- } else if (id == 1) {
+ } else if (id == 2) { //Delete
if (user_data->peer_type == TGL_PEER_USER) {
char* tablename = get_table_name_from_number(user_data->peer_id);
delete_all_records(tablename);
} else {
}
+ } else if (id == 0) { // View profile
+ launch_user_info_screen(ad, user_data->peer_id);
} else {
-
}
if (ad->msg_popup) {
evas_object_del(ad->msg_popup);
{
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_DELETE"));
}
}
tg_peer_info_s *user_data = sel_item->use_data;
if ((user_data->peer_type == TGL_PEER_USER) && get_buddy_unknown_status(user_data->peer_id)) {
if (id == 0) {
- return strdup("Add to contacts");
+ return strdup(i18n_get_text("IDS_TGRAM_OPT_ADD_TO_CONTACTS_ABB2"));
} else if (id == 1) {
- 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"));
}
} else {
if (id == 0) {
- return strdup("Clear history");
+ return strdup(i18n_get_text("IDS_TGRAM_OPT_VIEW_PROFILE_ABB"));
+ }
+ else if (id == 1) {
+ return strdup(i18n_get_text("IDS_TGRAM_OPT_CLEAR_HISTORY_ABB3"));
} else {
- return strdup("Delete");
+ return strdup(i18n_get_text("IDS_TGRAM_OPT_DELETE"));
}
}
}
itc.func.state_get = NULL;
itc.func.del = NULL;
- tg_peer_info_s *user_data = sel_item->use_data;
- if ((user_data->peer_type == TGL_PEER_USER) && get_buddy_unknown_status(user_data->peer_id)) {
- for (i = 0; i < 3; i++) {
+ if (sel_item->use_data->peer_type == TGL_PEER_CHAT) {
+ for (i = 0; i < 2; i++) {
elm_genlist_item_append(genlist, &itc, (void *) i, NULL, ELM_GENLIST_ITEM_NONE, on_messaging_menu_option_selected_cb, ad);
}
} else {
- for (i = 0; i < 2; i++) {
+ for (i = 0; i < 3; i++) {
elm_genlist_item_append(genlist, &itc, (void *) i, NULL, ELM_GENLIST_ITEM_NONE, on_messaging_menu_option_selected_cb, ad);
}
}
if (msg->media_type == tgl_message_media_none) {
char *temp_msg = replace(msg->message, '\n', "<br>");
eina_strbuf_append(buf, temp_msg);
- LOGD("!!!!!! message: %s", eina_strbuf_string_get(buf));
elm_entry_entry_set(entry, eina_strbuf_string_get(buf));
eina_strbuf_free(buf);
elm_object_part_content_set(entry, "status_icon", status_obj);
evas_object_show(status_obj);
- LOGD("!!!!!! entry: %p", entry);
evas_object_event_callback_add(entry, EVAS_CALLBACK_RESIZE, __resize_cb, "entry");
evas_object_event_callback_add(entry, EVAS_CALLBACK_CHANGED_SIZE_HINTS, __hint_cb, "HINT : entry");
app_control_destroy(app_control);
}
+static void compare_with_current_date(int rtime, Elm_Object_Item *nf_it)
+{
+ char time_str[256]={0,};
+ time_t local_t = time(NULL);
+ int diff_sec = 0;
+ int diff_min = 0;
+ int diff_hour = 0;
+ int diff_day = 0;
+
+ diff_sec = local_t - rtime;
+ diff_min = diff_sec / 60;
+ diff_hour = diff_min / 60;
+ diff_day = diff_hour / 24;
+ LOGD("different : day : %d, hour = %d, min = %d, sec = %d", diff_day, diff_hour, diff_min, diff_sec);
+
+
+ if (diff_day > 30) {
+ snprintf(time_str, sizeof(time_str) - 1, "%s", i18n_get_text("IDS_TGRAM_HEADER_LAST_SEEN_LONG_TIME_AGO_ABB"));
+ goto OUT;
+ }
+
+ if (diff_day > 7) {
+ snprintf(time_str, sizeof(time_str) - 1, "%s", i18n_get_text("IDS_TGRAM_HEADER_LAST_SEEN_WITHIN_A_MONTH_ABB"));
+ goto OUT;
+ }
+ if (diff_day > 1) {
+ snprintf(time_str, sizeof(time_str) - 1, "%s", i18n_get_text("IDS_TGRAM_HEADER_LAST_SEEN_WITHIN_A_WEEK_ABB"));
+ goto OUT;
+ }
+
+ if (diff_hour > 1) {
+ snprintf(time_str, sizeof(time_str) - 1, i18n_get_text("IDS_TGRAM_HEADER_LAST_SEEN_PD_HOURS_AGO_ABB"), diff_hour);
+ goto OUT;
+ }
+
+ if (diff_hour == 1) {
+ snprintf(time_str, sizeof(time_str) - 1, "%s", i18n_get_text("IDS_TGRAM_HEADER_LAST_SEEN_1_HOUR_AGO_ABB"));
+ goto OUT;
+ }
+ if (diff_min > 1) {
+ snprintf(time_str, sizeof(time_str) - 1, i18n_get_text("IDS_TGRAM_HEADER_LAST_SEEN_PD_MINUTES_AGO_ABB"), diff_min);
+ goto OUT;
+ }
+ if (diff_min == 1) {
+ snprintf(time_str, sizeof(time_str) - 1, "%s", i18n_get_text("IDS_TGRAM_HEADER_LAST_SEEN_1_MINUTE_AGO_ABB"));
+ goto OUT;
+ }
+ snprintf(time_str, sizeof(time_str) - 1, "%s", i18n_get_text("IDS_TGRAM_HEADER_LAST_SEEN_RECENTLY_ABB"));
+
+OUT:
+ elm_object_item_part_text_set(nf_it, "subtitle", time_str);
+}
void launch_user_info_screen(appdata_s* ad, int peer_id)
{
if (is_online > 0) {
elm_object_item_part_text_set(navi_item, "subtitle", i18n_get_text("IDS_TGRAM_SBODY_ONLINE"));
} else {
- time_t t = last_seen;
-
- if (is_today) {
- format = "Last seen %I:%M %p";
- } else {
- format = "Last seen %b %d, %I:%M %P";
- }
-
- 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);
- }
- elm_object_item_part_text_set(navi_item, "subtitle", res);
+ compare_with_current_date(last_seen, navi_item);
}
for (int i = 0 ; i < eina_list_count(buddy_details_array); i++) {
Evas_Object *profile_pic = NULL;
+ Evas_Object *image_layout = NULL;
if (ad->peer_in_cahtting_data->use_data->photo_path && strlen(ad->peer_in_cahtting_data->use_data->photo_path) > 0 && strstr(ad->peer_in_cahtting_data->use_data->photo_path, "_null_") == NULL) {
+
+ evas_object_color_set(profile_pic, 45, 165, 224, 255);
+
+ image_layout = elm_layout_add(ad->nf);
+ elm_layout_file_set(image_layout, edj_path, "contact_image_masking");
+ evas_object_size_hint_weight_set(image_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(image_layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(image_layout);
+
profile_pic = get_image_from_path(ad->peer_in_cahtting_data->use_data->photo_path, ad->nf);
+ evas_object_color_set(profile_pic, 45, 165, 224, 225);
+
+ elm_object_part_content_set(image_layout, "image", profile_pic);
} else {
- profile_pic = get_image_from_path(ui_utils_get_resource(TG_CALLER_ID_IMAGE), ad->nf);
+
evas_object_color_set(profile_pic, 45, 165, 224, 255);
+
+ image_layout = elm_layout_add(ad->nf);
+ elm_layout_file_set(image_layout, edj_path, "contact_image_masking");
+ evas_object_size_hint_weight_set(image_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(image_layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(image_layout);
+
+ profile_pic = get_image_from_path(ui_utils_get_resource(TG_CALLER_ID_IMAGE), ad->nf);
+ evas_object_color_set(profile_pic, 45, 165, 224, 225);
+
+ elm_object_part_content_set(image_layout, "image", profile_pic);
}
- elm_object_part_content_set(layout, "swallow.profile_pic", profile_pic);
+ elm_object_part_content_set(layout, "swallow.profile_pic", image_layout);
/************************* profile pic *******************************************/
Evas_Object *phone_type = elm_label_add(ad->nf);
elm_object_style_set(phone_type, "transparent");
char phone_type_str[256];
- sprintf(phone_type_str, "<font=Tizen:style=Normal color=#A9A9A9 align=left><font_size=35> %s</font_size></font>","Mobile");
+ sprintf(phone_type_str, "<font=Tizen:style=Normal color=#A9A9A9 align=left><font_size=35> %s</font_size></font>",i18n_get_text("IDS_TGRAM_BODY_MOBILE_ABB"));
elm_object_text_set(phone_type, phone_type_str);
evas_object_size_hint_weight_set(phone_type, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(phone_type, EVAS_HINT_FILL, EVAS_HINT_FILL);