#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"
class SelectButton;
class PaddingListViewItem;
class NoContentListViewItem;
+ class NoContentLayout;
class SettingsBlockListFrame
: public FrameController
void prepareMoreOption();
void prepareSelectViews();
void preapareList();
+ void prepareNoContent();
void updateCheckViews();
void fillList();
void setSelectMode(bool value);
SelectButton *m_pSelectButton;
ListView *m_pList;
PaddingListViewItem *m_pBottomItem;
- NoContentListViewItem *m_pNoContentItem;
+ NoContentLayout *m_pNoContent;
};
}
#include "Logger.h"
#include "BlockedNumberListItem.h"
#include "BlockedMsgListItem.h"
-#include "NoContentListViewItem.h"
+#include "NoContentLayout.h"
#include "SettingsBlockedMsgDetailFrame.h"
using namespace Msg;
, m_pSelectButton(nullptr)
, m_pList(nullptr)
, m_pBottomItem(nullptr)
- , m_pNoContentItem(nullptr)
+ , m_pNoContent(nullptr)
{
MSG_LOG("");
prepareMainLayout();
}
}
+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:
{
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)