TizenRefApp-8413 Update UI of Settings/NoContents 04/126204/1
authorDenis Dolzhenko <d.dolzhenko@samsung.com>
Thu, 20 Apr 2017 11:27:47 +0000 (14:27 +0300)
committerDenis Dolzhenko <d.dolzhenko@samsung.com>
Thu, 20 Apr 2017 11:28:25 +0000 (14:28 +0300)
Change-Id: I946fc3e3bb1027a46d260d30aee25b96f95b2f0b
Signed-off-by: Denis Dolzhenko <d.dolzhenko@samsung.com>
inc/Resource.h
res/edje/images.edc
src/Settings/Controller/inc/SettingsBlockListFrame.h
src/Settings/Controller/src/SettingsBlockListFrame.cpp

index d2b00d1892b9bf2333f0ffa779ac000448da5ea6..44a1f03d430a89a6cf3556997ae724be86d18394 100644 (file)
@@ -28,7 +28,9 @@
 #define ATTACH_CONTACT_ICON             "thread_view_msg_att_vcf.png"
 #define ATTACH_UNKNOWN_ICON             "thread_view_msg_att_etc.png"
 
-#define TEST_IMAGE_PATH                  "images/cat.png"
+#define NO_SPAM_MSG_ICON                "No_item/msg_no_spam_messages.png"
+
+#define TEST_IMAGE_PATH                 "images/cat.png"
 
 #define NEW_MSG_MORE_ICON                MORE_OPTION_DIR"/b_more_option_ic_compose.png"
 #define DELETEG_MORE_ICON                MORE_OPTION_DIR"/b_more_option_ic_delete.png"
index 0941978e6fe5ebf713e11e91cb649a91ac69885e..c70eff7b76570bdf9d119e287a8639224da149e8 100755 (executable)
@@ -42,4 +42,5 @@ collections {
    RES_IMAGE("sent_fail_icon.png");
    RES_IMAGE("tw_ic_popup_btn_delete.png");
    RES_IMAGE("tw_ic_popup_btn_check.png");
+   RES_IMAGE("No_item/msg_no_spam_messages.png");
 }
index a10dec3392f7fc47c71372994e9164f6ad1ce271..645c96c8aa993ccfac6c33db9c0a321190276a10 100644 (file)
@@ -31,6 +31,7 @@ namespace Msg {
     class SelectButton;
     class PaddingListViewItem;
     class NoContentListViewItem;
+    class NoContentLayout;
 
     class SettingsBlockListFrame
         : public FrameController
@@ -67,6 +68,7 @@ namespace Msg {
             void prepareMoreOption();
             void prepareSelectViews();
             void preapareList();
+            void prepareNoContent();
             void updateCheckViews();
             void fillList();
             void setSelectMode(bool value);
@@ -83,7 +85,7 @@ namespace Msg {
             SelectButton *m_pSelectButton;
             ListView *m_pList;
             PaddingListViewItem *m_pBottomItem;
-            NoContentListViewItem *m_pNoContentItem;
+            NoContentLayout *m_pNoContent;
     };
 }
 
index 426ec2f8242222574c99421f6bb9f10e349acab8..bf95a278a795b89952382e90934cbf68ce414f87 100644 (file)
@@ -26,7 +26,7 @@
 #include "Logger.h"
 #include "BlockedNumberListItem.h"
 #include "BlockedMsgListItem.h"
-#include "NoContentListViewItem.h"
+#include "NoContentLayout.h"
 #include "SettingsBlockedMsgDetailFrame.h"
 
 using namespace Msg;
@@ -41,7 +41,7 @@ SettingsBlockListFrame::SettingsBlockListFrame(NaviFrameController &parent, Bloc
     , m_pSelectButton(nullptr)
     , m_pList(nullptr)
     , m_pBottomItem(nullptr)
-    , m_pNoContentItem(nullptr)
+    , m_pNoContent(nullptr)
 {
     MSG_LOG("");
     prepareMainLayout();
@@ -95,6 +95,21 @@ void SettingsBlockListFrame::preapareList()
     }
 }
 
+void SettingsBlockListFrame::prepareNoContent()
+{
+    if (!m_pNoContent) {
+        m_pNoContent = new NoContentLayout(*m_pLayout);
+        m_pNoContent->enableTitle(true);
+
+        Evas_Object *img = elm_image_add(*m_pNoContent);
+        std::string imgPath = PathUtils::getResourcePath(IMAGES_EDJ_PATH);
+        elm_image_file_set(img, imgPath.c_str(), NO_SPAM_MSG_ICON);
+
+        m_pNoContent->setIcon(img);
+        m_pLayout->setNoContent(*m_pNoContent);
+    }
+}
+
 void SettingsBlockListFrame::fillList()
 {
     // Title:
@@ -166,19 +181,21 @@ void SettingsBlockListFrame::updateNoContent()
 {
     int count = m_BlockListType == BlockedNumType ? m_pList->getItemsCount<BlockedNumberListItem>()
                                                   : m_pList->getItemsCount<BlockedMsgListItem>();
-
-    if (count <= 0) {
-        if (!m_pNoContentItem) {
-            const char *noContentText = m_BlockListType == BlockedNumType ? "WDS_MSG_NPBODY_NO_BLOCKED_NUMBERS_ABB"
-                                                                          : "WDS_MSG_NPBODY_NO_BLOCKED_MESSAGES_ABB";
-            m_pNoContentItem = new NoContentListViewItem;
-            m_pNoContentItem->setText(noContentText);
-            insertItem(m_pNoContentItem);
-        }
-    } else if (m_pNoContentItem) {
-        m_pNoContentItem->destroy();
-        m_pNoContentItem = nullptr;
+    bool noContent = count <= 0;
+
+    if (noContent) {
+        const char *text = m_BlockListType == BlockedNumType ? "WDS_MSG_NPBODY_NO_BLOCKED_NUMBERS_ABB"
+                                                             : "WDS_MSG_NPBODY_NO_BLOCKED_MESSAGES_ABB";
+        const char *title = m_BlockListType == BlockedMsgType ? "WDS_MSG_MBODY_BLOCKED_MESSAGES"
+                                                              : "WDS_MSG_MBODY_BLOCKED_NUMBERS";
+        prepareNoContent();
+        m_pNoContent->setTitle(msgt(title));
+        m_pNoContent->setText(msgt(text));
     }
+
+    m_pLayout->showNoContent(noContent);
+    m_pLayout->showContent(!noContent);
+    m_pLayout->showMoreOption(!noContent);
 }
 
 void SettingsBlockListFrame::insertItem(ListItem *item)