From 842360fb85dfc41641f11da721f39e8e3c3f6968 Mon Sep 17 00:00:00 2001 From: Sergii Kyryliuk Date: Fri, 3 Mar 2017 15:45:13 +0200 Subject: TizenRefApp-8068 Widget screen is not updated after adding/removing alarm Change-Id: I179c728951994d47e9397bedf7d7aa0089f71306 Signed-off-by: Sergii Kyryliuk --- alarm-app/src/List/AlarmsView.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/alarm-app/src/List/AlarmsView.cpp b/alarm-app/src/List/AlarmsView.cpp index e7a041f..0840dfb 100644 --- a/alarm-app/src/List/AlarmsView.cpp +++ b/alarm-app/src/List/AlarmsView.cpp @@ -31,7 +31,6 @@ #include "Ui/Toast.h" #include "Ui/Window.h" #include "Utils/Callback.h" -#include "Utils/Logger.h" #include "Ux/MultiSelector.h" #include "ListPath.h" @@ -85,9 +84,6 @@ void AlarmsView::onCreated() m_Provider.onUpdateFinished() += { std::bind(&AlarmsView::onUpdateFinished, this), this }; m_Provider.onInserted() += { std::bind(&AlarmsView::onAlarmInserted, this, _1), this }; m_Provider.initialize([this] { - m_Genlist->insert(m_TitleItem = new TitleItem()); - m_Genlist->insert(m_AddAlarmItem = new AddAlarmItem()); - m_AddAlarmItem->setSelectCallback(std::bind(&AlarmsView::onAddPressed, this)); for (auto &&dataItem : m_Provider.getDataList()) { insertItem(createItem(*dataItem)); @@ -108,6 +104,10 @@ void AlarmsView::onNavigation(bool isCurrent) void AlarmsView::onSelectModeChanged(Ux::SelectMode selectMode) { + if (!getEvasObject()) { + return; + } + if (selectMode != Ux::SelectMulti) { elm_layout_signal_emit(m_ContentLayout, "select_mode,button,hide", ""); @@ -153,6 +153,10 @@ Evas_Object *AlarmsView::createContentLayout(Evas_Object *parent) (Evas_Smart_Cb)makeCallback(&AlarmsView::onItemLongpressed), this); elm_object_content_set(layout, m_Genlist->getEvasObject()); + m_Genlist->insert(m_TitleItem = new TitleItem()); + m_Genlist->insert(m_AddAlarmItem = new AddAlarmItem()); + m_AddAlarmItem->setSelectCallback(std::bind(&AlarmsView::onAddPressed, this)); + m_MultiSelector = new Ux::MultiSelector(this); m_MultiSelector->create(layout); m_MultiSelector->setStrings({ "WDS_MSG_OPT_SELECT_ALL_ABB", "WDS_MSG_OPT_DESELECT_ALL_ABB" }); -- cgit v1.2.3