From 27d390606a87b1638aeed2c94e997185e954072c Mon Sep 17 00:00:00 2001 From: Denis Dolzhenko Date: Thu, 2 Jun 2016 19:04:04 +0300 Subject: [PATCH] TizenRefApp-6234 Move character count above the send-button Change-Id: I5476689dbb26a4d7564deb6574db8a9ebe667f0a Signed-off-by: Denis Dolzhenko --- edje/images/btn_conversation_add.png | Bin 1723 -> 4650 bytes res/edje/macros.inl | 2 +- res/edje/msg_input_panel.edc | 162 +++++---------------- res/edje/msg_thread.edc | 2 +- src/Common/Utils/inc/TextDecorator.h | 3 +- src/Common/Utils/src/TextDecorator.cpp | 3 +- src/Conversation/Main/View/inc/MessageInputPanel.h | 7 +- .../Main/View/src/MessageInputPanel.cpp | 56 +++++-- 8 files changed, 94 insertions(+), 141 deletions(-) mode change 100755 => 100644 edje/images/btn_conversation_add.png diff --git a/edje/images/btn_conversation_add.png b/edje/images/btn_conversation_add.png old mode 100755 new mode 100644 index 65c56e8c6270517c059d8f95a8f8cb9527e35559..ef87e7bd16d7f51ea8c6ba71a2fb27a890ee50d2 GIT binary patch literal 4650 zcmV+_64mXAP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mM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9Mt1;Ip;3b?bWVfW_9PAD#DMtSgS$o`AP|#tI5=R+vqb(M012Mf7NfwCTmS$707*qoM6N<$f^oc*;Q#;t literal 1723 zcmeAS@N?(olHy`uVBq!ia0vp^Mj*_=1|;R|J2nC-$r9IylHmNblJdl&R0hYC{G?O` z&)mfH)S%SFl*+=BsWuD@%u1Od5hW46K32*3xq68pHF_1f1wh>l3^w)^1&PVosU-?Y zsp*+{wo31J?^jaDOtDo8H}y5}EpSfF$n>ZxN)4{^3rViZPPR-@vbR&PsjvbXkegbP zs8ErclUHn2VXFi-*9yo63F|81#=KlDb#X~hD#E>34K5C;EJ)Q4 zN-fSWElLJPT$(b-ssbzLqSVBa{GyQj{2W*)24v)yG;}qwbTqYac64<#voLgW zc6G9V>2=9ZF3nBND}m`vLFjeEsTY(KatnYqyQCInmZhe+73JqDfW2&$iQ6sCIL(9V zO~LIJ7o2+afsWA!MJ!T8!-RmT2gHOYTObFX@Kf`Esl5o8tp7)+NCI<Mnt>kZJuB9|iM&y_DR-e=(YWpR0tn%lg;_ z4oylcULY=8ls_f`)t>y+17vg=d?cjP`lZ<_}m=c+06DS&uTu;{cBnLEJp36 zgKi+FLvIYC-t`f=S&kGmWTMZPpUs-0UyGAif%wT^T9oUbcY;Yyfs;->4I)j@sxXUGVY%BdILjgu@6TPdx6>y)P9b)T<- z!9t!l3$HR>zI!bxX<5ysmJZKOJEdofF5RzjdD_3 zs`bL@yS96Igh)=gamZs2%T}xGZ#qLFtsL4jA+rRXO&<$-*D%2zBt!PP<7(z>gTe~DWM4f-HMaW diff --git a/res/edje/macros.inl b/res/edje/macros.inl index 37bd3fa..17a97a4 100644 --- a/res/edje/macros.inl +++ b/res/edje/macros.inl @@ -1,4 +1,4 @@ -#define BASE_SCALE 1.8 +#define BASE_SCALE base_scale: 2.6; #define PADDING_LEFT(param_padding_name, param_padding_size) \ part \ diff --git a/res/edje/msg_input_panel.edc b/res/edje/msg_input_panel.edc index 48f4b5d..5ed16f4 100644 --- a/res/edje/msg_input_panel.edc +++ b/res/edje/msg_input_panel.edc @@ -2,13 +2,14 @@ #define COLOR_WHITE 255 255 255 255 #define COLOR_BLUE 2 61 132 255 +#define COLOR_GRAY 128 128 128 255 -#define BODY_ADDBUTTON_SIZE 50 50 -#define BODY_SENDBUTTON_SIZE 46 40 +#define BODY_ADDBUTTON_SIZE 72 72 +#define BODY_SENDBUTTON_SIZE 72 43 collections { - base_scale: 1.8; + BASE_SCALE; group { name: "conversation/msg_input_panel"; @@ -21,66 +22,43 @@ collections { mouse_events: 0; description { state: "default" 0.0; - min: 0 80; + min: 0 154; rel1{ relative: 0.0 0.0; } rel2{ relative: 1.0 1.0; } - color: COLOR_WHITE; } } PADDING_TOP("padding_top", 1); - PADDING_BOTTOM("padding_btn_bottom", 18); PADDING_TOP("padding_entry_top", 5); - PADDING_BOTTOM("padding_entry_bottom", 18); - PADDING_BOTTOM("padding_send_btn_bottom", 4); - PADDING_LEFT("padding_left", 11); - PADDING_RIGHT("padding_right", 15); + PADDING_BOTTOM("padding_entry_bottom", 56); + PADDING_BOTTOM("padding_add_btn_bottom", 44); + PADDING_LEFT("padding_left", 32); + PADDING_RIGHT("padding_right", 43); part { - name: "rect.add_bt_area"; - type: SPACER; - scale: 1; - description { - state: "default" 0.0; - min: BODY_ADDBUTTON_SIZE; - max: BODY_ADDBUTTON_SIZE; - fixed: 1 1; - rel1 { to_x: "padding_left"; to_y: "padding_btn_bottom"; relative: 1.0 0.0; } - rel2 { to_x: "padding_left"; to_y: "padding_btn_bottom"; relative: 1.0 0.0; } - align: 0.0 1.0; - } - description { - state: "landscape" 0.0; - inherit: "default" 0.0; - rel1 { to_x: "padding_left"; to_y: "padding_btn_bottom"; relative: 1.0 0.0; } - rel2 { to_x: "padding_left"; to_y: "padding_btn_bottom"; relative: 1.0 0.0; } - align: 0.0 1.0; - } - } - part { name: "swl.add_button"; type: SWALLOW; scale: 1; description { - max: BODY_ADDBUTTON_SIZE; - min: BODY_ADDBUTTON_SIZE; - state: "default" 0.0; - fixed: 1 1; - rel1 { to: "rect.add_bt_area"; relative: 0.0 0.0; } - rel2 { to: "rect.add_bt_area"; relative: 1.0 1.0; } - align: 0.5 0.5; + state: "default" 0.0; + min: BODY_ADDBUTTON_SIZE; + max: BODY_ADDBUTTON_SIZE; + fixed: 1 1; + rel1 { to_x: "padding_left"; to_y: "padding_add_btn_bottom"; relative: 1.0 0.0; } + rel2 { to_x: "padding_left"; to_y: "padding_add_btn_bottom"; relative: 1.0 0.0; } + align: 0.0 1.0; } } part { - name: "padding1"; //padding between add button and input field.. + name: "padding1"; //padding between add button and input field. type: SPACER; scale: 1; description { state: "default" 0.0; min: 10 0; fixed: 1 0; - rel1 { to_x: "rect.add_bt_area"; relative: 1.0 0.0; } - rel2 { to_x: "rect.add_bt_area"; relative: 1.0 1.0; } + rel1 { to_x: "swl.add_button"; relative: 1.0 0.0; } + rel2 { to_x: "swl.add_button"; relative: 1.0 1.0; } align: 0.0 0.0; } } @@ -107,8 +85,8 @@ collections { max: -1 2; fixed: 1 1; align: 0.0 1.0; - rel1 { to: "text_count_rect"; relative: 0.0 0.0; } - rel2 { to: "text_count_rect"; relative: 1.0 0.0; } + rel1 { to: "text.char_count"; relative: 0.0 0.0; } + rel2 { to: "text.char_count"; relative: 1.0 0.0; } } } part { @@ -117,35 +95,22 @@ collections { scale: 1; mouse_events: 0; description { - state: "default" 0.0; - rel1 { to: "text_count_rect"; relative: 0.0 0.0; } - rel2 { to: "text_count_rect"; relative: 1.0 1.0; } - align: 0.5 0.5; - color: COLOR_BLUE; + state: "default" 0.0; + min: 73 31; + max: 73 31; + fixed: 1 1; + rel1 { to_x: "padding_right"; to_y: "swl.add_button"; relative: 0.0 0.5; } + rel2 { to_x: "padding_right"; to_y: "swl.add_button"; relative: 0.0 0.5; } + align: 1.0 1.0; + visible: 1; + color: COLOR_GRAY; text { - size: 17; - text: ""; + size: 23; + align: 1.0 0.5; } } } part { - name: "text_count_rect"; - type: RECT; - scale: 1; - mouse_events: 1; - description { - state: "default" 0.0; - min: 54 20; - max: 54 20; - fixed: 1 1; - rel1 { to_x: "padding_right"; to_y: "padding_send_btn_bottom"; relative: 0.0 0.0; } - rel2 { to_x: "padding_right"; to_y: "padding_send_btn_bottom"; relative: 0.0 0.0; } - align: 1.0 1.0; - color: 0 0 0 0; - visible: 1; - } - } - part { name: "padding2"; //padding between input field of right side and send button type: SPACER; scale: 1; @@ -154,28 +119,8 @@ collections { fixed: 1 0; min: 14 0; align: 1.0 0.0; - rel1 { to_x: "rect.send_button"; relative: 0.0 0.0; } - rel2 { to_x: "rect.send_button"; relative: 0.0 1.0; } - } - } - part { - name: "rect.send_button"; - type: SPACER; - scale: 1; - description { - state: "default" 0.0; - fixed: 1 1; - min: BODY_SENDBUTTON_SIZE; - max: BODY_SENDBUTTON_SIZE; - align: 1.0 1.0; - rel1 { to_x: "padding_right"; to_y: "padding_top"; relative: 0.0 1.0; } - rel2 { to_x: "padding_right"; to_y: "text_padding"; relative: 0.0 0.0; } - } - description { - state: "landscape" 0.0; - inherit: "default" 0.0; - rel1 { to_x: "padding_right"; to_y: "padding_top"; relative: 0.0 1.0; } - rel2 { to_x: "padding_right"; to_y: "text_padding"; relative: 0.0 0.0; } + rel1 { to_x: "swl.send_button"; relative: 0.0 0.0; } + rel2 { to_x: "swl.send_button"; relative: 0.0 1.0; } } } part { @@ -184,22 +129,17 @@ collections { scale: 1; description { state: "default" 0.0; - fixed: 1 1; - min: BODY_SENDBUTTON_SIZE; - max: BODY_SENDBUTTON_SIZE; - rel1 { to: "rect.send_button"; relative: 0.0 0.0; } - rel2 { to: "rect.send_button"; relative: 1.0 1.0; } - align: 0.5 0.5; - visible: 1; + fixed: 1 1; + min: BODY_SENDBUTTON_SIZE; + max: BODY_SENDBUTTON_SIZE; + align: 1.0 0.0; + rel1 { to_x: "padding_right"; to_y: "swl.add_button"; relative: 0.0 0.5; } + rel2 { to_x: "padding_right"; to_y: "swl.add_button"; relative: 0.0 0.5; } } description { state: "hide" 0.0; visible: 0; } - description { - state: "landscape" 0.0; - inherit: "default" 0.0; - } } } programs { @@ -223,28 +163,6 @@ collections { action: STATE_SET "default" 0.0; target: "swl.send_button"; } - program { - name: "show.portrait.mode"; - signal: "show.portrait.mode"; - source: "*"; - action: STATE_SET "default" 0.0; - target: "rect.send_button"; - target: "swl.send_button"; - target: "rect.add_bt_area"; - target: "swl.main"; - target: "text_padding"; - } - program { - name: "show.landscape.mode"; - signal: "show.landscape.mode"; - source: "*"; - action: STATE_SET "landscape" 0.0; - target: "rect.send_button"; - target: "swl.send_button"; - target: "rect.add_bt_area"; - target: "swl.main"; - target: "text_padding"; - } } } } diff --git a/res/edje/msg_thread.edc b/res/edje/msg_thread.edc index 608fe85..55cf8f8 100755 --- a/res/edje/msg_thread.edc +++ b/res/edje/msg_thread.edc @@ -2,7 +2,7 @@ collections { - base_scale: BASE_SCALE; + BASE_SCALE; group { name: "msg_thread_layout"; parts { diff --git a/src/Common/Utils/inc/TextDecorator.h b/src/Common/Utils/inc/TextDecorator.h index aab2768..ec2a7e4 100644 --- a/src/Common/Utils/inc/TextDecorator.h +++ b/src/Common/Utils/inc/TextDecorator.h @@ -33,7 +33,8 @@ namespace Msg class TextStyle { public: - static const std::string defaultColor; + static const char *defaultColor; + static const char *whiteColor; static const int defaultFontSize; public: diff --git a/src/Common/Utils/src/TextDecorator.cpp b/src/Common/Utils/src/TextDecorator.cpp index d7c1573..e8f864f 100644 --- a/src/Common/Utils/src/TextDecorator.cpp +++ b/src/Common/Utils/src/TextDecorator.cpp @@ -22,7 +22,8 @@ using namespace Msg; -const std::string TextStyle::defaultColor = "#000000FF"; +const char *TextStyle::defaultColor = "#000000FF"; +const char *TextStyle::whiteColor = "#FFFFFFFF"; const int TextStyle::defaultFontSize = 28; #define OPEN_TAG(name, val) "<" name "=" << (val) << ">" diff --git a/src/Conversation/Main/View/inc/MessageInputPanel.h b/src/Conversation/Main/View/inc/MessageInputPanel.h index f7c87d3..2209234 100644 --- a/src/Conversation/Main/View/inc/MessageInputPanel.h +++ b/src/Conversation/Main/View/inc/MessageInputPanel.h @@ -47,10 +47,14 @@ namespace Msg private: void create(Evas_Object *parent); - Evas_Object *createButton(Evas_Object *parent, const char *iconRes, const char *style, ButtonId buttonId); + Evas_Object *createButton(Evas_Object *parent, ButtonId buttonId); + Evas_Object *createAddButton(Evas_Object *parent); + Evas_Object *createSendButton(Evas_Object *parent); Evas_Object *getIcon(Evas_Object *button); Evas_Object *getButton(ButtonId id); + void updateSendButtonTitle(); + void setNormalColor(Evas_Object *button); void setPressedColor(Evas_Object *button); void setDisabledColor(Evas_Object *button); @@ -63,6 +67,7 @@ namespace Msg IMessageInputPanelListener * m_pListener; Evas_Object *m_pLayout; Evas_Object *m_pSendButton; + Evas_Object *m_pSendLabel; Evas_Object *m_pAddButton; }; diff --git a/src/Conversation/Main/View/src/MessageInputPanel.cpp b/src/Conversation/Main/View/src/MessageInputPanel.cpp index 0a3859f..368bddd 100644 --- a/src/Conversation/Main/View/src/MessageInputPanel.cpp +++ b/src/Conversation/Main/View/src/MessageInputPanel.cpp @@ -19,18 +19,22 @@ #include "PathUtils.h" #include "CallbackAssist.h" #include "Logger.h" +#include "LangUtils.h" +#include "TextDecorator.h" + +using namespace Msg; namespace { const char *buttonIdKey = "id"; + const TextStyle sendTextStyle(32, TextStyle::whiteColor, TextAlign::Right); } -using namespace Msg; - MessageInputPanel::MessageInputPanel(Evas_Object *parent) : m_pListener(nullptr) , m_pLayout(nullptr) , m_pSendButton(nullptr) + , m_pSendLabel(nullptr) , m_pAddButton(nullptr) { create(parent); @@ -50,8 +54,8 @@ void MessageInputPanel::create(Evas_Object *parent) std::string edjPath = PathUtils::getResourcePath(MSG_INPUT_PANEL_EDJ_PATH); elm_layout_file_set(m_pLayout, edjPath.c_str(), "conversation/msg_input_panel"); - m_pSendButton = createButton(m_pLayout, CONV_SEND_IMG, "send_custom", SendButtonId); - m_pAddButton = createButton(m_pLayout, CONV_ADD_IMG, "body_button", AddButtonId); + m_pSendButton = createSendButton(m_pLayout); + m_pAddButton = createAddButton(m_pLayout); elm_object_part_content_set(m_pLayout, "swl.send_button", m_pSendButton); elm_object_part_content_set(m_pLayout, "swl.add_button", m_pAddButton); @@ -64,7 +68,7 @@ void MessageInputPanel::setEntry(Evas_Object *obj) Evas_Object *MessageInputPanel::getIcon(Evas_Object *button) { - return elm_object_part_content_get(button, "button_center_part"); + return elm_object_content_get(button); } void MessageInputPanel::setNormalColor(Evas_Object *button) @@ -102,26 +106,50 @@ Evas_Object *MessageInputPanel::getButton(ButtonId id) return nullptr; } -Evas_Object *MessageInputPanel::createButton(Evas_Object *parent, const char *iconRes, const char *style, ButtonId buttonId) +Evas_Object *MessageInputPanel::createButton(Evas_Object *parent, ButtonId buttonId) { Evas_Object *button = elm_button_add(parent); - elm_object_style_set(button, style); + elm_object_style_set(button, "transparent"); evas_object_data_set(button, buttonIdKey, (void*)buttonId); evas_object_size_hint_weight_set(button, 0.0, 0.0); - evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_smart_callback_add(button, "clicked", SMART_CALLBACK(MessageInputPanel, onButtonClicked), this); + evas_object_smart_callback_add(button, "pressed", SMART_CALLBACK(MessageInputPanel, onButtonPressed), this); + evas_object_smart_callback_add(button, "unpressed", SMART_CALLBACK(MessageInputPanel, onButtonUnpressed), this); evas_object_show(button); + return button; +} + +void MessageInputPanel::updateSendButtonTitle() +{ + //TODO: on language changed cb + std::string text = TextDecorator::make(msg("IDS_MSG_BUTTON_SEND_ABB3"), sendTextStyle); + elm_object_text_set(m_pSendLabel, text.c_str()); +} + +Evas_Object *MessageInputPanel::createSendButton(Evas_Object *parent) +{ + Evas_Object *button = createButton(parent, SendButtonId); + + m_pSendLabel = elm_label_add(button); + updateSendButtonTitle(); + elm_object_content_set(button, m_pSendLabel); + evas_object_show(m_pSendLabel); + evas_object_color_set(m_pSendLabel, BUTTON_COLOR); + + return button; +} + +Evas_Object *MessageInputPanel::createAddButton(Evas_Object *parent) +{ + Evas_Object *button = createButton(parent, AddButtonId); Evas_Object *icon = elm_icon_add(button); std::string resPath = PathUtils::getResourcePath(IMAGES_EDJ_PATH); evas_object_show(icon); - elm_image_file_set(icon, resPath.c_str(), iconRes); + elm_image_file_set(icon, resPath.c_str(), CONV_ADD_IMG); evas_object_color_set(icon, BUTTON_COLOR); - elm_object_part_content_set(button, "button_center_part", icon); - - evas_object_smart_callback_add(button, "clicked", SMART_CALLBACK(MessageInputPanel, onButtonClicked), this); - evas_object_smart_callback_add(button, "pressed", SMART_CALLBACK(MessageInputPanel, onButtonPressed), this); - evas_object_smart_callback_add(button, "unpressed", SMART_CALLBACK(MessageInputPanel, onButtonUnpressed), this); + elm_object_content_set(button, icon); return button; } -- 2.7.4