From 86eed222fa277c465341dc331e8492796ef78e0a Mon Sep 17 00:00:00 2001 From: Denis Dolzhenko Date: Mon, 5 Sep 2016 15:36:08 +0300 Subject: [PATCH] TizenRefApp-7064 Implementation unread icon in message thread (GUI part) Change-Id: I2ca10eda2de3eca2d152d0defc186c0793d8ebfd Signed-off-by: Denis Dolzhenko --- edje/images/core_icon_badge_container.#.png | Bin 0 -> 3217 bytes res/edje/icons.edc | 50 ++++++++++++++++++++++++ src/MsgThread/Controller/src/ThreadListItem.cpp | 2 +- src/MsgThread/View/inc/ThreadListViewItem.h | 1 - src/MsgThread/View/src/ThreadListViewItem.cpp | 17 ++++---- 5 files changed, 58 insertions(+), 12 deletions(-) create mode 100755 edje/images/core_icon_badge_container.#.png diff --git a/edje/images/core_icon_badge_container.#.png b/edje/images/core_icon_badge_container.#.png new file mode 100755 index 0000000000000000000000000000000000000000..b999e469f8448af3ce42fc3a6b8f41a8539c66cb GIT binary patch literal 3217 zcmV;C3~uv@P)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{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+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c7f200000NkvXXu0mjf D#J%uz literal 0 HcmV?d00001 diff --git a/res/edje/icons.edc b/res/edje/icons.edc index 45999e8..b40962f 100755 --- a/res/edje/icons.edc +++ b/res/edje/icons.edc @@ -141,4 +141,54 @@ collections { } } } + group { + name: "badge"; + images { + image: "core_icon_badge_container.#.png" RAW; // TODO: replace image with 50x50px + } + parts + { + part{ name: "elm.image.count.bg"; + type:IMAGE; + scale: 1; + description { + state: "default" 0.0; + fixed: 0 1; + min: 50 50; + max: -1 50; + image { + normal:"core_icon_badge_container.#.png"; + } + color: 0 0 0 32; + + } + } + PADDING_LEFT("pad.left", 13); + PADDING_RIGHT("pad.right", 13); + part { name: "elm.text.count"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + align: 0.5 0.5; + rel1 { + relative: 1.0 0.5; + to_x: "pad.left"; + } + rel2 { + relative: 0.0 0.5; + to_x: "pad.right"; + } + color: 250 250 250 255; + text { + font: "Tizen:style=Regular"; + size: 32; + ellipsis: 0.0; + align: 0.5 0.5; + min: 1 0; + } + } + } + } + } } diff --git a/src/MsgThread/Controller/src/ThreadListItem.cpp b/src/MsgThread/Controller/src/ThreadListItem.cpp index fe07c51..d64b5f8 100644 --- a/src/MsgThread/Controller/src/ThreadListItem.cpp +++ b/src/MsgThread/Controller/src/ThreadListItem.cpp @@ -88,7 +88,7 @@ void ThreadListItem::update(const MsgThreadItem &threadItem) if(count > 0) { state = IconState; - m_UnreadCount = decorateUnreadText(std::to_string(count)); + m_UnreadCount = std::to_string(count); } } } diff --git a/src/MsgThread/View/inc/ThreadListViewItem.h b/src/MsgThread/View/inc/ThreadListViewItem.h index 0e65c68..38e8491 100644 --- a/src/MsgThread/View/inc/ThreadListViewItem.h +++ b/src/MsgThread/View/inc/ThreadListViewItem.h @@ -54,7 +54,6 @@ namespace Msg std::string decorateNameText(const std::string &text) const; std::string decorateMessageText(const std::string &text) const; std::string decorateTimeText(const std::string &text) const; - std::string decorateUnreadText(const std::string &text) const; std::string decorateFailedText(const std::string &text) const; std::string decorateSendingText(const std::string &text) const; std::string decorateDraftText(const std::string &text) const; diff --git a/src/MsgThread/View/src/ThreadListViewItem.cpp b/src/MsgThread/View/src/ThreadListViewItem.cpp index 47f9b2e..d9deb94 100644 --- a/src/MsgThread/View/src/ThreadListViewItem.cpp +++ b/src/MsgThread/View/src/ThreadListViewItem.cpp @@ -21,6 +21,7 @@ #include "ThumbnailMaker.h" #include "ListView.h" #include "TextDecorator.h" +#include "Resource.h" #include #include @@ -119,11 +120,12 @@ ThreadListViewItem::State ThreadListViewItem::getState() const Evas_Object *ThreadListViewItem::makeUnreadIcon(const std::string &text) const { - Evas_Object *label = elm_label_add(*getOwner()); - evas_object_show(label); - std::string decorText = TextDecorator::make(text, unreadTextStyle); - elm_object_text_set(label, decorText.c_str()); - return label; + if(text.empty()) + return nullptr; + Evas_Object *icon = View::addLayout(*getOwner(), ICONS_EDJ_PATH, "badge"); + elm_object_part_text_set(icon, "elm.text.count", text.c_str()); + evas_object_show(icon); + return icon; } std::string ThreadListViewItem::getStatus() @@ -154,11 +156,6 @@ std::string ThreadListViewItem::decorateTimeText(const std::string &text) const return text; } -std::string ThreadListViewItem::decorateUnreadText(const std::string &text) const -{ - return TextDecorator::make(text, unreadTextStyle); -} - std::string ThreadListViewItem::decorateFailedText(const std::string &text) const { return TextDecorator::make(text, failedTextStyle); -- 2.7.4