TizenRefApp-8354 Implement BlockedMsgDetail View 45/124845/3
authorOleksander Kostenko <o.kostenko@samsung.com>
Wed, 12 Apr 2017 14:07:35 +0000 (17:07 +0300)
committerOleksandr Kostenko <o.kostenko@samsung.com>
Thu, 13 Apr 2017 14:43:31 +0000 (07:43 -0700)
Change-Id: I99fb5acbb34615f0cfe543ece2ccf395c2e18da3
Signed-off-by: Oleksander Kostenko <o.kostenko@samsung.com>
res/edje/common_genlist_theme.edc
src/Settings/View/inc/SettingsBlockedMsgDetailView.h [new file with mode: 0644]
src/Settings/View/src/SettingsBlockedMsgDetailView.cpp [new file with mode: 0644]

index 8a9b05b216c3514f096a396ffc8a9e25470adb4e..2402e1c5cae490f7ff70ad67904dcb38ae2e0a30 100644 (file)
@@ -2,12 +2,24 @@
 
 collections {
    BASE_SCALE;
+
+   styles {
+      style { name: "time_details_textblock_style";
+         base: "font=Tizen:style=Regular font_size="24" color=#b3b3b3 text_class=tizen align=center wrap=mixed";
+         tag:  "match" "+ color=#ffffff";
+      }
+      style { name: "msg_details_textblock_style";
+         base: "font=Tizen:style=Regular font_size="32" color=#fafafa text_class=tizen align=center wrap=mixed";
+         tag:  "match" "+ color=#ffffff";
+      }
+   }
+
    group {
       name: "elm/genlist/item/custom_title/default";
       data.item: "contents" "swl.content";
       parts{
-         PADDING_TOP("pad.top", 37);
-         PADDING_BOTTOM("pad.bottom", 7);
+         PADDING_TOP("pad.top", 51);
+         PADDING_BOTTOM("pad.bottom", 0);
          swallow { "swl.content"; scale; nomouse;
             desc { "default";
                align: 0.5 1.0;
@@ -19,4 +31,67 @@ collections {
          }
       }
    }
+
+   group { "elm/genlist/item/message_detail/default";
+      data.item: "texts" "elm.text elm.text.1";
+      parts {
+         PADDING_TOP("pad.top", 0);
+         PADDING_LEFT("pad.left", 33);
+         PADDING_RIGHT("pad.right", 33);
+         rect { name: "bg"; scale;
+            desc { "default";
+               rel1 {
+                  relative: 1 1;
+                  to_x: "pad.left";
+                  to_y: "pad.top";
+               }
+               rel2 {
+                  relative: 0 1;
+                  to_x: "pad.right";
+               }
+               color: 0 0 0 0;
+            }
+         }
+         textblock { "elm.text"; scale; nomouse;
+            desc { "default";
+               rel.to: "bg";
+               align: 0.5 0;
+               min: 294 32;
+               max: 294 32;
+               text {
+                  min: 0 1;
+                  max: 0 1;
+                  style: "time_details_textblock_style";
+                  ellipsis: -1;
+               }
+            }
+         }
+         spacer { "pad.bottom.time"; scale;
+            desc { "default";
+               rel1.to: "elm.text";
+               rel1.relative: 0 1;
+               rel2.to: "elm.text";
+               rel2.relative: 1 1;
+               align: 0.5 0;
+               min: 0 19;
+            }
+         }
+         textblock { "elm.text.1"; scale;
+            desc { "default";
+               rel1.to_y: "pad.bottom.time";
+               rel1.to_x: "bg";
+               rel1.relative: 0 1;
+               rel2.to: "bg";
+               rel2.relative: 1 1;
+               align: 0.5 0;
+               text {
+                  min: 0 1;
+                  max: 0 1;
+                  style: "msg_details_textblock_style";
+                  align: 0.5 0;
+               }
+            }
+         }
+      }
+   }
 }
diff --git a/src/Settings/View/inc/SettingsBlockedMsgDetailView.h b/src/Settings/View/inc/SettingsBlockedMsgDetailView.h
new file mode 100644 (file)
index 0000000..53e97b5
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * 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 SettingsBlockedMsgDetailView_h_
+#define SettingsBlockedMsgDetailView_h_
+
+#include "ListItem.h"
+#include "LangUtils.h"
+
+namespace Msg {
+    class SettingsBlockedMsgDetailView
+        : public ListItem {
+        public:
+            SettingsBlockedMsgDetailView();
+            virtual ~SettingsBlockedMsgDetailView();
+
+            void setTime(std::string time);
+            void setMessage(std::string message);
+
+        private:
+            std::string getText(ListItem &item, const char *part) override;
+
+        private:
+            std::string m_Time;
+            std::string m_Message;
+    };
+}
+
+#endif // SettingsBlockedMsgDetailView_h_
diff --git a/src/Settings/View/src/SettingsBlockedMsgDetailView.cpp b/src/Settings/View/src/SettingsBlockedMsgDetailView.cpp
new file mode 100644 (file)
index 0000000..ba8f884
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * 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 <string.h>
+#include "SettingsBlockedMsgDetailView.h"
+#include "TimeUtils.h"
+
+using namespace Msg;
+
+namespace {
+    const char *msgTime = "elm.text";
+    const char *msgText = "elm.text.1";
+}
+
+SettingsBlockedMsgDetailView::SettingsBlockedMsgDetailView()
+    : ListItem(ListItemStyle::create("message_detail"))
+{
+}
+
+SettingsBlockedMsgDetailView::~SettingsBlockedMsgDetailView()
+{
+}
+
+void SettingsBlockedMsgDetailView::setTime(std::string time)
+{
+    m_Time = std::move(time);
+}
+
+void SettingsBlockedMsgDetailView::setMessage(std::string message)
+{
+    m_Message = std::move(message);
+}
+
+std::string SettingsBlockedMsgDetailView::getText(ListItem &item, const char *part)
+{
+    if (!strcmp(part, msgTime))
+        return m_Time;
+    else if (!strcmp(part, msgText)) {
+        return m_Message;
+    }
+
+    return "";
+}
+