From 14eeae8f337dbbc7050b2371e3042ccf4c147703 Mon Sep 17 00:00:00 2001 From: Denis Dolzhenko Date: Tue, 23 Aug 2016 13:29:36 +0300 Subject: [PATCH] TizenRefApp-6897 Move attachments insertion from body to convlist Fixed: msg. body-entry Change-Id: I3544890f6e2ef977602448e56079e6881a64978d Signed-off-by: Denis Dolzhenko --- inc/Resource.h | 1 - res/edje/msg_body.edc | 700 ---------------------- res/edje/msg_input_panel.edc | 1 - src/Common/Controller/src/NaviFrameController.cpp | 12 +- src/Conversation/Body/View/inc/BodyView.h | 1 - src/Conversation/Body/View/src/BodyView.cpp | 31 +- 6 files changed, 21 insertions(+), 725 deletions(-) delete mode 100644 res/edje/msg_body.edc diff --git a/inc/Resource.h b/inc/Resource.h index 29d4310..4ac4fb5 100644 --- a/inc/Resource.h +++ b/inc/Resource.h @@ -45,7 +45,6 @@ #define MSG_THREAD_EDJ_PATH EDJ_PATH"/msg_thread.edj" #define CONTACTS_SEARCH_EDJ_PATH EDJ_PATH"/contact_search.edj" -#define MSG_BODY_EDJ_PATH EDJ_PATH"/msg_body.edj" #define THUMBNAIL_EDJ_PATH EDJ_PATH"/msg_thumbnail.edj" #define MSG_TITLE_EDJ_PATH EDJ_PATH"/msg_title.edj" #define SELECT_ALL_EDJ_PATH EDJ_PATH"/select_all.edj" diff --git a/res/edje/msg_body.edc b/res/edje/msg_body.edc deleted file mode 100644 index dcbf11e..0000000 --- a/res/edje/msg_body.edc +++ /dev/null @@ -1,700 +0,0 @@ -#include "macros.inl" -#define COLOR_BLUE_EDC 2 61 132 255 -#define BODY_MEDIA_LABEL_H 28 -#define PAGE_DIVIDER_H 30 -#define IMG_BODY_INPUT_FIELD "00_search_edit_field_bg.#.png" -#define MSGC_IMAGE_THUMB_LANDSCAPE_W 132 /* landscape mode */ -#define MSGC_IMAGE_THUMB_LANDSCAPE_H 75 /* landscape mode */ -#define MSGC_IMAGE_THUMB_PORTRAIT_W 80 /* portrait mode */ -#define MSGC_IMAGE_THUMB_PORTRAIT_H 142 /* portrait mode */ -#define MSGC_IMAGE_THUMB_EQUAL_H 110 /* portrait mode */ -collections { - base_scale: 2.6; - group { - images { - image: dotted_line_divider.png COMP; - } - name: "conv/body/page_divider"; - parts { - part { - name: "rect"; - type: SPACER; - scale: 1; - repeat_events: 1; - description { - state: "default" 0.0; - min: 0 PAGE_DIVIDER_H; - rel1 { - relative: 0.0 0.0; - } - rel2 { - relative: 1.0 1.0; - } - align: 0.0 0.5; - } - } - PADDING_LEFT("padding_left", 5); - // this is modified to stand in line with bottom line of entry - PADDING_RIGHT("padding_right", 15); - part { - name: "line"; - type: IMAGE; - scale: 1; - mouse_events: 0; - repeat_events: 0; - description { - state: "default" 0.0; - fixed: 0 1; - min: 0 1; - align: 0.5 0.5; - rel1 { - to_x: "padding_left"; - relative: 1.0 0.5; - } - rel2 { - to_x: "padding.divider_line"; - relative: 0.0 0.5; - } - visible: 1; - image.normal: dotted_line_divider.png; - fill { - type: TILE; - } - } - } - part { - name: "padding.divider_line"; - type: SPACER; - scale: 1; - description { - state: "default" 0.0; - min: 8 PAGE_DIVIDER_H; - rel1 { - to_x: "text.page_info"; - relative: 0.0 0.0; - } - rel2 { - to_x: "text.page_info"; - relative: 0.0 1.0; - } - } - } - part { - name: "text.page_info"; - type: TEXT; - scale: 1; - description { - state: "default" 0.0; - align: 1.0 0.5; - text { - font: FONT_STYLE_BOLD; - text_class: FONT_TEXT_CLASS_BOLD; - size: 21; - align: 1.0 0.5; - min: 1 1; - ellipsis: -1; - } - color: COLOR_BLUE_EDC; - rel1 { - to_x : "padding_right"; - relative: 0.0 0.0; - } - rel2 { - to_x : "padding_right"; - relative: 0.0 1.0; - } - } - } - } - } - group { - name: "conv/body/page"; - //text input field - parts { - part { - name: "rect"; - type: SPACER; - scale: 1; - mouse_events: 0; - description { - state: "default" 0.0; - min: 0 20; - } - } - PADDING_LEFT("padding_left", 0); - PADDING_RIGHT("padding_right", 0); - PADDING_BOTTOM("padding_bottom", 0); - part { - name: "swl.page"; - type: SWALLOW; - scale:1; - description { - state: "default" 0.0; - min: 0 0; - fixed: 1 0; - rel1 { - to: "padding_left"; - relative: 1.0 0.0; - } - rel2 { - to_x: "padding_right"; - to_y: "padding_bottom"; - relative: 0.0 0.0; - } - } - } - } - } - group { - name: "conv/body/item_layout"; - parts { - part { - name: "rect"; - type: RECT; - //It should be a RECT in oder to emit clicked signal - scale: 1; - mouse_events: 1; - description { - state: "default" 0.0; - min: 0 40; - color: 0 0 0 0; - } - } - PADDING_TOP("padding_top", 2); - PADDING_RIGHT("padding_right", 0); - part { - name: "padding_bottom"; - type: RECT; - scale: 1; - mouse_events: 0; - description { - state: "default" 0.0; - min: 0 0; - fixed: 0 1; - visible: 0; - color: 0 0 0 0; - rel1 { - relative: 0.0 1.0; - } - rel2 { - relative: 1.0 1.0; - } - align: 0.0 1.0; - } - description { - //Padding increased for text entry not to come under character count. - state: "easy.mode" 0.0; - min: 0 32; - fixed: 0 1; - visible: 0; - color: 0 0 0 0; - rel1 { - relative: 0.0 1.0; - } - rel2 { - relative: 1.0 1.0; - } - align: 0.0 1.0; - } - } - part { - name: "swl.content"; - type: SWALLOW; - scale:1; - description { - state: "default" 0.0; - fixed: 1 0; - rel1 { - to_y: "padding_top"; - relative: 0.0 1.0; - } - rel2 { - to_x: "padding_right"; - to_y: "padding_bottom"; - relative: 0.0 0.0; - } - align: 0.0 1.0; - } - } - } - programs { - program { - name: "page_layout_clicked"; - source: "rect"; - signal: "mouse,clicked,1"; - action: SIGNAL_EMIT "page_layout,clicked" ""; - } - program { - name: "show.easy.mode"; - signal: "show.easy.mode"; - source: "*"; - action: STATE_SET "easy.mode" 0.0; - target: "padding_bottom"; - } - program { - name: "show.normal.mode"; - signal: "show.normal.mode"; - source: "*"; - action: STATE_SET "default.mode" 0.0; - target: "padding_bottom"; - } - } - } - group { - name: "conv/body/media_main"; - parts { - //If "rect.image" is not existed, then width of sound layout is not shown correctly. - part { - name: "bg"; - type: SPACER; - scale: 1; - mouse_events: 1; - repeat_events: 1; - description { - state: "default" 0.0; - max: -1 110; - rel1 { - relative: 0.0 0.0; - } - rel2 { - relative: 1.0 1.0; - } - align: 0.0 0.0; - } - description { - state: "image" 0.0; - /* default state of image is landscape */ - max: MSGC_IMAGE_THUMB_LANDSCAPE_W MSGC_IMAGE_THUMB_LANDSCAPE_H; - rel1 { - relative: 0.0 0.0; - } - rel2 { - relative: 1.0 1.0; - } - align: 0.0 0.0; - } - description { - state: "image.portrait" 0.0; - max: MSGC_IMAGE_THUMB_PORTRAIT_W MSGC_IMAGE_THUMB_PORTRAIT_H; - rel1 { - relative: 0.0 0.0; - } - rel2 { - relative: 1.0 1.0; - } - align: 0.0 0.0; - } - description { - state: "image.equal" 0.0; - /* in case of equal we set bg 110 110 */ - max: MSGC_IMAGE_THUMB_EQUAL_H MSGC_IMAGE_THUMB_EQUAL_H; - rel1 { - relative: 0.0 0.0; - } - rel2 { - relative: 1.0 1.0; - } - align: 0.0 0.0; - } - } - part { - name: "swl.content"; - type: SWALLOW; - scale: 1; - mouse_events: 1; - repeat_events: 0; - description { - state: "default" 0.0; - fixed: 0 0; - rel1.to: "bg"; - rel2.to: "bg"; - align: 0.0 0.0; - } - } - } - programs { - program { - name: "media.sound"; - signal: "media.sound"; - source: "*"; - } - program { - name: "media.image.landscape"; - signal: "media.image.landscape"; - source: "*"; - action: STATE_SET "image" 0.0; - target: "bg"; - } - program { - name: "media.image.portrait"; - signal: "media.image.portrait"; - source: "*"; - action: STATE_SET "image.portrait" 0.0; - target: "bg"; - } - program { - name: "media.image.equal"; - signal: "media.image.equal"; - source: "*"; - action: STATE_SET "image.equal" 0.0; - target: "bg"; - } - program { - name: "item_press"; - signal: "play,press,sound"; - source: "*"; - action: RUN_PLUGIN "touch_sound"; - } - } - } - group { - name: "conv/body/media_label"; - images { - image: IMG_BODY_INPUT_FIELD COMP; - image: "00_search_edit_field_selected.#.png" COMP; - } - parts { - part { - name: "rect"; - type: SPACER; - scale: 1; - mouse_events: 1; - repeat_events: 0; - description { - state: "default" 0.0; - rel1{ - relative: 0.0 0.0; - } - rel2{ - relative: 1.0 1.0; - } - fixed: 1 1; - align: 0.0 0.0; - } - } - PADDING_TOP("padding_top", 0); - PADDING_LEFT("padding_left", 5); - // this is modified to stand in line with bottom line of entry - PADDING_RIGHT("padding_right", 0); - PADDING_BOTTOM("padding_bottom", 0); - part { - name: "rect.bg"; - type: RECT; - scale: 1; - mouse_events: 1; - repeat_events: 0; - description { - state: "default" 0.0; - min: 0 BODY_MEDIA_LABEL_H; - rel1{ - to_x: "padding_left"; - to_y: "padding_top"; - relative: 1.0 1.0; - } - rel2{ - to_x: "padding_right"; - to_y: "padding_bottom"; - relative: 0.0 0.0; - } - align: 0.0 0.0; - visible: 0; - } - description { - state: "focused" 0.0; - inherit: "default" 0.0; - visible: 0; - } - } - part { - name: "main.bg"; - type: IMAGE; - scale: 1; - mouse_events: 1; - repeat_events: 0; - description { - state: "default" 0.0; - fixed: 0 1; - visible: 0; - rel1 { - to: "rect.bg"; - } - rel2 { - to: "rect.bg"; - } - image.normal: IMG_BODY_INPUT_FIELD; - color_class: "W031L1"; - } - description { - state: "focused" 0.0; - inherit: "default" 0.0; - color_class: "W031L1"; - visible: 1; - } - } - part { - name: "glow"; - mouse_events: 0; - description { - state: "default" 0.0; - rel1 { - to: "main.bg"; - } - rel2 { - to: "main.bg"; - } - image.normal: "00_search_edit_field_selected.#.png"; - color_class: "W031L2"; - visible: 0; - } - description { - state: "focused" 0.0; - inherit: "default" 0.0; - visible: 1; - color: COLOR_BLUE_EDC; - } - } - part { - name: "text.filename"; - type: TEXT; - scale: 1; - mouse_events: 1; - repeat_events: 0; - description { - state: "default" 0.0; - rel1 { - to_x: "padding_left"; - to_y: "padding_top"; - relative: 1.0 1.0; - offset: 2 0; - } - rel2 { - to_x: "padding_right"; - to_y: "padding_bottom"; - relative: 0.0 0.0; - offset: -10 0; - } - align: 0.0 0.5; - color: COLOR_BLUE_EDC; - text { - font: FONT_STYLE_REGULAR; - text_class: FONT_TEXT_CLASS_REGULAR; - size: 25; - align: 0.0 0.5; - text: ""; - } - } - } - } - programs { - #if 0 //clicked cb from edc is not supported - program { - name: "sound_clicked"; - source: "rect.bg"; - signal: "mouse,clicked,1"; - script { - emit ("sound_clicked", ""); - } - } - #endif - program { - name: "focused"; - signal: "focused"; - source: "*"; - script { - new st[31]; - new Float:vl; - get_state(PART:"rect.bg", st, 30, vl) - if (!strcmp(st, "default")) { - set_state(PART:"glow", "focused", 0.0); - set_state(PART:"main.bg", "focused", 0.0); - set_state(PART:"rect.bg", "focused", 0.0); - } - } - } - program { - name: "unfocused"; - signal: "unfocused"; - source: "*"; - script { - new st[31]; - new Float:vl; - get_state(PART:"rect.bg", st, 30, vl) - if (!strcmp(st, "focused")) { - set_state(PART:"glow", "default", 0.0); - set_state(PART:"main.bg", "default", 0.0); - set_state(PART:"rect.bg", "default", 0.0); - } - } - } - } - } - group { - name: "conv/body/media_image"; - images { - image: "00_video_play.png" COMP; - } - parts { - part { - name: "rect"; - type: SPACER; - scale: 1; - mouse_events: 1; - repeat_events: 0; - description { - state: "default" 0.0; - rel1{ - relative: 0.0 0.0; - } - rel2{ - relative: 1.0 1.0; - } - fixed: 1 1; - align: 0.0 0.0; - } - } - PADDING_TOP("padding_top", 0); - PADDING_LEFT("padding_left", 5); - // this is modified to stand in line with bottom line of entry - PADDING_RIGHT("padding_right", 0); - PADDING_BOTTOM("padding_bottom", 0); - //If "rect.left_padding" is not existed, then height of image layout is not updated correctly. - part { - name: "rect.bg"; - type: RECT; - scale: 1; - mouse_events: 1; - repeat_events: 0; - description { - state: "default" 0.0; - rel1{ - to_x: "padding_left"; - to_y: "padding_top"; - relative: 1.0 1.0; - } - rel2{ - to: "rect.thumbnail"; - relative: 1.0 1.0; - } - align: 0.0 0.0; - visible: 1; - color: 255 255 255 255; - } - description { - state: "focus" 0.0; - inherit: "default" 0.0; - color: COLOR_BLUE_EDC; - visible: 1; - } - } - part { - name: "rect.thumbnail"; - type: SPACER; - scale: 1; - mouse_events: 1; - repeat_events: 1; - description { - state: "default" 0.0; - rel1 { - to: "rect.bg"; - relative: 0.0 0.0; - offset: 2 2; - } - rel2 { - to: "swl.thumbnail"; - relative: 1.0 1.0; - offset: 1 1; - } - align: 0.0 0.0; - } - } - part { - name: "swl.thumbnail"; - type: SWALLOW; - scale: 1; - mouse_events: 1; - repeat_events: 1; - description { - state: "default" 0.0; - fixed: 0 0; - rel1 { - to: "rect.thumbnail"; - relative: 0.0 0.0; - } - align: 0.0 0.0; - } - } - part { - name: "play_button"; - type: IMAGE; - scale: 1; - description { - state: "default" 0.0; - visible: 0; - image.normal: "00_video_play.png"; - align: 0.5 0.5; - min: 48 48; - rel1 { - to: "swl.thumbnail"; - relative: 0.5 0.5; - offset: -36 -36; - } - rel2 { - to: "swl.thumbnail"; - relative: 0.5 0.5; - offset: 36 36; - } - } - description { - state: "show" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - } - programs { - #if 0 //clicked cb from edc is not supported - program { - name: "image_clicked"; - source: "rect"; - signal: "mouse,clicked,1"; - script { - emit ("image_clicked", ""); - } - } - #endif - program { - name: "focused"; - signal: "focused"; - source: "*"; - script { - new st[31]; - new Float:vl; - get_state(PART:"rect.bg", st, 30, vl) - if (!strcmp(st, "default")) { - set_state(PART:"rect.bg", "focus", 0.0); - } - } - } - program { - name: "unfocused"; - signal: "unfocused"; - source: "*"; - script { - new st[31]; - new Float:vl; - get_state(PART:"rect.bg", st, 30, vl) - if (!strcmp(st, "focus")) { - set_state(PART:"rect.bg", "default", 0.0); - } - } - } - program { - name: "play_icon_show"; - signal: "play_icon_show"; - source: ""; - action: STATE_SET "show" 0.0; - target: "play_button"; - } - } - } -} \ No newline at end of file diff --git a/res/edje/msg_input_panel.edc b/res/edje/msg_input_panel.edc index 7c96403..4dce34a 100644 --- a/res/edje/msg_input_panel.edc +++ b/res/edje/msg_input_panel.edc @@ -71,7 +71,6 @@ collections { scale: 1; description { state: "default" 0.0; - fixed: 0 0; rel1 { to_x: "padding1"; to_y: "padding_entry_top"; relative: 1.0 1.0; } rel2 { to_x: "padding2"; to_y: "padding_entry_bottom"; relative: 0.0 0.0; } align: 0.0 1.0; diff --git a/src/Common/Controller/src/NaviFrameController.cpp b/src/Common/Controller/src/NaviFrameController.cpp index 372ca1e..7eba56b 100644 --- a/src/Common/Controller/src/NaviFrameController.cpp +++ b/src/Common/Controller/src/NaviFrameController.cpp @@ -94,6 +94,7 @@ void NaviFrameController::execCmd(const AppControlDefaultRef &cmd) if(type == AppControlDefault::ViewType || type == AppControlDefault::ReplyType || isUnreadNotificationSingle(type)) { Conversation *conversation = new Conversation(*this); + ecore_main_loop_iterate_may_block(true); // FIXME: Fix EFL(TSAM-2158) and remove it push(*conversation); conversation->execCmd(cmd); } @@ -107,16 +108,13 @@ void NaviFrameController::execCmd(const AppControlComposeRef &cmd) if(prepare(*cmd)) { Conversation *conv = getTopFrame(); - if(conv) + if(!conv) { - conv->execCmd(cmd); - } - else - { - Conversation *conv = new Conversation(*this); + conv = new Conversation(*this); + ecore_main_loop_iterate_may_block(true); // FIXME: Fix EFL(TSAM-2158) and remove it push(*conv); - conv->execCmd(cmd); } + conv->execCmd(cmd); } } diff --git a/src/Conversation/Body/View/inc/BodyView.h b/src/Conversation/Body/View/inc/BodyView.h index 1d6ab7a..67ea104 100644 --- a/src/Conversation/Body/View/inc/BodyView.h +++ b/src/Conversation/Body/View/inc/BodyView.h @@ -52,7 +52,6 @@ namespace Msg private: Evas_Object *m_pRootBox; Evas_Object *m_pContentBox; - Evas_Object *m_pScroller; Evas_Object *m_pEntry; }; } diff --git a/src/Conversation/Body/View/src/BodyView.cpp b/src/Conversation/Body/View/src/BodyView.cpp index 1366839..a636892 100644 --- a/src/Conversation/Body/View/src/BodyView.cpp +++ b/src/Conversation/Body/View/src/BodyView.cpp @@ -38,25 +38,24 @@ namespace BodyView::BodyView(Evas_Object *parent, int maxCharCount) : m_pRootBox(nullptr) , m_pContentBox(nullptr) - , m_pScroller(nullptr) , m_pEntry(nullptr) { // Root box: m_pRootBox = elm_box_add(parent); + elm_box_horizontal_set(m_pRootBox, false); setEo(m_pRootBox); - expand(); // Scroller: - m_pScroller = elm_scroller_add(getEo()); - expand(m_pScroller); - evas_object_show(m_pScroller); + Evas_Object *scroller = elm_scroller_add(getEo()); + expand(scroller); + evas_object_show(scroller); + elm_box_pack_end(m_pRootBox, scroller); // Content box: - Evas_Object *contentBox = createContentBox(m_pScroller); - - elm_box_pack_end(m_pRootBox, m_pScroller); - elm_object_content_set(m_pScroller, contentBox); + Evas_Object *contentBox = createContentBox(scroller); + elm_object_content_set(scroller, contentBox); + // Create entry: elm_box_pack_end(contentBox, createEntry(contentBox, maxCharCount)); } @@ -67,6 +66,7 @@ BodyView::~BodyView() Evas_Object *BodyView::createContentBox(Evas_Object *parent) { m_pContentBox = elm_box_add(parent); + elm_box_horizontal_set(m_pContentBox, false); evas_object_show(m_pContentBox); evas_object_size_hint_weight_set(m_pContentBox, EVAS_HINT_EXPAND, 0); evas_object_size_hint_align_set(m_pContentBox, EVAS_HINT_FILL, 0); @@ -139,8 +139,12 @@ Evas_Object *BodyView::createEntry(Evas_Object *parent, int maxCharCount) elm_object_focus_allow_set(m_pEntry, true); // elm_entry_input_panel_enabled_set(m_pEntry, false); // Keypad is manually controlled eext_entry_selection_back_event_allow_set(m_pEntry, true); - evas_object_show(m_pEntry); - expand(m_pEntry); + evas_object_size_hint_weight_set(m_pEntry, EVAS_HINT_EXPAND, 0); + evas_object_size_hint_align_set(m_pEntry, EVAS_HINT_FILL, 0); + + // Preset max width to avoid blink + const int maxWidth = ELM_SCALE_SIZE(720); + evas_object_resize(m_pEntry, maxWidth, 0); View::setText(m_pEntry, msgt("IDS_MSG_TMBODY_TEXT_MESSAGES"), "elm.guide"); @@ -155,10 +159,7 @@ Evas_Object *BodyView::createEntry(Evas_Object *parent, int maxCharCount) ((BodyView*)data)->onCheckBoundaryText(text); }, this ); - // Preset max width to avoid blink - const int maxWidth = ELM_SCALE_SIZE(720); - evas_object_resize(m_pEntry, maxWidth, 0); - + evas_object_show(m_pEntry); evas_object_smart_callback_add(m_pEntry, "changed", [](void *data, Evas_Object *obj, void *event_info) { ((BodyView*)data)->onContentChanged(); -- 2.7.4