TizenRefApp-6384 Add type of message to conversation-item 16/71516/1
authorDenis Dolzhenko <d.dolzhenko@samsung.com>
Wed, 25 May 2016 15:21:40 +0000 (18:21 +0300)
committerDenis Dolzhenko <d.dolzhenko@samsung.com>
Wed, 25 May 2016 15:21:40 +0000 (18:21 +0300)
Change-Id: I2cb7b71cf5aafdbd9de93424239a88a9e7337d96
Signed-off-by: Denis Dolzhenko <d.dolzhenko@samsung.com>
res/edje/bubble_theme.edc
src/Conversation/ConvList/Controller/inc/ConvListItem.h
src/Conversation/ConvList/Controller/src/ConvListItem.cpp
src/Conversation/ConvList/View/inc/ConvListViewItem.h
src/Conversation/ConvList/View/src/ConvListViewItem.cpp

index a096753..fddbe0c 100755 (executable)
@@ -1,6 +1,7 @@
 #include "colors_define.inl"
 #define ENTRY_BUBBLE_TEXT_SIZE 30
 
+#define BUBBLE_MSG_TYPE_PAD_WIDTH 8
 #define BUBBLE_INFO_HEIGHT 88
 #define BUBBLE_CONTENT_WIDTH_MAX 340
 #define BUBBLE_BG_IMAGE_MIN_WIDTH 120
@@ -103,7 +104,7 @@ group { name: "elm/genlist/item/sentbubble/default";
     alias: "elm/genlist/item_compress/sentbubble/default";
 
     data.item: "banded_bg_area" "elm.swallow.bg";
-    data.item: "texts" "info.time";
+    data.item: "texts" "info.time msg.type";
     data.item: "contents" "bubble.content info.status info.status1 bubble.check";
     parts{
         spacer { "base"; scale; mouse;
@@ -172,16 +173,49 @@ group { name: "elm/genlist/item/sentbubble/default";
                 fixed: 1 1;
             }
         }
-        textblock { "info.time"; scale;
+        textblock { "msg.type"; scale;
             desc { "default";
-                align: 0.0 0.0;
-                min: 0 BUBBLE_INFO_TEXT_HEIGHT;
-                max: -1 BUBBLE_INFO_TEXT_HEIGHT;
+                align: 1.0 0.0;
+                rel1.to_x: "bubble.pad.right";
                 rel2.to_x: "bubble.pad.right";
                 rel1.to_y: "info.status";
-                rel1.relative: 0.0 1.0;
+                rel2.to_y: "info.status";
+                rel1.relative: 1.0 1.0;
                 rel2.relative: 1.0 1.0;
-                text.style: "entry_bubble_sent_textblock_style";
+                text{
+                    style: "entry_bubble_sent_textblock_style";
+                    min: 1 1;
+                    ellipsis: -1;
+                    text: "SMS";
+                }
+            }
+        }
+        spacer { "msg.type.pad"; scale;
+            desc { "default"
+                min: BUBBLE_MSG_TYPE_PAD_WIDTH 0;
+                max: BUBBLE_MSG_TYPE_PAD_WIDTH -1;
+                align: 1.0 0.0;
+                rel1.to_x: "msg.type";
+                rel2.to_x: "msg.type";
+                rel1.relative: 0.0 0.0;
+                rel2.relative: 0.0 1.0;
+                fixed: 1 1;
+            }
+        }
+        textblock { "info.time"; scale;
+            desc { "default";
+                align: 1.0 0.0;
+                rel1.to_x: "msg.type.pad";
+                rel2.to_x: "msg.type.pad";
+                rel1.to_y: "info.status";
+                rel2.to_y: "info.status";
+                rel1.relative: 0.0 1.0;
+                rel2.relative: 0.0 1.0;
+                text{
+                    style: "entry_bubble_sent_textblock_style";
+                    min: 1 1;
+                    ellipsis: -1;
+                }
             }
         }
         spacer { "pad.left"; scale;
@@ -509,7 +543,31 @@ group { name: "elm/genlist/item/receivebubble/default";
                 align: 0.0 0.0;
                 rel1.to_x: "info.thumb.pad";
                 rel1.relative: 1.0 1.0;
-                rel2.to_x: "";
+                rel2.to_x: "info.thumb.pad";
+                rel2.relative: 1.0 1.0;
+                text.style: "entry_bubble_receive_textblock_style";
+            }
+        }
+        spacer { "msg.type.pad"; scale;
+            desc { "default"
+                min: BUBBLE_MSG_TYPE_PAD_WIDTH 0;
+                max: BUBBLE_MSG_TYPE_PAD_WIDTH -1;
+                align: 0.0 0.0;
+                rel1.to_x: "info.time";
+                rel2.to_x: "info.time";
+                rel1.relative: 1.0 0.0;
+                rel2.relative: 1.0 1.0;
+                fixed: 1 1;
+            }
+        }
+        textblock { "msg.type"; scale;
+            desc { "default";
+                align: 0.0 0.0;
+                rel1.to_x: "msg.type.pad";
+                rel2.to_x: "msg.type.pad";
+                rel1.to_y: "info.time";
+                rel2.to_y: "info.time";
+                rel1.relative: 1.0 0.0;
                 rel2.relative: 1.0 1.0;
                 text.style: "entry_bubble_receive_textblock_style";
             }
index 0db5811..4756d7c 100644 (file)
@@ -78,6 +78,7 @@ namespace Msg
             virtual Evas_Object *getThumbnail();
             virtual Evas_Object *getProgress();
             virtual std::string getTime();
+            virtual std::string getMsgType();
 
             virtual void onEditButtonClicked(Evas_Object *obj, void *event_info);
             virtual void onFailedButtonClicked(Evas_Object *obj, void *event_info);
index ce2b298..8b55b51 100644 (file)
@@ -241,6 +241,12 @@ std::string ConvListItem::getTime()
     return m_TimeStr;
 }
 
+std::string ConvListItem::getMsgType()
+{
+    // TODO: localization for "SMS"
+    return MsgUtils::isMms(m_Type) ? (std::string)msg("IDS_MSGF_BODY_MMS") : msg("SMS");
+}
+
 MsgId ConvListItem::getMsgId() const
 {
     return m_MsgId;
index 884e9f6..4f80687 100644 (file)
@@ -42,6 +42,7 @@ namespace Msg
             virtual Evas_Object *getThumbnail() = 0;
             virtual Evas_Object *getProgress() = 0;
             virtual std::string getTime() = 0;
+            virtual std::string getMsgType() = 0;
 
             virtual void onEditButtonClicked(Evas_Object *obj, void *event_info) = 0;
             virtual void onFailedButtonClicked(Evas_Object *obj, void *event_info) = 0;
index b821ff6..bb5a043 100644 (file)
@@ -36,6 +36,7 @@ namespace
     const char *draftButtonPart = "draft.button";
     const char *failedButtonPart = "failed.button";
     const char *infoStatus = "info.status";
+    const char *msgType = "msg.type";
 
     const char *draftButtonStyle = "edit_button";
     const char *failedButtonStyle = "resend_button";
@@ -57,6 +58,8 @@ std::string ConvListViewItem::getText(ListItem &item, const char *part)
 {
     if(!strcmp(part, timeTextPart))
         return getTime();
+    else if(!strcmp(part, msgType))
+        return getMsgType();
     else
         return "";
 }