summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Kurzberg <i.kurtsberg@samsung.com>2017-08-21 15:09:05 +0300
committerAleksandr Sapozhnik <a.sapozhnik@samsung.com>2017-08-22 08:58:20 +0000
commitac58d157803f039de8f74610a62c4d52e9279c1c (patch)
treed5e89da5a30770f32f9e77d4e99e18f6d20da716
parentbb4cedc32189615c2da03e656a1286d47553caa3 (diff)
downloadphone-contacts-ac58d157803f039de8f74610a62c4d52e9279c1c.tar.gz
phone-contacts-ac58d157803f039de8f74610a62c4d52e9279c1c.tar.bz2
phone-contacts-ac58d157803f039de8f74610a62c4d52e9279c1c.zip
TizenRefApp-9181 Remove add number feature in contact details
Change-Id: I91c73c724295514530a94ea8b0f9d66df306fc79 Signed-off-by: Eugene Kurzberg <i.kurtsberg@samsung.com>
-rw-r--r--contacts-app/inc/Details/DetailsView.h8
-rw-r--r--contacts-app/src/Details/DetailsView.cpp58
-rw-r--r--lib-common/res/common/edje/ContactLayout.h1
-rw-r--r--lib-common/res/common/images/contact_detail_wpc_add_icon.pngbin1351 -> 0 bytes
4 files changed, 4 insertions, 63 deletions
diff --git a/contacts-app/inc/Details/DetailsView.h b/contacts-app/inc/Details/DetailsView.h
index 7a64850..c7c5235 100644
--- a/contacts-app/inc/Details/DetailsView.h
+++ b/contacts-app/inc/Details/DetailsView.h
@@ -35,15 +35,7 @@ namespace Details
private:
virtual Evas_Object *onCreate(Evas_Object *parent) override;
- virtual void updateFields(int changes) override;
-
Evas_Object *createMoreMenu(Evas_Object *parent);
- Evas_Object *createAddButton(Evas_Object *parent);
- void updateAddButton();
-
- void onEditContact();
-
- Evas_Object *m_AddButton;
};
}
diff --git a/contacts-app/src/Details/DetailsView.cpp b/contacts-app/src/Details/DetailsView.cpp
index 0807897..4c62c71 100644
--- a/contacts-app/src/Details/DetailsView.cpp
+++ b/contacts-app/src/Details/DetailsView.cpp
@@ -25,15 +25,13 @@
#include "ContactLayout.h"
-#define COLOR_ADD_BUTTON 59, 59, 59
-
using namespace Common;
using namespace Common::Model;
using namespace Details;
using namespace Input;
DetailsView::DetailsView(ContactData *contact)
- : ContactView(contact), m_AddButton(nullptr)
+ : ContactView(contact)
{
}
@@ -49,24 +47,14 @@ Evas_Object *DetailsView::onCreate(Evas_Object *parent)
return layout;
}
-void DetailsView::updateFields(int changes)
-{
- ContactView::updateFields(changes);
-
- if (changes & ContactData::ChangedNumber) {
- updateAddButton();
- if (!getContact().getNumber()) {
- elm_object_translatable_part_text_set(getEvasObject(), PART_NUMBER, "WDS_PB_BUTTON_ADD_NUMBER_ABB");
- }
- }
-}
-
Evas_Object *DetailsView::createMoreMenu(Evas_Object *parent)
{
auto moreMenu = new Ui::CircleMoreMenu();
moreMenu->create(parent);
moreMenu->setTextDomain(TEXT_DOMAIN);
- moreMenu->addItem("WDS_PB_OPT_EDIT_ABB", { }, PATH_ICON_EDIT, std::bind(&DetailsView::onEditContact, this));
+ moreMenu->addItem("WDS_PB_OPT_EDIT_ABB", { }, PATH_ICON_EDIT, [this] {
+ getNavigator()->navigateTo(new InputView(static_cast<const Contact &>(getContact())));
+ });
moreMenu->addItem("WDS_PB_OPT_DELETE_ABB2", { }, PATH_ICON_DELETE, [this] {
contacts_db_delete_record(_contacts_contact._uri, getContact().getId());
auto popup = new Ux::SuccessPopup();
@@ -77,41 +65,3 @@ Evas_Object *DetailsView::createMoreMenu(Evas_Object *parent)
return moreMenu->getEvasObject();
}
-
-Evas_Object *DetailsView::createAddButton(Evas_Object *parent)
-{
- Evas_Object *button = elm_button_add(parent);
- elm_object_style_set(button, "circle");
- elm_atspi_accessible_name_set(button, "WDS_PB_BUTTON_ADD_NUMBER_ABB");
- elm_atspi_accessible_translation_domain_set(button, TEXT_DOMAIN);
- setActionButtonColor(button, { COLOR_ADD_BUTTON });
- evas_object_smart_callback_add(button, "clicked",
- (Evas_Smart_Cb) makeCallback(&DetailsView::onEditContact), this);
-
- Evas_Object *image = elm_image_add(button);
- elm_image_file_set(image, App::getResourcePath(PATH_ICON_ADD).c_str(), nullptr);
- elm_object_content_set(button, image);
-
- return button;
-}
-
-void DetailsView::updateAddButton()
-{
- bool isNumberExist = getContact().getNumber() != nullptr;
- if (isNumberExist == (m_AddButton == nullptr)) {
- return;
- }
-
- if (!isNumberExist) {
- elm_object_part_content_set(getEvasObject(), PART_ACTION_BTNS,
- m_AddButton = createAddButton(getEvasObject()));
- } else {
- evas_object_del(m_AddButton);
- m_AddButton = nullptr;
- }
-}
-
-void DetailsView::onEditContact()
-{
- getNavigator()->navigateTo(new InputView(static_cast<const Contact &>(getContact())));
-}
diff --git a/lib-common/res/common/edje/ContactLayout.h b/lib-common/res/common/edje/ContactLayout.h
index 8e857b9..54ec715 100644
--- a/lib-common/res/common/edje/ContactLayout.h
+++ b/lib-common/res/common/edje/ContactLayout.h
@@ -27,7 +27,6 @@
#define PATH_CUE_EFFECT COMMON_IMG_DIR"wc_visual_cue_ef.png"
#define PATH_ICON_EDIT COMMON_IMG_DIR"b_more_option_edit_icon.png"
#define PATH_ICON_DELETE COMMON_IMG_DIR"b_more_option_delete_icon.png"
-#define PATH_ICON_ADD COMMON_IMG_DIR"contact_detail_wpc_add_icon.png"
#define PATH_ICON_CREATE COMMON_IMG_DIR"wc_logs_create_contact.png"
#define PATH_ICON_BLOCK COMMON_IMG_DIR"wc_logs_add_to_spam.png"
#define PATH_ICON_UNBLOCK COMMON_IMG_DIR"wc_logs_remove_from_spam.png"
diff --git a/lib-common/res/common/images/contact_detail_wpc_add_icon.png b/lib-common/res/common/images/contact_detail_wpc_add_icon.png
deleted file mode 100644
index 9a1fee7..0000000
--- a/lib-common/res/common/images/contact_detail_wpc_add_icon.png
+++ /dev/null
Binary files differ