TizenRefApp-8165 Implement ConReplyListItem for message conversation. 95/119595/3
authorOleksander Kostenko <o.kostenko@samsung.com>
Fri, 17 Mar 2017 11:46:56 +0000 (13:46 +0200)
committerDenis Dolzhenko <d.dolzhenko@samsung.com>
Mon, 20 Mar 2017 09:47:48 +0000 (02:47 -0700)
Change-Id: I6a737f4fff83719e3edca8785d3e116c0e1c7c4e
Signed-off-by: Oleksander Kostenko <o.kostenko@samsung.com>
res/edje/conv_genlist_theme.edc
res/edje/icons.edc
src/Conversation/ConvList/View/inc/ConvReplyListItem.h [new file with mode: 0644]
src/Conversation/ConvList/View/src/ConvReplyListItem.cpp [new file with mode: 0644]
src/Conversation/Main/Controller/inc/ConvFrame.h
src/Conversation/Main/Controller/src/ConvFrame.cpp

index 08d44e513dcb90eed7fc21d48af177c8de164963..34419c55ed11352aa26bb08219d2065739159c60 100644 (file)
@@ -1,34 +1,37 @@
 #include "macros.inl"
 #include "colors_define.inl"
 
-#define ENTRY_BUBBLE_TEXT_SIZE 20
-#define DATELINE_TEXT_SIZE 24
+#define ENTRY_BUBBLE_TEXT_SIZE               20
+#define DATELINE_TEXT_SIZE                   24
+#define REPLY_TEXT_SIZE                      24
 
-#define BUBBLE_CONTENT_WIDTH_MAX 240
-#define BUBBLE_CONTENT_WIDTH_MIN 78
-#define BUBBLE_CONTENT_HEIGHT_MIN 37
+#define BUBBLE_CONTENT_WIDTH_MAX             240
+#define BUBBLE_CONTENT_WIDTH_MIN             78
+#define BUBBLE_CONTENT_HEIGHT_MIN            37
 
-#define BUBBLE_CONTENT_PAD_TOP_HEIGHT 5
-#define BUBBLE_CONTENT_PAD_BOTTOM_HEIGHT 4
-#define BUBBLE_CONTENT_PAD_LEFT_WIDTH 17
-#define BUBBLE_CONTENT_PAD_RIGHT_WIDTH 26
+#define BUBBLE_CONTENT_PAD_TOP_HEIGHT        5
+#define BUBBLE_CONTENT_PAD_BOTTOM_HEIGHT     4
+#define BUBBLE_CONTENT_PAD_LEFT_WIDTH        17
+#define BUBBLE_CONTENT_PAD_RIGHT_WIDTH       26
 
-#define BUBBLE_PAD_BOTTOM_HEIGHT 15
-#define BUBBLE_PAD_LEFT_WIDTH 60
-#define BUBBLE_PAD_RIGHT_WIDTH 34
-#define BUBBLE_PAD_CHECK_WIDTH 32
+#define BUBBLE_PAD_BOTTOM_HEIGHT             15
+#define BUBBLE_PAD_LEFT_WIDTH                60
+#define BUBBLE_PAD_RIGHT_WIDTH               34
+#define BUBBLE_PAD_CHECK_WIDTH               32
 
-#define DATELINE_TOP_PADDING 11
-#define DATELINE_BOTTOM_PADDING 26
+#define DATELINE_TOP_PADDING                 11
+#define DATELINE_BOTTOM_PADDING              26
 
-#define DATELINE_SIDE_PADDING 32
-#define DATELINE_CENTER_PADDING 12
+#define DATELINE_SIDE_PADDING                32
+#define DATELINE_CENTER_PADDING              12
 
-#define DATELINE_HEIGHT 32
+#define DATELINE_HEIGHT                      32
 
-#define DIVIDER_TOP_PADDING 15
-#define DIVIDER_BOTTOM_PADDING 15
-#define DIVIDER_HEIGHT 2
+#define DIVIDER_TOP_PADDING                  15
+#define DIVIDER_BOTTOM_PADDING               15
+#define DIVIDER_HEIGHT                       2
+
+#define REPLY_SWALLOW_SIZE                   89
 
 collections {
 
@@ -63,6 +66,11 @@ collections {
          base: "font=Tizen:weight=Normal:width=Condensed font_size="DATELINE_TEXT_SIZE" text_class=tizen color=#ffae0d align=center";
          tag:  "match" "+ color=#006EFF";
       }
+      style {
+         name: "reply_textblock_style";
+         base: "font=Tizen:weight=Normal:width=Condensed font_size="REPLY_TEXT_SIZE" text_class=tizen color=#fafafa align=center";
+         tag:  "match" "+ color=#006EFF";
+      }
    }
 
    group { name: "elm/genlist/item/sentbubble/default";
@@ -554,4 +562,75 @@ collections {
          }
       }
    }
+
+   group {
+      name: "elm/genlist/item/reply/default";
+      data.item: "banded_bg_area" "elm.swallow.bg";
+      data.item: "texts" "reply.text";
+      data.item: "contents" "swallow.reply";
+      parts {
+         spacer { "base"; scale; mouse;
+            desc { "default";
+            }
+         }
+         swallow { "elm.swallow.bg"; scale;
+            desc { "default";
+            }
+         }
+         spacer { "padding.top"; scale;
+            desc { "default";
+               align: 0 0;
+               min: 0 11;
+               max: -1 11;
+               fixed: 0 1;
+            }
+         }
+         spacer { "padding.bottom"; scale;
+            desc { "default";
+               align: 0 1;
+               min: 0 0;
+               max: -1 0;
+               fixed: 0 1;
+            }
+         }
+         swallow { "swallow.reply"; scale;
+            desc { "default";
+               min: REPLY_SWALLOW_SIZE REPLY_SWALLOW_SIZE;
+               max: REPLY_SWALLOW_SIZE REPLY_SWALLOW_SIZE;
+               rel1.to_y: "padding.top";
+               rel1.relative: 0 1;
+               rel2.to_y: "padding.top";
+               rel2.relative: 1 1;
+               align: 0.5 0;
+               fixed: 1 1;
+            }
+         }
+         spacer { "reply.padding.bottom"; scale;
+            desc { "default";
+               min: 0 5;
+               max: -1 5;
+               rel1.to_y: "swallow.reply";
+               rel1.relative: 0 1;
+               rel2.relative: 1 1;
+               align: 0.5 0;
+               fixed: 0 1;
+            }
+         }
+         textblock { "reply.text"; scale;
+            mouse_events: 0;
+            desc { "default";
+               rel1.to_y: "reply.padding.bottom";
+               rel1.relative: 0 1;
+               rel2.to_y: "padding.bottom";
+               rel2.relative: 1 0;
+               align: 0.5 0;
+               min: 0 36;
+               max: -1 36;
+               fixed: 0 1;
+               text.style: "reply_textblock_style";
+               text.max: 1 0;
+            }
+         }
+      }
+   }
 }
index d1219df1d23f346143e962802e40f1abf9267469..7c2dccbe8cd9aad2e65eb07c597b9ade24854918 100755 (executable)
@@ -130,6 +130,38 @@ collections {
          }
       }
    }
+   group {
+      name: "conv/reply_icon";
+      images {
+         image: "More_option_icon/b_more_option_ic_reply.png" RAW; //change when icon will be added
+         image: "messages_reply_bg.png" RAW;
+      }
+      inherit: "base_icon";
+      parts {
+         part {
+            name: "base";
+            description {
+               state: "default" 0.0;
+               image.normal: "messages_reply_bg.png";
+               color: 250 250 250 255;
+            }
+            description {
+               state: "pressed" 0.0;
+               inherit: "default";
+               color: 250 250 250 102;
+            }
+         }
+         part {
+            name: "main";
+            type: IMAGE;
+            description {
+               state: "default" 0.0;
+               image.normal: "More_option_icon/b_more_option_ic_reply.png";
+               color: 250 250 250 255;
+            }
+         }
+      }
+   }
    group {
       name: "badge";
       images {
diff --git a/src/Conversation/ConvList/View/inc/ConvReplyListItem.h b/src/Conversation/ConvList/View/inc/ConvReplyListItem.h
new file mode 100644 (file)
index 0000000..ab10fa2
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * 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 ConReplyListItem_h_
+#define ConReplyListItem_h_
+
+#include "ListItem.h"
+
+namespace Msg {
+    class ConvReplyListItem
+        : public ListItem {
+        public:
+            ConvReplyListItem();
+            virtual ~ConvReplyListItem();
+
+        private:
+            std::string getText(ListItem &item, const char *part) override;
+            Evas_Object *getContent(ListItem &item, const char *part) override;
+
+            Evas_Object *getReplyButton();
+    };
+}
+
+#endif /* ConReplyListItem_h_ */
diff --git a/src/Conversation/ConvList/View/src/ConvReplyListItem.cpp b/src/Conversation/ConvList/View/src/ConvReplyListItem.cpp
new file mode 100644 (file)
index 0000000..8c5d7ec
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * 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 "ConvReplyListItem.h"
+#include "ListView.h"
+
+using namespace Msg;
+
+namespace {
+    const char *replyText = "reply.text";
+    const char *replyContent = "swallow.reply";
+}
+
+ConvReplyListItem::ConvReplyListItem()
+    : ListItem(ListItemStyle::create("reply"))
+{
+}
+
+ConvReplyListItem::~ConvReplyListItem()
+{
+}
+
+std::string ConvReplyListItem::getText(ListItem &item, const char *part)
+{
+    if (!strcmp(part, replyText))
+        return msg("WDS_MSG_OPT_REPLY_ABB").cStr();
+
+    return "";
+}
+
+Evas_Object *ConvReplyListItem::getContent(ListItem &item, const char *part)
+{
+    if (!strcmp(part, replyContent))
+        return getReplyButton();
+
+    return nullptr;
+}
+
+Evas_Object *ConvReplyListItem::getReplyButton()
+{
+    Evas_Object *btn = View::addIconButton(*getOwner(), "conv/reply_icon");
+    return btn;
+}
index 0d5c3ebebc7e8c8a80ef28e6d8e58e6c83d7c652..a16cdc8c3be8b98b1943670b9fc340cc12b9aa20 100644 (file)
 #include "FrameController.h"
 #include "AppControlCompose.h"
 #include "AppControlDefault.h"
+#include "ListView.h"
 
 namespace Msg
 {
     class ConvFrame
         : public FrameController
+        , private IListViewListener
     {
         public:
             ConvFrame(NaviFrameController &parent);
@@ -36,6 +38,8 @@ namespace Msg
         private:
             // NaviFrameItem:
             void onAttached(ViewItem &item) override;
+
+            void onListItemSelected(ListItem &listItem) override;
     };
 }
 
index 93a73ce1473b40acce7881653e141f1d4d345b97..045883146d4dfcd3dc2e5c44049630236f7ba5b2 100644 (file)
@@ -42,3 +42,8 @@ void ConvFrame::execCmd(const AppControlDefaultRef &cmd)
 {
 
 }
+
+void ConvFrame::onListItemSelected(ListItem &listItem)
+{
+    MSG_LOG("");
+}