[Telegram] Modify the message view and image size in add contact view 71/53371/2
authormoon87.park <moon87.park@samsung.com>
Fri, 4 Dec 2015 08:41:26 +0000 (17:41 +0900)
committermoon87.park <moon87.park@samsung.com>
Fri, 4 Dec 2015 08:43:06 +0000 (17:43 +0900)
Change-Id: If506523d2ac55befd69f5da987202ed016a94e6a

TelegramTizen/res/edje/telegram_init_screen.edc
TelegramTizen/res/edje/telegram_theme.edc
TelegramTizen/src/telegramtizen.c
TelegramTizen/src/tg_db_wrapper.c
TelegramTizen/src/tg_messaging_view.c

index 09aa0a4..0b75fc2 100644 (file)
@@ -1710,7 +1710,7 @@ group
                                rel1 { relative: 0.0 0.0; }
                                rel2 { relative: 1.0 1.0; }
                                min: 0 98;
-                               color: 250 250 250 255;
+                               color: 250 250 250 0;
                                visible: 1;
                        }
                }
@@ -1851,7 +1851,7 @@ group
                                rel1 { relative: 0.0 0.0; }
                                rel2 { relative: 1.0 1.0; }
                                min: 0 89;
-                                       color: 250 250 250 255;
+                                       color: 250 250 250 0;
                        }                       
                }
                part {
@@ -3678,6 +3678,7 @@ group
         parts {
                        PART(SWALLOW, "elm.swallow.bg",
                 description { state: "default" 0.0;
+                min: 0 440;
                   }
                 )
            part {
@@ -3941,5 +3942,4 @@ group
                }
         }
     } // theme
-   
 }
index 9c77e8e..ad4c27e 100644 (file)
@@ -148,8 +148,8 @@ styles {
       tag:  "preedit_sub4" "+ backing=on backing_color="ENTRY_PREEDIT_SUB4_COLOR_INC" underline=on underline_color="ENTRY_PREEDIT_UNDERLINE_COLOR_INC;
    }
    style {
-      name: "entry_bubble_sent_textblock_style";
-      base: "font=Tizen:style=Regular font_size=36 color=#FAFAFA color_class=ATO014 wrap=mixed align=left";
+      name: "entry_bubble_single_textblock_style";
+      base: "font=Tizen:style=Regular font_size=36 color=#FAFAFA color_class=ATO014 align=left";
       tag:  "br" "\n";
       tag:  "ps" "ps";
       tag:  "tab" "\t";
@@ -159,8 +159,8 @@ styles {
       tag:  "hilight" "+ font_weight=Bold";
    }
    style {
-      name: "entry_bubble_receive_textblock_style";
-      base: "font=Tizen:style=Samsung sans-regular style="ENTRY_BUBBLE_RECEV_TEXT_SHADOW_STYLE" font_size="ENTRY_BUBBLE_TEXT_SIZE" color="ENTRY_BUBBLE_RECEV_TEXT_COLOR"  left_margin=1 right_margin=2 wrap=mixed";
+      name: "entry_bubble_multi_textblock_style";
+      base: "font=Tizen:style=Regular font_size=36 color=#FAFAFA color_class=ATO014 wrap=mixed align=left";
       tag:  "br" "\n";
       tag:  "ps" "ps";
       tag:  "tab" "\t";
@@ -2112,7 +2112,7 @@ type:TEXT;
                                        max: 318 -1;
                                        align: 0.0 0.0;
                                        text {
-                                               style: "entry_bubble_sent_textblock_style";
+                                               style: "entry_bubble_single_textblock_style";
                                                min: 1 1;
                                                align: 0.0 0.0;
                                                ellipsis: -1;
@@ -2123,6 +2123,7 @@ type:TEXT;
                                        inherit: "default" 0.0;
                                        min: 318 0;
                                        text {
+                                       style: "entry_bubble_multi_textblock_style";
                                                min: 0 1;
                                                align: 1.0 0.0;
                                        }
@@ -2292,20 +2293,25 @@ type:TEXT;
                 if (!get_int(multilined) && ((w >= ww))) {
                    set_state(PART:"elm.text", "multi", 0.0);
                    set_int(multilined, 1);
-                } else if (get_int(multilined) && (h < hh)) {
-                   set_state(PART:"elm.text", "default", 0.0);
-                   set_int(multilined, 0);
                 }
              }
           }
                parts {
                        part {
+                               name: "base";
+                               type: SPACER;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                               }
+                       }
+                       part {
                                name: "elm.top.pad";
                                type: SPACER;
                                scale: 1;
                                description {
-                                       rel1 { relative: 0.0 0.0; }
-                                       rel2 { relative: 1.0 0.0; }
+                                       rel1 { relative: 0.0 0.0; to: "base"; }
+                                       rel2 { relative: 1.0 0.0; to: "base"; }
                                        min: 0 10;
                                        align: 0.5 0.0;
                                }
@@ -2401,11 +2407,10 @@ type:TEXT;
                                        state: "default" 0.0;
                                        rel1 { relative: 1.0 1.0; to_x: "elm.bubble.leftbottom.pad"; to_y: "text,top,pad";}
                                        rel2 { relative: 0.0 0.0; to_x: "text,right,pad"; to_y: "elm.bubble.leftbottom.pad"; }
-                                       min: 159 0;
-                                       max: 318 -1;
+                                       min: 159 70;
                                        align: 1.0 0.0;
                                        text {
-                                               style: "entry_bubble_sent_textblock_style";
+                                               style: "entry_bubble_single_textblock_style";
                                                min: 1 1;
                                                align: 1.0 0.0;
                                                ellipsis: -1;
@@ -2414,8 +2419,9 @@ type:TEXT;
                                description {
                                        state: "multi" 0.0;
                                        inherit: "default" 0.0;
-                                       min: 318 0;
+                                       min: 318 70;
                                        text {
+                                               style: "entry_bubble_multi_textblock_style";
                                                min: 0 1;
                                                align: 1.0 0.0;
                                        }
index a36f72d..fd5ea23 100644 (file)
@@ -3710,7 +3710,10 @@ ui_app_lang_changed(app_event_info_h event_info, void *user_data)
        /*APP_EVENT_LANGUAGE_CHANGED*/
        char *locale = NULL;
        system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &locale);
-       elm_language_set(locale);
+       if (locale) {
+               setlocale(LC_ALL, locale);
+               elm_language_set(locale);
+       }
        free(locale);
        return;
 }
index 0377f6b..445ba85 100644 (file)
@@ -6,6 +6,7 @@
 
 #include "tg_db_wrapper.h"
 #include <mime_type.h>
+#include <utils_i18n.h>
 
 void create_data_base_tables()
 {
@@ -1879,14 +1880,12 @@ int insert_current_date_to_table(char* tb_name)
                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
                        return -1;
@@ -1895,7 +1894,7 @@ int insert_current_date_to_table(char* tb_name)
                        time_t t = cur_time;
 
                        char *format = NULL;
-                       format = "%a, %d%b. %Y";
+                       format = "%a, %e %b %Y";
 
                        struct tm lt;
                        char res[256];
@@ -1929,7 +1928,7 @@ int insert_current_date_to_table(char* tb_name)
                time_t t = cur_time;
 
                char *format = NULL;
-               format = "%a, %d%b. %Y";
+               format = "%a, %e %b %Y";
 
                struct tm lt;
                char res[256];
index 0cd078c..38c2546 100644 (file)
@@ -1234,7 +1234,14 @@ static void __resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
        int x, y, w, h;
        evas_object_geometry_get(obj, &x, &y, &w, &h);
-       LOGD(" entry layout size : %d, %d, %d, %d", x, y, w, h);
+       LOGD(" %s size : %d, %d, %d, %d", data, x, y, w, h);
+}
+
+static void __hint_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+       int x, y, w, h;
+       evas_object_size_hint_min_get(obj, &w, &h);
+       LOGD(" %s size : %d, %d", data, w, h);
 }
 
 Evas_Object *on_message_item_content_get_cb(void *data, Evas_Object *obj, const char *part)
@@ -1349,6 +1356,7 @@ Evas_Object *on_message_item_content_get_cb(void *data, Evas_Object *obj, const
                        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);
 
@@ -1481,7 +1489,9 @@ Evas_Object *on_message_item_content_get_cb(void *data, Evas_Object *obj, const
                        elm_object_part_content_set(entry, "status_icon", status_obj);
                        evas_object_show(status_obj);
 
-                       evas_object_event_callback_add(entry, EVAS_CALLBACK_RESIZE, __resize_cb, NULL);
+                       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");
 
                        free(tablename);
                        if(msg->message) {
@@ -3266,22 +3276,19 @@ void launch_messaging_view_cb(appdata_s* ad, int user_id)
        evas_object_size_hint_align_set(msg_box_layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
        evas_object_show(msg_box_layout);
 
-       /* if background is set, Using this code */
-#if 0
        Evas_Object *list_bg = elm_image_add(msg_box_layout);
        evas_object_size_hint_align_set(list_bg, EVAS_HINT_FILL, EVAS_HINT_FILL);
        evas_object_size_hint_weight_set(list_bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
        if (ad->chat_background) {
                elm_image_file_set(list_bg, ad->chat_background, NULL);
        } else {
-               elm_image_file_set(list_bg, ui_utils_get_resource(TG_CHAT_DEFAULT_BG), NULL);
+               //elm_image_file_set(list_bg, ui_utils_get_resource(TG_CHAT_DEFAULT_BG), NULL);
        }
     elm_image_resizable_set(list_bg, EINA_TRUE, EINA_TRUE);
     elm_image_fill_outside_set(list_bg, EINA_TRUE);
     evas_object_show(list_bg);
 
     elm_object_part_content_set(msg_box_layout, "swallow.gen_list.bg", list_bg);
-#endif
 
        Evas_Object *chat_scroller = elm_scroller_add(ad->nf);
        evas_object_size_hint_weight_set(chat_scroller, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);