TizenRefApp-7982 Implement AlertView 42/113742/2
authorEugene Kurzberg <i.kurtsberg@samsung.com>
Fri, 10 Feb 2017 11:43:52 +0000 (13:43 +0200)
committerEugene Kurzberg <i.kurtsberg@samsung.com>
Fri, 10 Feb 2017 11:43:52 +0000 (13:43 +0200)
Change-Id: Ief05436b375f8514898ec54cf3af180340548fa6
Signed-off-by: Eugene Kurzberg <i.kurtsberg@samsung.com>
alarm-app/.cproject
alarm-app/inc/Alert/AlertView.h [new file with mode: 0644]
alarm-app/inc/OperationAlertController.h [new file with mode: 0644]
alarm-app/res/alert/edje/AlertLayout.h
alarm-app/src/AlarmApp.cpp
alarm-app/src/Alert/AlertView.cpp [new file with mode: 0644]
alarm-app/src/OperationAlertController.cpp [new file with mode: 0644]
alarm-app/tizen-manifest.xml

index 0ffd340704c2c999cd827d8bd0a2e2fa3c886d28..a15e1428cda84c6797ae2a321548ad1a6082b20e 100644 (file)
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/lib/glib-2.0/include&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib-apps-common/inc}&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib-common/inc}&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib-common/res/common/edje}&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/alarm-app/res/alert/edje}&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${workspace_loc:/alarm-app/res/input/edje}&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${workspace_loc:/alarm-app/res/list/edje}&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib-common/res/common/edje}&quot;"/>
                                                                </option>
                                                                <option id="sbi.gnu.cpp.compiler.option.frameworks.core.208729733" name="Tizen-Frameworks" superClass="sbi.gnu.cpp.compiler.option.frameworks.core" valueType="userObjs">
                                                                        <listOptionValue builtIn="false" value="Native_API"/>
                                                                <option id="sbi.gnu.cpp.compiler.option.570702224" name="Tizen-Target" superClass="sbi.gnu.cpp.compiler.option" valueType="userObjs">
                                                                        <listOptionValue builtIn="false" value="wearable-3.0-emulator.core_llvm37.i386.core.app"/>
                                                                </option>
-                                                               <option id="sbi.gnu.cpp.compiler.option.frameworks_inc.core.1612390694" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.core" valueType="includePath"/>
+                                                               <option id="sbi.gnu.cpp.compiler.option.frameworks_inc.core.1612390694" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.core" valueType="includePath">
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/libxml2&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/EGL&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/GLES&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/GLES2&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/GLES3&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/KHR&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/SDL2&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore-agent&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore-watch&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appfw&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/badge&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/base&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/cairo&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/calendar-service2&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/chromium-ewk&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ckm&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/contacts-svc&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/content&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/context-service&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/csr&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dali&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dali-toolkit&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dbus-1.0&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/device&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dlog&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-buffer-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-con-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-evas-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-file-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-imf-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-imf-evas-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-input-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-input-evas-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-ipc-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ector-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/e_dbus-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/edje-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eet-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efl-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efl-extension&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efreet-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eina-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eina-1/eina&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eio-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eldbus-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/elementary-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/embryo-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/emile-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eo-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eom&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ethumb-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ethumb-client-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/evas-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/feedback&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/fontconfig&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/freetype2&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/gio-unix-2.0&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/glib-2.0&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/harfbuzz&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/iotcon&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/json-glib-1.0&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/location&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/maps&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/media&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/media-content&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/messaging&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/metadata-editor&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/minizip&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/network&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/notification&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/nsd/&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/phonenumber-utils&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/sensor&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/storage&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/system&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/telephony&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/tzsh&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ui&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/vulkan&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/widget_service&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/widget_viewer_dali&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/widget_viewer_evas&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/yaca&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/lib/dbus-1.0/include&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/lib/glib-2.0/include&quot;"/>
+                                                               </option>
                                                                <option id="sbi.gnu.cpp.compiler.option.frameworks_cflags.core.705336083" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.cpp.compiler.option.frameworks_cflags.core" valueType="stringList">
                                                                        <listOptionValue builtIn="false" value="${TC_COMPILER_MISC}"/>
                                                                        <listOptionValue builtIn="false" value="${RS_COMPILER_MISC}"/>
diff --git a/alarm-app/inc/Alert/AlertView.h b/alarm-app/inc/Alert/AlertView.h
new file mode 100644 (file)
index 0000000..76f0085
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2017 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 ALERT_ALERT_VIEW_H
+#define ALERT_ALERT_VIEW_H
+
+#include "Common/Model/Alarm.h"
+#include "Ui/View.h"
+
+#include <efl_extension.h>
+
+namespace Alert
+{
+       /**
+        * @brief Alarm alert view.
+        */
+       class AlertView : public Ui::View
+       {
+       public:
+               /**
+                * @brief Create alert view.
+                * @param[in]   alarm   Alarm to show alert for
+                */
+               AlertView(Common::Model::Alarm alarm);
+
+       private:
+               virtual Evas_Object *onCreate(Evas_Object *parent) override;
+               virtual void onNavigation(bool isCurrent) override;
+               virtual void onPageAttached(Ui::NavigatorPage *page) override;
+
+               Evas_Object *createButton(Evas_Object *parent, const char *iconPath, Elm_Color_RGBA color,
+                               const char *pressSignal, const char *unpressSignal);
+               Eina_Bool onRotaryEvent(Evas_Object *obj, Eext_Rotary_Event_Info *eventInfo);
+
+               void onDismissClicked(Evas_Object *button, void *eventInfo);
+               void onSnoozeClicked(Evas_Object *button, void *eventInfo);
+               static void onButtonPressed(const char *signal, Evas_Object *button, void *eventInfo);
+
+               Evas_Object *m_DismissButton;
+               Evas_Object *m_SnoozeButton;
+               Common::Model::Alarm m_Alarm;
+       };
+}
+
+#endif /* ALERT_ALERT_VIEW_H */
diff --git a/alarm-app/inc/OperationAlertController.h b/alarm-app/inc/OperationAlertController.h
new file mode 100644 (file)
index 0000000..fa0a412
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2017 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 OPERATION_ALERT_CONTROLLER_H
+#define OPERATION_ALERT_CONTROLLER_H
+
+#include "App/OperationController.h"
+
+class OperationAlertController : public App::OperationController
+{
+private:
+       virtual void onRequest(const char *operation, app_control_h request) override;
+};
+
+#endif /* OPERATION_ALERT_CONTROLLER_H */
index 078f3862dcdb5c0b75c272f62360651da1899c6f..27cf050885b275b49b74e32ad93b9a8468590d49 100644 (file)
 #define SIGNAL_SNOOZE_SHOW      "state,snooze,default"
 #define SIGNAL_SNOOZE_HIDE      "state,snooze,hidden"
 
+#define TIME_TEXT_SIZE          30
+#define ORIG_TIME_TEXT_SIZE     22
+
+#define COLOR_BUTTON_DISMISS    222, 11, 0, 255
+#define COLOR_BUTTON_SNOOZE     255, 208, 0, 255
+
 #endif /* ALERT_LAYOUT_H */
index 781e7133b636ebf807a39cddd2820fa7042045ae..33b83f958303b1960ca40dacda66b5268ac5359e 100644 (file)
 #include "Ui/Window.h"
 #include "Utils/Logger.h"
 
+#include "AlertPath.h"
 #include "CommonPath.h"
 #include "DaySelectorPath.h"
 #include "ListPath.h"
+
+#include "OperationAlertController.h"
 #include "OperationDefaultController.h"
-#include "OperationPickController.h"
 #include "OperationEditController.h"
+#include "OperationPickController.h"
 
 App::OperationController *AlarmApp::createController(const char *operation)
 {
        if (strcmp(operation, APP_CONTROL_OPERATION_DEFAULT) == 0
-               || strcmp(operation, APP_CONTROL_OPERATION_MAIN) == 0) {
+        || strcmp(operation, APP_CONTROL_OPERATION_MAIN) == 0) {
                return new OperationDefaultController();
        } else if (strcmp(operation, APP_CONTROL_OPERATION_PICK) == 0) {
                return new OperationPickController();
        } else if (strcmp(operation, APP_CONTROL_OPERATION_EDIT) == 0) {
                return new OperationEditController();
+       } else if (strcmp(operation, APP_CONTROL_OPERATION_LAUNCH_ON_EVENT) == 0) {
+               return new OperationAlertController();
        }
 
        return nullptr;
@@ -48,6 +53,7 @@ bool AlarmApp::onCreate()
        elm_theme_overlay_add(nullptr, App::getResourcePath(PATH_DAY_SELECTOR_LAYOUT).c_str());
        elm_theme_extension_add(nullptr, App::getResourcePath(PATH_LIST_ITEM_STYLE).c_str());
        elm_theme_extension_add(nullptr, App::getResourcePath(PATH_ALARM_CHECK_STYLE).c_str());
+       elm_theme_extension_add(nullptr, App::getResourcePath(PATH_ALERT_BUTTON_STYLE).c_str());
 
        Application::onCreate();
        getWindow()->setRotationEnabled(true);
diff --git a/alarm-app/src/Alert/AlertView.cpp b/alarm-app/src/Alert/AlertView.cpp
new file mode 100644 (file)
index 0000000..bbeb7cb
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2017 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 "Alert/AlertView.h"
+#include "Common/Format.h"
+#include "Common/Model/AlarmConsumer.h"
+
+#include "App/Path.h"
+#include "Utils/Callback.h"
+#include "AlertLayout.h"
+
+using namespace Alert;
+using namespace Common;
+using namespace Common::Model;
+
+AlertView::AlertView(Common::Model::Alarm alarm)
+       : m_DismissButton(nullptr), m_SnoozeButton(nullptr), m_Alarm(std::move(alarm))
+{
+}
+
+Evas_Object *AlertView::onCreate(Evas_Object *parent)
+{
+       Evas_Object *layout = elm_layout_add(parent);
+       elm_layout_file_set(layout, App::getResourcePath(PATH_ALERT_LAYOUT).c_str(), LAYOUT_ALERT);
+       eext_rotary_object_event_callback_add(layout, makeCallback(&AlertView::onRotaryEvent), this);
+
+       elm_object_part_text_set(layout, PART_TIME, formatTime(m_Alarm.getDate(), TIME_TEXT_SIZE));
+       /* TODO: set original time if snoozed
+        * elm_object_part_text_set(layout, PART_ORIG_TIME, formatTime(m_Alarm.getDate(), ORIG_TIME_TEXT_SIZE));
+        */
+
+       m_DismissButton = createButton(layout, PATH_ICON_DISMISS, { COLOR_BUTTON_DISMISS },
+                       SIGNAL_SNOOZE_HIDE, SIGNAL_SNOOZE_SHOW);
+       elm_object_part_content_set(layout, PART_BUTTON_DISMISS, m_DismissButton);
+       evas_object_smart_callback_add(m_DismissButton, "clicked",
+                       makeCallback(&AlertView::onDismissClicked), this);
+
+       m_SnoozeButton = createButton(layout, PATH_ICON_SNOOZE, { COLOR_BUTTON_SNOOZE },
+                       SIGNAL_DISMISS_HIDE, SIGNAL_DISMISS_SHOW);
+       elm_object_part_content_set(layout, PART_BUTTON_SNOOZE, m_SnoozeButton);
+       evas_object_smart_callback_add(m_SnoozeButton, "clicked",
+                       makeCallback(&AlertView::onSnoozeClicked), this);
+
+       return layout;
+}
+
+void AlertView::onNavigation(bool isCurrent)
+{
+       eext_rotary_object_event_activated_set(getEvasObject(), isCurrent);
+}
+
+void AlertView::onPageAttached(Ui::NavigatorPage *page)
+{
+       page->setStyle("empty");
+}
+
+Evas_Object *AlertView::createButton(Evas_Object *parent, const char *iconPath, Elm_Color_RGBA color,
+               const char *pressSignal, const char *unpressSignal)
+{
+       Evas_Object *button = elm_button_add(parent);
+       elm_object_style_set(button, "alert");
+       elm_object_color_class_color_set(button, "icon", color.r, color.g, color.b, 255);
+       elm_object_color_class_color_set(button, "icon_pressed", 255, 255, 255, 255);
+       elm_object_color_class_color_set(button, "bg", color.r, color.g, color.b, 90);
+       elm_object_color_class_color_set(button, "effect", color.r, color.g, color.b, 179);
+
+       Evas_Object *image = elm_image_add(button);
+       elm_image_file_set(image, App::getResourcePath(iconPath).c_str(), nullptr);
+       elm_object_content_set(button, image);
+
+       evas_object_smart_callback_add(button, "pressed",
+                       (Evas_Smart_Cb) &AlertView::onButtonPressed, pressSignal);
+       evas_object_smart_callback_add(button, "unpressed",
+                       (Evas_Smart_Cb) &AlertView::onButtonPressed, unpressSignal);
+
+       return button;
+}
+
+Eina_Bool AlertView::onRotaryEvent(Evas_Object *obj, Eext_Rotary_Event_Info *eventInfo)
+{
+       if (eventInfo->direction == EEXT_ROTARY_DIRECTION_CLOCKWISE) {
+               elm_layout_signal_emit(m_SnoozeButton, SIGNAL_BUTTON_UNPRESS, "");
+               elm_layout_signal_emit(m_DismissButton, SIGNAL_BUTTON_PRESS, "");
+       } else {
+               elm_layout_signal_emit(m_DismissButton, SIGNAL_BUTTON_UNPRESS, "");
+               elm_layout_signal_emit(m_SnoozeButton, SIGNAL_BUTTON_PRESS, "");
+       }
+       return EINA_TRUE;
+}
+
+void AlertView::onDismissClicked(Evas_Object *button, void *eventInfo)
+{
+       if (!m_Alarm.getRepeat()) {
+               m_Alarm.setEnabled(false);
+               AlarmConsumer::getInstance().updateAlarm(m_Alarm, nullptr);
+       }
+       getPage()->close();
+}
+void AlertView::onSnoozeClicked(Evas_Object *button, void *eventInfo)
+{
+       getPage()->close();
+}
+
+void AlertView::onButtonPressed(const char *signal, Evas_Object *button, void *eventInfo)
+{
+       elm_layout_signal_emit(elm_object_parent_widget_get(button), signal, "");
+}
diff --git a/alarm-app/src/OperationAlertController.cpp b/alarm-app/src/OperationAlertController.cpp
new file mode 100644 (file)
index 0000000..09db8df
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2017 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 "OperationAlertController.h"
+#include "Alert/AlertView.h"
+#include "Common/Model/AlarmConsumer.h"
+
+#include "App/AppControlUtils.h"
+#include "Ui/Navigator.h"
+
+using namespace Common::Model;
+
+void OperationAlertController::onRequest(const char *operation, app_control_h request)
+{
+       int id = App::getIntExtraData(request, APP_CONTROL_DATA_ID);
+       AlarmConsumer::getInstance().getAlarm(id, [this](AlarmConsumer::DataList list) {
+               auto alarm = static_cast<Alarm *>(list.front());
+               getNavigator()->navigateTo(new Alert::AlertView(*alarm));
+               delete alarm;
+       });
+}
index 4b6719151ecfe94f58dfd2bcb7e433ffbc218c2e..88d712842c6252257fb959800e8fe1b72bf2623e 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <manifest xmlns="http://tizen.org/ns/packages" api-version="3.0" package="org.tizen.alarm" version="1.0.0">
     <profile name="wearable"/>
-    <ui-application appid="org.tizen.alarm" exec="alarm-app" multiple="false" nodisplay="false" taskmanage="true" type="capp">
+    <ui-application appid="org.tizen.alarm" exec="alarm-app" hw-acceleration="on" multiple="false" nodisplay="false" taskmanage="true" type="capp">
         <label>Alarm</label>
         <label xml:lang="ar-ae">تنبيه</label>
         <label xml:lang="az-az">Siqnal</label>
@@ -54,7 +54,7 @@
         <label xml:lang="zh-tw">鬧鐘</label>
         <icon>org.tizen.alarm.png</icon>
     </ui-application>
-    <ui-application appid="org.tizen.alarm.app-control" exec="alarm-app" multiple="true" nodisplay="true" taskmanage="false" type="capp">
+    <ui-application appid="org.tizen.alarm.app-control" exec="alarm-app" hw-acceleration="on" multiple="true" nodisplay="true" taskmanage="false" type="capp">
         <label>Alarm</label>
         <label xml:lang="ar-ae">تنبيه</label>
         <label xml:lang="az-az">Siqnal</label>
             <mime name="application/vnd.tizen.alarm"/>
         </app-control>
     </ui-application>
+    <ui-application appid="org.tizen.alarm.alert" exec="alarm-app" hw-acceleration="on" multiple="false" nodisplay="true" taskmanage="false" type="capp">
+        <label>Alarm</label>
+        <label xml:lang="ar-ae">تنبيه</label>
+        <label xml:lang="az-az">Siqnal</label>
+        <label xml:lang="bg-bg">Аларма</label>
+        <label xml:lang="ca-es">Alarma</label>
+        <label xml:lang="cs-cz">Upozornění</label>
+        <label xml:lang="da-dk">Alarm</label>
+        <label xml:lang="de-de">Alarm</label>
+        <label xml:lang="el-gr">Ξυπνητήρι</label>
+        <label xml:lang="en-gb">Alarm</label>
+        <label xml:lang="en-ph">Alarm</label>
+        <label xml:lang="en-us">Alarm</label>
+        <label xml:lang="es-es">Alarma</label>
+        <label xml:lang="es-mx">Alarma</label>
+        <label xml:lang="et-ee">Märguanne</label>
+        <label xml:lang="eu-es">Alarma</label>
+        <label xml:lang="fi-fi">Hälytys</label>
+        <label xml:lang="fr-ca">Alarme</label>
+        <label xml:lang="fr-fr">Alarme</label>
+        <label xml:lang="ga-ie">Aláram</label>
+        <label xml:lang="gl-es">Alarma</label>
+        <label xml:lang="hr-hr">Alarm</label>
+        <label xml:lang="hu-hu">Jelzés</label>
+        <label xml:lang="hy-am">Տագնապ</label>
+        <label xml:lang="is-is">Vekjari</label>
+        <label xml:lang="it-it">Sveglia</label>
+        <label xml:lang="ja-jp">アラーム</label>
+        <label xml:lang="ka-ge">სიგნალი</label>
+        <label xml:lang="kk-kz">Оятар</label>
+        <label xml:lang="ko-kr">알람</label>
+        <label xml:lang="lt-lt">Signalas</label>
+        <label xml:lang="lv-lv">Signāls</label>
+        <label xml:lang="mk-mk">Аларм</label>
+        <label xml:lang="nb-no">Alarm</label>
+        <label xml:lang="nl-nl">Alarm</label>
+        <label xml:lang="pl-pl">Alarm</label>
+        <label xml:lang="pt-br">Alarme</label>
+        <label xml:lang="pt-pt">Alarme</label>
+        <label xml:lang="ro-ro">Alarmă</label>
+        <label xml:lang="ru-ru">Будильник</label>
+        <label xml:lang="sk-sk">Budík</label>
+        <label xml:lang="sl-si">Alarm</label>
+        <label xml:lang="sr-rs">Beleška</label>
+        <label xml:lang="sv-se">Alarm</label>
+        <label xml:lang="tr-tr">Alarm</label>
+        <label xml:lang="uk-ua">Будильник</label>
+        <label xml:lang="uz-uz">Uyg‘otgich</label>
+        <label xml:lang="zh-cn">闹钟</label>
+        <label xml:lang="zh-hk">鬧鐘</label>
+        <label xml:lang="zh-tw">鬧鐘</label>
+        <icon>org.tizen.alarm.png</icon>
+    </ui-application>
     <privileges>
         <privilege>http://tizen.org/privilege/datasharing</privilege>
     </privileges>