#include "macros.inl"
+#define COLOR_BLUE_EDC 2 61 132 255
+
collections {
BASE_SCALE;
-group {
+ #define MAX_TEXT_LEN 300
+ styles {
+ style {
+ name: "main_text_style";
+ base: "font=Tizen:style=Roman font_size="32" color=#000000 left_margin=1 right_margin=2 wrap=mixed ellipsis=1 align=left";
+ tag: "tab" "\t";
+ tag: "em" "+ font=Tizen:style=Oblique";
+ tag: "b" "+ font=Tizen:style=Bold";
+ tag: "link" "+ color=#800 underline=on underline_color=#8008";
+ tag: "hilight" "+ font=Tizen:style=Bold";
+ tag: "match" "+ color=#FFFFFF color_class=T1067";
+ }
+ style {
+ name: "sub_text_style";
+ base: "font=Tizen:style=Roman font_size="30" color=#000000 left_margin=1 right_margin=2 wrap=mixed ellipsis=1 align=left";
+ tag: "tab" "\t";
+ tag: "em" "+ font=Tizen:style=Oblique";
+ tag: "b" "+ font=Tizen:style=Bold";
+ tag: "link" "+ color=#800 underline=on underline_color=#8008";
+ tag: "hilight" "+ font=Tizen:style=Bold";
+ tag: "match" "+ color=#FFFFFF color_class=T1067";
+ }
+ }
+ group {
+ name: "conv/list/1icon_1text_attachment";
+ parts {
+ part {
+ name: "padding.left";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 6 0;
+ max: 6 -1;
+ align: 0.0 0.5;
+ rel1 { to_x: "icon"; relative: 1.0 0.0; }
+ rel2 { relative: 1.0 1.0; }
+ }
+ }
+ part {
+ name: "main.text";
+ type: TEXTBLOCK;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ align: 0.0 0.5;
+ rel1 { to_x : "padding.left"; relative: 1.0 0.0; }
+ max: MAX_TEXT_LEN 48;
+ text{
+ style: "main_text_style";
+ min: 1 1;
+ align: 0.0 0.5;
+ }
+ }
+ }
+ part {
+ name: "icon";
+ type: SWALLOW;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 50 50;
+ max: 50 50;
+ align: 0.0 0.5;
+ rel1 { relative: 0.0 0.0; }
+ rel2 { relative: 1.0 1.0; }
+ }
+ }
+ }
+ }
+ group {
+ name: "conv/list/1icon_2text_attachment";
+ inherit: "conv/list/1icon_1text_attachment";
+ parts {
+ PADDING_TOP("padding.top", 10);
+ PADDING_BOTTOM("padding.bottom", 16);
+ part {
+ name: "main.text";
+ type: TEXTBLOCK;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ rel1 { to_x : "padding.left"; to_y: "padding.top"; relative: 1.0 1.0; }
+ }
+ }
+ part {
+ name: "sub.text";
+ type: TEXTBLOCK;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ visible: 1;
+ align: 0.0 0.0;
+ rel1 { to : "padding.left"; to_y: "main.text"; relative: 1.0 1.0; }
+ max: MAX_TEXT_LEN 43;
+ text{
+ style: "sub_text_style";
+ min: 1 1;
+ align: 0.0 0.5;
+ }
+ }
+ }
+ }
+ }
++ group {
+ name: "conv/list/attachments/video_item";
+ images {
- image: "00_video_play.png" COMP;
++ image: "messages_play_btn.png" COMP;
+ }
+ parts {
- PADDING_TOP("padding_top", 0);
- PADDING_LEFT("padding_left", 5);
- 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;
- 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;
- }
- }
+ part {
- name: "rect.thumbnail";
- type: SPACER;
++ name: "swl.thumbnail";
++ type: SWALLOW;
+ 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;
- image.normal: "00_video_play.png";
++ image.normal: "messages_play_btn.png";
++ max: 128 128;
+ align: 0.5 0.5;
- min: 48 48;
+ rel1 {
+ to: "swl.thumbnail";
- relative: 0.5 0.5;
- offset: -36 -36;
++ relative: 0.0 0.0;
+ }
+ rel2 {
+ to: "swl.thumbnail";
- relative: 0.5 0.5;
- offset: 36 36;
++ relative: 1.0 1.0;
+ }
+ }
+ }
+ }
+ }
}
--- /dev/null
- Evas_Object *createImage(Evas_Object *parent, const std::string &path);
+/*
+ * Copyright (c) 2009-2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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"
+
+namespace Msg
+{
+ class BubbleVideoViewItem
+ : public BubbleViewItem
+ {
+ public:
+ BubbleVideoViewItem(BubbleEntity &entity, Evas_Object *parent, const std::string &imagePath);
+ virtual ~BubbleVideoViewItem();
+
+ private:
++ Evas_Object *createLayout(Evas_Object *parent, const std::string &path);
+ };
+}
+
+#endif /* BubbleVideoViewItem_h_ */
--- /dev/null
- Evas_Object *img = createImage(parent, imagePath);
- attachGestureTapLayer(img, img);
- setEo(img);
+/*
+ * Copyright (c) 2009-2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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 "BubbleVideoViewItem.h"
++#include "Resource.h"
+
+using namespace Msg;
+
+BubbleVideoViewItem::BubbleVideoViewItem(BubbleEntity &entity, Evas_Object *parent, const std::string &imagePath)
+ : BubbleViewItem(entity)
+{
- Evas_Object *BubbleVideoViewItem::createImage(Evas_Object *parent, const std::string &path)
++ Evas_Object *layout = createLayout(parent, imagePath);
++ setEo(layout);
++ attachGestureTapLayer(layout, layout);
++ show();
+}
+
+BubbleVideoViewItem::~BubbleVideoViewItem()
+{
+}
+
- Evas_Object *image = elm_image_add(parent);
++Evas_Object *BubbleVideoViewItem::createLayout(Evas_Object *parent, const std::string &path)
+{
- evas_object_size_hint_align_set(image, 0.0, EVAS_HINT_FILL);
- return image;
++ Evas_Object *layout = addLayout(parent, CONV_LIST_ATTACHMENTS_EDJ_PATH, "conv/list/attachments/video_item");
++ Evas_Object *image = elm_image_add(layout);
+ elm_image_file_set(image, path.c_str(), nullptr);
+ int imageWidth = 0;
+ int imageHeight = 0;
+ elm_image_object_size_get(image, &imageWidth, &imageHeight);
+ if(imageWidth > maxWidth)
+ {
+ double scale = maxWidth/(double)imageWidth;
+ imageWidth *= scale;
+ imageHeight *= scale;
+ }
+ evas_object_size_hint_min_set(image, imageWidth, imageHeight);
+ evas_object_show(image);
++
++ elm_object_part_content_set(layout, "swl.thumbnail", image);
++ return layout;
+}