#define IMAGE_PATH "images"
#define MORE_OPTION_DIR "More_option_icon"
-// Res images
+// Edj images:
#define ATTACH_VOICE_ICON "thread_view_msg_att_voice.png"
#define ATTACH_MUSIC_ICON "thread_view_msg_att_music.png"
#define ATTACH_CALENDAR_ICON "thread_view_msg_att_schedule.png"
#define ATTACH_CONTACT_ICON "thread_view_msg_att_vcf.png"
+#define TEST_IMAGE_PATH "images/cat.png"
-// Edj images:
#define NEW_MSG_MORE_ICON MORE_OPTION_DIR"/b_more_option_ic_compose.png"
#define DELETEG_MORE_ICON MORE_OPTION_DIR"/b_more_option_ic_delete.png"
#define ADD_TO_SPAM_MORE_ICON MORE_OPTION_DIR"/b_more_option_ic_add_to_spam.png"
#define THUMB_CONTACT_IMG_PATH IMAGE_PATH"/messages_list_thumb_image_single.png"
#define THUMB_GROUP_IMG_PATH IMAGE_PATH"/messages_list_thumb_image_multi.png"
+
// Edj:
#define ICONS_EDJ_PATH EDJ_PATH"/icons.edj"
#define IMAGES_EDJ_PATH EDJ_PATH"/images.edj"
#define SEARCH_BAR_EDJ_PATH EDJ_PATH"/search_bar.edj"
#define CONV_GENLIST_THEME_EDJ_PATH EDJ_PATH"/conv_genlist_theme.edj"
#define INPUT_LAYOUT_EDJ_PATH EDJ_PATH"/input_layout.edj"
+#define CONV_LIST_BUBBLE_EDJ_PATH EDJ_PATH"/conv_list_bubble.edj"
#endif /* RESOURCE_H_ */
#define ENTRY_BUBBLE_TEXT_SIZE 20
#define DATELINE_TEXT_SIZE 24
#define REPLY_TEXT_SIZE 24
-#define MAIN_TEXT_SIZE 28
-#define BUBBLE_CONTENT_WIDTH_MAX 240
#define BUBBLE_CONTENT_WIDTH_MIN 78
#define BUBBLE_CONTENT_HEIGHT_MIN 37
base: "font=Tizen:weight=Normal:width=Condensed font_size="REPLY_TEXT_SIZE" text_class=tizen color=#fafafa align=center";
tag: "match" "+ color=#006EFF";
}
- style {
- name: "textblock_style";
- base: "font=Tizen:weight=Normal:width=Condensed font_size="MAIN_TEXT_SIZE" color=#000 wrap=mixed text_class=tizen align=left";
- tag: "match" "+ color=#006EFF";
- }
- style {
- name: "mms_attachment_text_style";
- base: "font=Tizen:weight=Normal:width=Condensed font_size="20" text_class=tizen wrap=mixed color=#000 align=left";
- tag: "match" "+ color=#006EFF";
- }
}
group { name: "elm/genlist/item/sentbubble/default";
}
}
}
- group { name: "conv/list/1icon_1text";
- parts {
- spacer { "padding.left"; scale;
- desc { "default";
- min: 3 0;
- max: 3 -1;
- align: 0.0 0.5;
- rel1.to_x: "icon";
- rel1.relative: 1.0 0.0;
- rel2.relative: 1.0 1.0;
- }
- }
- PADDING_TOP("padding.top", 3);
- textblock { "main.text"; scale;
- desc { "default";
- align: 0 0;
- rel1.to_x : "padding.left";
- rel1.to_y: "padding.top";
- rel1.relative: 1.0 1.0;
- min: 204 26;
- max: 204 -1;
- text {
- style: "mms_attachment_text_style";
- min: 1 1;
- align: 0.0 0;
- ellipsis: -1;
- }
- }
- }
- swallow { "icon"; scale;
- desc { "default";
- min: 33 32;
- max: 33 32;
- align: 0.0 0.0;
- rel1.relative: 0.0 0.0;
- rel2.relative: 1.0 1.0;
- }
- }
- }
- }
- group { name: "elm/label/base/conv_bubble";
- parts {
- rect { "label.text.clip"; scale;
- desc { "default";}
- }
- textblock { "elm.text"; scale;
- clip_to: "label.text.clip";
- desc { "default";
- text {
- style: "textblock_style";
- min: 0 1;
- align: 0.0 0.0;
- }
- }
- }
- }
- }
- group { name: "conv/list/bubble_item_bg";
- parts {
- spacer { "bg"; scale;
- desc { "default";
- }
- desc { "pressed";
- inherit: "default";
- }
- }
- swallow { "content"; scale;
- desc { "default";
- }
- }
- swallow { "swl.gesture"; scale;
- repeat_events: 1;
- desc { "default";
- rel.to: "bg";
- }
- }
- }
- programs {
- program { name: "pressed";
- signal: "mouse,down,1";
- source: "content";
- action: STATE_SET "pressed" 0.0;
- transition: LINEAR 0.1;
- target: "bg";
- }
- program { name: "unpressed";
- signal: "mouse,up,1";
- source: "content";
- action: STATE_SET "default" 0.0;
- transition: LINEAR 0.1;
- target: "bg";
- }
- }
- }
- group { "conv/list/bubble_subject_item";
- parts {
- swallow { "text.swl"; scale;
- desc { "default";
- align: 0 0;
- }
- }
- spacer { "pad.bottom"; scale;
- desc { "default";
- min: 0 6;
- max: -1 6;
- rel1.to_y: "text.swl";
- rel1.relative: 0 1;
- align: 0 0;
- }
- }
- rect { "divider"; scale;
- desc { "default";
- min: 240 1;
- max: 240 1;
- rel1.to_y: "pad.bottom";
- rel1.relative: 0 1;
- align: 0 0;
- color: 0 0 0 68;
- }
- }
- }
- }
}
--- /dev/null
+
+#include "macros.inl"
+#include "colors_define.inl"
+
+#define MAIN_TEXT_SIZE 28
+#define ATTACHMENTS_TEXT_SIZE 20
+
+#define MAX_CONTENT_WIDTH 240
+#define PLAY_BUTTON_SIZE 110
+
+collections {
+
+ BASE_SCALE;
+
+ plugins {
+ TOUCH_SOUND_PLUGIN;
+ }
+
+ images {
+ image: "thread_view_msg_att_video_play.png" RAW;
+ image: "thread_view_msg_att_video_play_ef.png" RAW;
+ }
+
+ styles {
+ style {
+ name: "textblock_style";
+ base: "font=Tizen:weight=Normal:width=Condensed font_size="MAIN_TEXT_SIZE" color=#000 wrap=mixed text_class=tizen align=left";
+ tag: "match" "+ color=#006EFF";
+ }
+ style {
+ name: "mms_attachment_text_style";
+ base: "font=Tizen:weight=Normal:width=Condensed font_size="ATTACHMENTS_TEXT_SIZE" text_class=tizen wrap=mixed color=#000 align=left";
+ tag: "match" "+ color=#006EFF";
+ }
+ }
+ group { name: "conv/list/1icon_1text";
+ parts {
+ spacer { "padding.left"; scale;
+ desc { "default";
+ min: 3 0;
+ max: 3 -1;
+ align: 0.0 0.5;
+ rel1.to_x: "icon";
+ rel1.relative: 1.0 0.0;
+ rel2.relative: 1.0 1.0;
+ }
+ }
+ PADDING_TOP("padding.top", 3);
+ textblock { "main.text"; scale;
+ desc { "default";
+ align: 0 0;
+ rel1.to_x : "padding.left";
+ rel1.to_y: "padding.top";
+ rel1.relative: 1.0 1.0;
+ min: 204 26;
+ max: 204 -1;
+ text {
+ style: "mms_attachment_text_style";
+ min: 1 1;
+ align: 0.0 0;
+ ellipsis: -1;
+ }
+ }
+ }
+ swallow { "icon"; scale;
+ desc { "default";
+ min: 33 32;
+ max: 33 32;
+ align: 0.0 0.0;
+ rel1.relative: 0.0 0.0;
+ rel2.relative: 1.0 1.0;
+ }
+ }
+ }
+ }
+ group { name: "elm/label/base/conv_bubble";
+ parts {
+ rect { "label.text.clip"; scale;
+ desc { "default";}
+ }
+ textblock { "elm.text"; scale;
+ clip_to: "label.text.clip";
+ desc { "default";
+ text {
+ style: "textblock_style";
+ min: 0 1;
+ align: 0.0 0.0;
+ }
+ }
+ }
+ }
+ }
+ group { name: "conv/list/bubble_item_bg";
+ parts {
+ spacer { "bg"; scale;
+ desc { "default";
+ }
+ desc { "pressed";
+ inherit: "default";
+ }
+ }
+ swallow { "content"; scale;
+ desc { "default";
+ }
+ }
+ swallow { "swl.gesture"; scale;
+ repeat_events: 1;
+ desc { "default";
+ rel.to: "bg";
+ }
+ }
+ }
+ programs {
+ program { name: "pressed";
+ signal: "mouse,down,1";
+ source: "content";
+ action: STATE_SET "pressed" 0.0;
+ transition: LINEAR 0.1;
+ target: "bg";
+ }
+ program { name: "unpressed";
+ signal: "mouse,up,1";
+ source: "content";
+ action: STATE_SET "default" 0.0;
+ transition: LINEAR 0.1;
+ target: "bg";
+ }
+ }
+ }
+ group { "conv/list/bubble_subject_item";
+ parts {
+ swallow { "text.swl"; scale;
+ desc { "default";
+ align: 0 0;
+ }
+ }
+ spacer { "pad.bottom"; scale;
+ desc { "default";
+ min: 0 6;
+ max: -1 6;
+ rel1.to_y: "text.swl";
+ rel1.relative: 0 1;
+ align: 0 0;
+ }
+ }
+ rect { "divider"; scale;
+ desc { "default";
+ min: MAX_CONTENT_WIDTH 1;
+ max: MAX_CONTENT_WIDTH 1;
+ rel1.to_y: "pad.bottom";
+ rel1.relative: 0 1;
+ align: 0 0;
+ color: 0 0 0 68;
+ }
+ }
+ }
+ }
+ group {
+ name: "conv/list/video_item";
+ images {
+ image: "thread_view_msg_att_video_play.png" COMP;
+ image: "thread_view_msg_att_video_play_ef.png" COMP;
+ }
+ parts {
+ swallow { "content"; scale;
+ desc { "default";
+ }
+ }
+ image { "play_button_ef"; scale;
+ repeat_events: 1;
+ desc { "default";
+ image.normal: "thread_view_msg_att_video_play_ef.png";
+ min: PLAY_BUTTON_SIZE PLAY_BUTTON_SIZE;
+ max: PLAY_BUTTON_SIZE PLAY_BUTTON_SIZE;
+ color: 0 0 0 26;
+ rel.to: "content";
+ }
+ desc { "pressed";
+ inherit: "default";
+ color: 0 0 0 13;
+ }
+ }
+ image { "play_button"; scale;
+ repeat_events: 1;
+ desc { "default";
+ image.normal: "thread_view_msg_att_video_play.png";
+ min: PLAY_BUTTON_SIZE PLAY_BUTTON_SIZE;
+ max: PLAY_BUTTON_SIZE PLAY_BUTTON_SIZE;
+ rel.to: "play_button_ef";
+ color: 250 250 250 255;
+ }
+ desc { "pressed";
+ inherit: "default";
+ color: 250 250 250 102;
+ }
+ }
+ }
+ programs {
+ program { name: "pressed";
+ signal: "mouse,down,1";
+ source: "play_button";
+ action: STATE_SET "pressed" 0.0;
+ transition: LINEAR 0.1;
+ target: "play_button";
+ target: "play_button_ef";
+ }
+ program { name: "unpressed";
+ signal: "mouse,up,1";
+ source: "play_button";
+ action: STATE_SET "default" 0.0;
+ transition: LINEAR 0.1;
+ target: "play_button";
+ target: "play_button_ef";
+ }
+ }
+ }
+}
+
--- /dev/null
+/*
+ * Copyright 2016 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef BubbleImageEntity_h_
+#define BubbleImageEntity_h_
+
+#include "BubbleImageViewItem.h"
+#include "BubbleEntity.h"
+
+namespace Msg {
+ class BubbleImageEntity
+ : public BubbleEntity {
+ public:
+ BubbleImageEntity(const std::string &filePath, Message::Direction direction);
+ virtual ~BubbleImageEntity();
+
+ virtual BubbleImageViewItem *createView(Evas_Object *parent);
+ };
+
+
+ inline BubbleImageEntity::BubbleImageEntity(const std::string &filePath, Message::Direction direction)
+ : BubbleEntity(ImageItem, direction, filePath)
+ {
+ }
+
+ inline BubbleImageEntity::~BubbleImageEntity()
+ {
+ }
+
+ inline BubbleImageViewItem *BubbleImageEntity::createView(Evas_Object *parent)
+ {
+ auto *item = new BubbleImageViewItem(*this, parent, getFilePath());
+ return item;
+ }
+}
+
+#endif /* BubbleImageEntity_h_ */
--- /dev/null
+/*
+ * Copyright 2016 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef BubbleVideoEntity_h_
+#define BubbleVideoEntity_h_
+
+#include "BubbleVideoViewItem.h"
+#include "BubbleEntity.h"
+
+namespace Msg {
+ class BubbleVideoEntity
+ : public BubbleEntity {
+ public:
+ BubbleVideoEntity(const std::string &filePath, Message::Direction direction);
+ virtual ~BubbleVideoEntity();
+
+ virtual BubbleVideoViewItem *createView(Evas_Object *parent);
+
+ private:
+ std::string m_ImgPath;
+ };
+}
+
+#endif /* BubbleVideoEntity_h_ */
--- /dev/null
+/*
+ * Copyright 2016 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "BubbleVideoEntity.h"
+#include "MediaUtils.h"
+#include "FileUtils.h"
+
+using namespace Msg;
+
+
+BubbleVideoEntity::BubbleVideoEntity(const std::string &filePath, Message::Direction direction)
+ : BubbleEntity(VideoItem, direction, filePath)
+{
+ // TODO: when video player will be available
+ m_ImgPath = filePath;
+}
+
+BubbleVideoEntity::~BubbleVideoEntity()
+{
+}
+
+BubbleVideoViewItem *BubbleVideoEntity::createView(Evas_Object *parent)
+{
+ auto *item = new BubbleVideoViewItem(*this, parent, m_ImgPath);
+ return item;
+}
+
#include "ConvTitleListItem.h"
#include "ConvDateLineListItem.h"
#include "TimeUtils.h"
+#include "BubbleEntityFactory.h"
using namespace Msg;
--- /dev/null
+/*
+ * Copyright 2016 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef BubbleImageViewItem_h_
+#define BubbleImageViewItem_h_
+
+#include "BubbleViewItem.h"
+
+namespace Msg {
+ class BubbleImageViewItem
+ : public BubbleViewItem {
+ public:
+ BubbleImageViewItem(BubbleEntity &entity, Evas_Object *parent, const std::string &imagePath);
+ virtual ~BubbleImageViewItem();
+
+ static Evas_Object *createImage(Evas_Object *parent, const std::string &path);
+ };
+}
+
+#endif /* BubbleImageViewItem_h_ */
--- /dev/null
+/*
+ * Copyright 2016 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef BubbleVideoViewItem_h_
+#define BubbleVideoViewItem_h_
+
+#include "BubbleViewItem.h"
+#include "BubbleImageViewItem.h"
+
+namespace Msg {
+ class BubbleVideoViewItem
+ : public BubbleViewItem {
+ public:
+ BubbleVideoViewItem(BubbleEntity &entity, Evas_Object *parent, const std::string &imagePath);
+ virtual ~BubbleVideoViewItem();
+
+ void calculate() override;
+
+ private:
+ Evas_Object *m_pVideoLayout;
+ };
+
+
+ inline BubbleVideoViewItem::BubbleVideoViewItem(BubbleEntity &entity, Evas_Object *parent, const std::string &imagePath)
+ : BubbleViewItem(parent, entity)
+ , m_pVideoLayout(nullptr)
+ {
+ m_pVideoLayout = addLayout(parent, CONV_LIST_BUBBLE_EDJ_PATH, "conv/list/video_item");
+ Evas_Object *image = BubbleImageViewItem::createImage(m_pVideoLayout, imagePath);
+ View::setContent(m_pVideoLayout, image, "content");
+ setContent(m_pVideoLayout);
+ attachGestureTapLayer(m_pVideoLayout, image);
+ }
+
+ inline BubbleVideoViewItem::~BubbleVideoViewItem()
+ {
+ }
+
+ inline void BubbleVideoViewItem::calculate()
+ {
+ evas_object_smart_calculate(m_pVideoLayout);
+ BubbleViewItem::calculate();
+ }
+}
+
+#endif /* BubbleVideoViewItem_h_ */
: BubbleViewItem(parent, entity)
, m_pIconTextLayout(nullptr)
{
- m_pIconTextLayout = addLayout(getEo(), CONV_GENLIST_THEME_EDJ_PATH, "conv/list/1icon_1text");
+ m_pIconTextLayout = addLayout(getEo(), CONV_LIST_BUBBLE_EDJ_PATH, "conv/list/1icon_1text");
setContent(m_pIconTextLayout);
}
--- /dev/null
+/*
+ * Copyright 2016 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "BubbleImageViewItem.h"
+#include "Resource.h"
+#include "Logger.h"
+
+using namespace Msg;
+
+BubbleImageViewItem::BubbleImageViewItem(BubbleEntity &entity, Evas_Object *parent, const std::string &imagePath)
+ : BubbleViewItem(parent, entity)
+{
+ Evas_Object *img = createImage(parent, imagePath);
+ setContent(img);
+ attachGestureTapLayer(getEo(), img);
+}
+
+BubbleImageViewItem::~BubbleImageViewItem()
+{
+}
+
+Evas_Object *BubbleImageViewItem::createImage(Evas_Object *parent, const std::string &path)
+{
+ int imageWidth = 0;
+ int imageHeight = 0;
+
+ Evas_Object *image = elm_image_add(parent);
+ elm_image_preload_disabled_set(image, true);
+ elm_image_prescale_set(image, maxWidth);
+ elm_image_aspect_fixed_set(image, true);
+ elm_image_file_set(image, path.c_str(), nullptr);
+ elm_image_object_size_get(image, &imageWidth, &imageHeight);
+
+ double scale = maxWidth / (double)imageWidth;
+ imageWidth *= scale;
+ imageHeight *= scale;
+
+ evas_object_size_hint_min_set(image, imageWidth, imageHeight);
+ evas_object_size_hint_align_set(image, 1.0, EVAS_HINT_FILL);
+ evas_object_show(image);
+ return image;
+}
#include "BubbleTextViewItem.h"
#include "Resource.h"
#include "Logger.h"
+#include "TextDecorator.h"
using namespace Msg;
+const std::string textColor = "#000";
+
BubbleSubjectViewItem::BubbleSubjectViewItem(BubbleEntity &entity, Evas_Object *parent)
: BubbleViewItem(parent, entity)
, m_pTextLayout(nullptr)
{
- m_pTextLayout = addLayout(getEo(), CONV_GENLIST_THEME_EDJ_PATH, "conv/list/bubble_subject_item");
+ m_pTextLayout = addLayout(getEo(), CONV_LIST_BUBBLE_EDJ_PATH, "conv/list/bubble_subject_item");
setContent(m_pTextLayout);
}
void BubbleSubjectViewItem::setText(const std::string &text)
{
- View::setContent(m_pTextLayout, BubbleTextViewItem::createText(m_pTextLayout, text), "text.swl");
+ View::setContent(m_pTextLayout, BubbleTextViewItem::createText(m_pTextLayout, TextDecorator::make(text, textColor)), "text.swl");
}
void BubbleSubjectViewItem::calculate()
: m_Entity(entity)
, m_pListener(nullptr)
{
- setEo(addLayout(parent, CONV_GENLIST_THEME_EDJ_PATH, "conv/list/bubble_item_bg"));
+ setEo(addLayout(parent, CONV_LIST_BUBBLE_EDJ_PATH, "conv/list/bubble_item_bg"));
View::setContent(createGestureRect(getEo()), "swl.gesture");
evas_object_size_hint_align_set(getEo(), 1.0, EVAS_HINT_FILL);
}