TizenRefApp-8197 Implement custom LineItem style for message thred list. 99/119599/4
authorOleksander Kostenko <o.kostenko@samsung.com>
Fri, 17 Mar 2017 12:39:28 +0000 (14:39 +0200)
committerDenis Dolzhenko <d.dolzhenko@samsung.com>
Mon, 20 Mar 2017 11:23:47 +0000 (04:23 -0700)
Submitted after rebase.

Change-Id: Ib41b7a39e73b18e607435c7c28d287cf994b5021
Signed-off-by: Oleksander Kostenko <o.kostenko@samsung.com>
res/edje/conv_genlist_theme.edc
src/Common/View/inc/GroupListViewItem.h [deleted file]
src/Common/View/inc/LineListViewItem.h [new file with mode: 0644]
src/Common/View/src/GroupListViewItem.cpp [deleted file]
src/Common/View/src/LineListViewItem.cpp [new file with mode: 0644]
src/Conversation/ConvList/View/src/ConvDateLineListItem.cpp
src/MsgThread/Controller/src/ThreadList.cpp

index 34419c55ed11352aa26bb08219d2065739159c60..00bb0d6ee4de1e3bbfcfc21754f871f2d5a5f494 100644 (file)
@@ -463,7 +463,7 @@ collections {
       name: "elm/genlist/item/dateline/default";
 
       data.item: "banded_bg_area" "elm.swallow.bg";
-      data.item: "texts" "text.date";
+      data.item: "texts" "elm.text";
 
       parts{
          spacer { "base"; scale; nomouse;
@@ -498,7 +498,7 @@ collections {
                fixed: 0 1;
             }
          }
-         textblock { "text.date"; scale; nomouse;
+         textblock { "elm.text"; scale; nomouse;
             desc { "default";
                align: 0.5 0.5;
                rel1.to_y: "pad.top";
@@ -515,9 +515,9 @@ collections {
                align: 1.0 0.5;
                min: DATELINE_CENTER_PADDING DATELINE_HEIGHT;
                max: DATELINE_CENTER_PADDING DATELINE_HEIGHT;
-               rel1.to: "text.date";
+               rel1.to: "elm.text";
                rel1.relative: 0 0;
-               rel2.to: "text.date";
+               rel2.to: "elm.text";
                rel2.relative: 0 1;
                fixed: 1 0;
             }
@@ -527,9 +527,9 @@ collections {
                align: 0 0.5;
                min: DATELINE_CENTER_PADDING DATELINE_HEIGHT;
                max: DATELINE_CENTER_PADDING DATELINE_HEIGHT;
-               rel1.to: "text.date";
+               rel1.to: "elm.text";
                rel1.relative: 1 0;
-               rel2.to: "text.date";
+               rel2.to: "elm.text";
                rel2.relative: 1 1;
                fixed: 1 0;
             }
@@ -563,6 +563,25 @@ collections {
       }
    }
 
+   group {
+      name: "elm/genlist/item/1lineitem/default";
+      inherit: "elm/genlist/item/dateline/default";
+      parts {
+         spacer { "pad.top"; scale; nomouse;
+            desc { "default";
+               min: 0 0;
+               max: -1 0;
+            }
+         }
+         spacer { "pad.bottom"; scale; nomouse;
+            desc { "default";
+               min: 0 0;
+               max: -1 0;
+            }
+         }
+      }
+   }
+
    group {
       name: "elm/genlist/item/reply/default";
       data.item: "banded_bg_area" "elm.swallow.bg";
diff --git a/src/Common/View/inc/GroupListViewItem.h b/src/Common/View/inc/GroupListViewItem.h
deleted file mode 100644 (file)
index 2320e78..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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 GroupIndexListViewItem_h_
-#define GroupIndexListViewItem_h_
-
-#include "ListItem.h"
-#include <string>
-
-namespace Msg {
-    class GroupListViewItem
-        : public ListItem {
-        public:
-            GroupListViewItem(std::string titleText = std::string());
-            virtual ~GroupListViewItem();
-
-        protected:
-            void onAttached(ViewItem &item) override;
-
-        private:
-            std::string getText(ListItem &item, const char *part) override;
-
-        private:
-            std::string m_TitleText;
-    };
-}
-
-#endif // GroupIndexListViewItem_h_
diff --git a/src/Common/View/inc/LineListViewItem.h b/src/Common/View/inc/LineListViewItem.h
new file mode 100644 (file)
index 0000000..3f337f7
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * 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 LineListViewItem_h_
+#define LineListViewItem_h_
+
+#include "ListItem.h"
+#include <string>
+
+namespace Msg {
+    class LineListViewItem
+        : public ListItem {
+        public:
+            LineListViewItem(std::string titleText = std::string());
+            virtual ~LineListViewItem();
+
+        protected:
+            void onAttached(ViewItem &item) override;
+
+        private:
+            std::string getText(ListItem &item, const char *part) override;
+
+        private:
+            std::string m_TitleText;
+    };
+}
+
+#endif /* LineListViewItem_h_ */
diff --git a/src/Common/View/src/GroupListViewItem.cpp b/src/Common/View/src/GroupListViewItem.cpp
deleted file mode 100644 (file)
index 5130e3c..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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 "GroupListViewItem.h"
-
-using namespace Msg;
-
-GroupListViewItem::GroupListViewItem(std::string titleText)
-    : ListItem(ListItemStyle::create("groupindex"))
-    , m_TitleText(std::move(titleText))
-{
-}
-
-GroupListViewItem::~GroupListViewItem()
-{
-}
-
-void GroupListViewItem::onAttached(ViewItem &item)
-{
-    setSelectable(false);
-}
-
-std::string GroupListViewItem::getText(ListItem &item, const char *part)
-{
-    if (!strcmp(part, "elm.text"))
-        return msg(m_TitleText);
-
-    return "";
-}
diff --git a/src/Common/View/src/LineListViewItem.cpp b/src/Common/View/src/LineListViewItem.cpp
new file mode 100644 (file)
index 0000000..fc337e7
--- /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.
+ */
+
+#include "LineListViewItem.h"
+
+using namespace Msg;
+
+LineListViewItem::LineListViewItem(std::string titleText)
+    : ListItem(ListItemStyle::create("1lineitem"))
+    , m_TitleText(std::move(titleText))
+{
+}
+
+LineListViewItem::~LineListViewItem()
+{
+}
+
+void LineListViewItem::onAttached(ViewItem &item)
+{
+    setSelectable(false);
+}
+
+std::string LineListViewItem::getText(ListItem &item, const char *part)
+{
+    if (!strcmp(part, "elm.text"))
+        return msg(m_TitleText);
+
+    return "";
+}
index 8bc6bc0aea890ac3580983474d8eb64e3f675e8e..734cddc699f38d2ffcee8f0ce05a5d66ae84841d 100644 (file)
@@ -21,7 +21,7 @@ using namespace Msg;
 
 namespace {
     ListItemStyleRef dateLineStyle = ListItemStyle::create("dateline");
-    const char *datePart = "text.date";
+    const char *datePart = "elm.text";
 }
 
 ConvDateLineListItem::ConvDateLineListItem(const std::string &dateLine)
index 2a7c8278610a5eb70c7bc4e4df3f31f96a98aaaa..1be84e2316473c1098d2b928b15692ed89af9428 100644 (file)
  */
 
 
+#include "LineListViewItem.h"
 #include "ThreadList.h"
 #include "ThreadListItem.h"
 #include "PaddingListViewItem.h"
 #include "ThreadComposeListViewItem.h"
 #include "NoContentListViewItem.h"
-#include "GroupListViewItem.h"
 #include "MsgEngine.h"
 #include "App.h"
 
@@ -202,7 +202,7 @@ void ThreadList::fillList()
     ListView::appendItem(*m_ComposeItem);
 
     // Group item:
-    ListView::appendItem(*new GroupListViewItem("WDS_MSG_HEADER_MESSAGES_ABB"));
+    ListView::appendItem(*new LineListViewItem("WDS_MSG_HEADER_MESSAGES_ABB"));
 
     // Thread list:
     MsgThreadListRef msgThreadList = m_App.getMsgEngine().getStorage().getThreadList();