This patch includes following for setting-notification app- 06/234906/2
authorJagrat Patidar <j1.patidar@samsung.com>
Fri, 29 May 2020 14:10:50 +0000 (19:40 +0530)
committerAmritanshu Pandia <a.pandia1@samsung.com>
Fri, 29 May 2020 14:34:28 +0000 (14:34 +0000)
1)App notifications according to srpol gui
2)DND according to srpol gui

Change-Id: I0ad4cf4c4b184b8ec23a20f4ff7f15821dce4d43
Signed-off-by: Jagrat Patidar <j1.patidar@samsung.com>
16 files changed:
inc/app-details.h
inc/app-setting-info.h
inc/common-efl.h
project_def.prop
res/edje/app_noti_main_layout.edc [new file with mode: 0644]
res/edje/setting_notification.edc
res/images/advanced_settings_bg.png [new file with mode: 0644]
res/images/bg.png [new file with mode: 0644]
res/images/dnd_lower_bg.png [new file with mode: 0644]
res/images/dnd_upper_bg.png [new file with mode: 0644]
res/images/show_all_bg.png [new file with mode: 0644]
src/app-details.c
src/common-efl.c
src/do-not-disturb-efl.c
src/main.c
src/notification-setting-info.c

index fb2853b80c724847dea7877c6cb963359340355c..e8de8a6cb36494372d21a74652381b24d7760770 100644 (file)
@@ -36,4 +36,39 @@ void app_details_create_view(ug_data *data, item_info_s *app_info);
  */
 Evas_Object *create_app_notification_gl(ug_data *ugd);
 
+/**
+ * @brief Gets allos-noti status from apps
+ *
+ * @param[in] empty
+ *
+ * @return status
+ */
+Eina_Bool allow_noti_status_get_app_details_status();
+
+/**
+ * @brief Sets app information
+ *
+ * @param[in] item_info_s  app data
+ *
+ * @return void
+ */
+void set_app_info(item_info_s *data_list);
+
+/**
+ * @brief Sets allow-noti status
+ *
+ * @param[in] bool   status
+ *
+ * @return void
+ */
+void allow_noti_status_set(Eina_Bool value);
+
+/**
+ * @brief Sets check
+ *
+ * @param[in] Evas_Object* check value to set
+ *
+ * @return void
+ */
+void set_check(Evas_Object *check);
 #endif /* __APP_DETAILS_H__ */
index 30fa3869e3dfa5647d640ba2b2f9bb3845d876ee..61211eae465f95386f914012ae9486f5e4ba37d4 100644 (file)
@@ -19,6 +19,7 @@
 #define __APP_SETTING_INFO_H__
 
 #include <tizen.h>
+#include <Evas.h>
 #include "log.h"
 /**
  * @brief A data-structure that represents a notification settings for a specific application.
@@ -32,6 +33,7 @@ typedef struct {
        bool allow_to_notify;       /**< @brief Flag that defines if application is allowed to post notifications.*/
        bool do_not_disturb_except; /**< @brief Flag that defines if application is set an exception and allowed to post notifications in "Do not disturb" mode.*/
        int item_style;             /**< @brief A code of style that should be applied to genlist-item that represents this application.*/
+       Evas_Object *my_check;      /**< @brief Check for updating genlist in real time.*/
 } item_info_s;
 
 /**
index 9d38db859d35714a32ee939b54f19a7eafec8640..7598dfe70332a1863109f0d0c1407fa358c8944f 100644 (file)
@@ -37,6 +37,7 @@
 typedef struct ug_data_t {
        Evas_Object *win;           /**< @brief Application's window.*/
        Evas_Object *layout;        /**< @brief Application's base layout.*/
+       Evas_Object *genlist_layout;
        Evas_Object *naviframe;     /**< @brief Naviframe.*/
        Evas_Object *list_main;     /**< @brief Genlist with notification panel settings.*/
        Evas_Object *list_sub;      /**< @brief Genlist used in "Set schedule" and "Excepted apps" views.*/
@@ -181,4 +182,10 @@ void cancel_button_noti_ls_cb(void *data, Evas_Object *obj, void *event_info);
  */
 void done_button_noti_ls_cb(void *data, Evas_Object *obj, void *event_info);
 
+/**
+ * @brief Gets allos-noti status from apps
+ * @param[in] ugd app data.
+ */
+Eina_Bool check_all_status_get(ug_data *ugd);
+
 #endif //__COMMON_EFL_H__
index fb302438df65fcd33e90441089c4d2f4544628cc..8e17c6bf01609117644e7cd83643442db6d96267 100644 (file)
@@ -45,15 +45,15 @@ USER_INC_DIRS = $(USER_C_INC_DIRS) $(USER_CPP_INC_DIRS)
 USER_LIB_DIRS = lib 
 
 # EDC Resource Path
-USER_EDCS_IMAGE_DIRS = ${OUTPUT_DIR} edje/images 
+USER_EDCS_IMAGE_DIRS = ${OUTPUT_DIR} edje/images res/images
 USER_EDCS_SOUND_DIRS = ${OUTPUT_DIR} edje/sounds 
 USER_EDCS_FONT_DIRS = ${OUTPUT_DIR} edje/fonts 
 
 # EDC Flags
 USER_EXT_EDC_KEYS = EDC0 
 
-USER_EXT_EDC0_EDCS = res/edje/time_button_layout.edc res/edje/repeat_weekly_item.edc res/edje/setting_notification.edc res/edje/reject_calls_popup.edc 
-USER_EXT_EDC0_EDCS_IMAGE_DIRS = ${OUTPUT_DIR} edje/images 
+USER_EXT_EDC0_EDCS = res/edje/time_button_layout.edc res/edje/repeat_weekly_item.edc res/edje/setting_notification.edc res/edje/reject_calls_popup.edc res/edje/app_noti_main_layout.edc
+USER_EXT_EDC0_EDCS_IMAGE_DIRS = ${OUTPUT_DIR} edje/images res/images
 USER_EXT_EDC0_EDCS_SOUND_DIRS = ${OUTPUT_DIR} edje/sounds 
 USER_EXT_EDC0_EDCS_FONT_DIRS = ${OUTPUT_DIR} edje/fonts 
 
diff --git a/res/edje/app_noti_main_layout.edc b/res/edje/app_noti_main_layout.edc
new file mode 100644 (file)
index 0000000..e76bfe4
--- /dev/null
@@ -0,0 +1,229 @@
+/*\r
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#define PADDING_SIZE 40\r
+\r
+collections\r
+{\r
+       base_scale: 1.8;\r
+       images {\r
+               image: "bg.png" COMP;\r
+               image: "show_all_bg.png" COMP;\r
+               image: "advanced_settings_bg.png" COMP;\r
+               image: "dnd_upper_bg.png" COMP;\r
+               image: "dnd_lower_bg.png" COMP;\r
+       }\r
+\r
+       group { "app-noti/main_layout";\r
\r
+  \r
+               parts {\r
+                       rect { "base";\r
+                               desc { "default";\r
+                                       color: 238 239 241 255;\r
+                               }\r
+                       }\r
+                       spacer { "padding.left"; scale;\r
+                               desc { "default";\r
+                                       min: PADDING_SIZE 0;\r
+                                       max: PADDING_SIZE -1;\r
+                                       fixed: 1 0;\r
+                                       align: 0.0 0.0;\r
+                                       rel.to: "base";\r
+                               }\r
+                       }\r
+                       spacer { "padding.right"; scale;\r
+                               desc { "default";\r
+                                       min: PADDING_SIZE 0;\r
+                                       max: PADDING_SIZE -1;\r
+                                       fixed: 1 0;\r
+                                       align: 1.0 0.0;\r
+                                       rel.to: "base";\r
+                               }\r
+                       }\r
+\r
+                       image { "show_all_bg"; scale;\r
+                               desc { "default";\r
+                                       fixed: 1 1;\r
+                                       rel1 { relative: 1.0 0.0; to: "padding.left"; }\r
+                                       image.normal: "show_all_bg.png";\r
+                                       align : 0 0;\r
+                                       min : 1200 72;\r
+                                       max : 1200 72;\r
+                               }\r
+                       }\r
+\r
+                       part { name: "elm.swallow.button";\r
+                               scale: 1;\r
+                               type: SWALLOW;\r
+                               description { \r
+                                       state: "default" 0.0;\r
+                                       fixed: 1 1;\r
+                                       rel1 { relative: 40/1200 0.0;  to: "show_all_bg"; }\r
+                                       rel2 { relative: 1.0 1.0;  to: "show_all_bg"; }\r
+                                       align: 0 0;\r
+                                       visible: 1;\r
+                               }\r
+                       }\r
+\r
+                       swallow { "label_part";\r
+                               desc { "default";\r
+                                       rel1 { relative: 0.0 1.0; offset: 0 7; to: "show_all_bg"; }\r
+                                       rel2 { relative: 1.0 1.0; offset: 0 33; to: "show_all_bg"; }\r
+                               }\r
+                       }\r
+\r
+                       swallow { "label_part_advanced_settings";\r
+                               desc { "default";\r
+                                       rel1 { relative: 0.0 1.0; offset: 0 7; to: "show_all_bg"; }\r
+                                       rel2 { relative: 1.0 1.0; offset: 0 33; to: "show_all_bg"; }\r
+                                       visible: 1;\r
+                               }\r
+                               desc { "hide";\r
+                                       inherit: "default";\r
+                                       visible: 0;\r
+                               }\r
+                       }\r
+\r
+                       image { "new_background"; scale;\r
+                               desc { "default";\r
+                                       fixed: 1 1;\r
+                                       rel1 { relative: 0.0 1.0; offset: 0 7; to: "label_part"; }\r
+                                       rel2 { relative: 0.0 0.9; to: "padding.right"; }\r
+                                       image.normal: "bg.png";\r
+                                       align : 0 0;\r
+                                       min : 1200 432;\r
+                                       max : 1200 432;\r
+                               }\r
+                       }\r
+\r
+                       image { "new_background_advanced_settings"; scale;\r
+                               desc { "default";\r
+                                       fixed: 1 1;\r
+                                       rel1 { relative: 0.0 1.0; offset: 0 7; to: "label_part"; }\r
+                                       rel2 { relative: 0.0 0.9; to: "padding.right"; }\r
+                                       image.normal: "advanced_settings_bg.png";\r
+                                       align : 0 0;\r
+                                       min : 1200 216;\r
+                                       max : 1200 216;\r
+                               }\r
+                       }\r
+\r
+                       swallow { "elm.swallow.content";\r
+                               desc { "default";\r
+                                       rel1 { relative: 0.0 0.05; to: "new_background"; }\r
+                                       rel2 { relative: 1.0 0.95; to: "new_background"; }\r
+                               }\r
+                       }\r
+\r
+                       swallow { "advanced_settings";\r
+                               desc { "default";\r
+                                       rel1 { relative: 0.0 0.05; to: "new_background_advanced_settings"; }\r
+                                       rel2 { relative: 1.0 0.95; to: "new_background_advanced_settings"; }\r
+                               }\r
+                       }\r
+               }\r
+\r
+               programs {\r
+                       program { name: "to_default_0";\r
+                               signal: "hide_text";\r
+                               action: STATE_SET "hide" 0.00;\r
+                               target: "label_part_advanced_settings";\r
+                       }\r
+\r
+                       program { name: "to_default_1";\r
+                               signal: "show_text";\r
+                               action: STATE_SET "default" 1.00;\r
+                               target: "label_part_advanced_settings";\r
+                       }\r
+               }\r
+       }\r
+\r
+       group { "app-noti2/main_layout2";\r
+\r
+               parts {\r
+\r
+                       rect { "base";\r
+                               desc { "default";\r
+                                       color: 238 239 241 255;\r
+                               }\r
+                       }\r
+                       spacer { "padding.left"; scale;\r
+                               desc { "default";\r
+                                       min: PADDING_SIZE 0;\r
+                                       max: PADDING_SIZE -1;\r
+                                       fixed: 1 0;\r
+                                       align: 0.0 0.0;\r
+                                       rel.to: "base";\r
+                               }\r
+                       }\r
+                       spacer { "padding.right"; scale;\r
+                               desc { "default";\r
+                                       min: PADDING_SIZE 0;\r
+                                       max: PADDING_SIZE -1;\r
+                                       fixed: 1 0;\r
+                                       align: 1.0 0.0;\r
+                                       rel.to: "base";\r
+                               }\r
+                       }\r
+\r
+                       image { "new_background2"; scale;\r
+                               desc { "default";\r
+                                       fixed: 1 1;\r
+                                       rel1 { relative: 1.0 0.0; to: "padding.left"; }\r
+                                       rel2 { relative: 1.0 0.4;}\r
+                                       image.normal: "dnd_upper_bg.png";\r
+                                       align : 0 0;\r
+                                       min : 1200 168;\r
+                                       max : 1200 168;\r
+                               }\r
+                       }\r
+\r
+                       swallow { "dnd_bg";\r
+                               desc { "default";\r
+                                       rel1 { relative: 0.0 0.05; to: "new_background2"; }\r
+                                       rel2 { relative: 1.0 0.95; to: "new_background2"; }\r
+                               }\r
+                       }\r
+\r
+                       swallow { "label_part_allow_noti_from";\r
+                               desc { "default";\r
+                                       rel1 { relative: 0.0 1.0; offset: 0 7; to: "new_background2"; }\r
+                                       rel2 { relative: 1.0 1.0; offset: 0 33; to: "new_background2"; }\r
+                               }\r
+                       }\r
+\r
+                       image { "lower_background"; scale;\r
+                               desc { "default";\r
+                                       fixed: 1 1;\r
+                                       rel1 { relative: 0.0 1.0; offset: 0 7; to: "label_part_allow_noti_from"; }\r
+                                       rel2 { relative: 0.0 0.0; to: "padding.right"; }\r
+                                       image.normal: "dnd_lower_bg.png";\r
+                                       align : 0 0;\r
+                                       min : 1200 360;\r
+                                       max : 1200 360;\r
+                               }\r
+                       }\r
+\r
+                       swallow { "genlist_part_content";\r
+                               desc { "default";\r
+                                       rel1 { relative: 0.0 0.05; to: "lower_background"; }\r
+                                       rel2 { relative: 1.0 0.95; to: "lower_background"; }\r
+                               }\r
+                       }\r
+               }\r
+       }\r
+}\r
index c65b84ecc530a45bd971291b06015ff0fe9aa872..9c4dbfaf47283e63981c0f4dd11cf2315f464209 100644 (file)
 #define ALLOWED_APP_TEXT_OVER 40
 #define ALLOWED_APP_TEXT_PAD_W 8
 #define SIDE_PAD_W 26
-#define HEADER_TEXT_H 64
-#define SELECT_BUTTON_HOR_PAD_H 14
-#define SELECT_BUTTON_H 52
-#define SELECT_BUTTON_W 200
-#define GRID_PAD_H 15
+#define HEADER_TEXT_H 0
+#define SELECT_BUTTON_HOR_PAD_H 0
+#define SELECT_BUTTON_H 0
+#define SELECT_BUTTON_W 0
+#define GRID_PAD_H 0
 collections {
    base_scale: 1.8;
    styles {
       style { name: "text_style";
-         base: "font=Samsungcondenced:style=Regular font_size=30 text_class=tizen align=center valign=top color=#000000 ellipsis=-1 wrap=mixed";
+         base: "font=Samsungcondenced:style=Regular font_size=18 text_class=tizen align=center valign=top color=#000000 ellipsis=-1 wrap=mixed";
       }
       style { name: "header_text_style";
-         base: "color=#3296A6FF font=Tizen:style=Regular font_size=32 text_class=tizen ellipsis=1.0";
+         base: "color=#3296A6FF font=Tizen:style=Regular font_size=18 text_class=tizen ellipsis=1.0";
       }
    }
    group { name: "allow_noti_from_layout";
diff --git a/res/images/advanced_settings_bg.png b/res/images/advanced_settings_bg.png
new file mode 100644 (file)
index 0000000..41bdeea
Binary files /dev/null and b/res/images/advanced_settings_bg.png differ
diff --git a/res/images/bg.png b/res/images/bg.png
new file mode 100644 (file)
index 0000000..7148e8e
Binary files /dev/null and b/res/images/bg.png differ
diff --git a/res/images/dnd_lower_bg.png b/res/images/dnd_lower_bg.png
new file mode 100644 (file)
index 0000000..41bdeea
Binary files /dev/null and b/res/images/dnd_lower_bg.png differ
diff --git a/res/images/dnd_upper_bg.png b/res/images/dnd_upper_bg.png
new file mode 100644 (file)
index 0000000..b09b16f
Binary files /dev/null and b/res/images/dnd_upper_bg.png differ
diff --git a/res/images/show_all_bg.png b/res/images/show_all_bg.png
new file mode 100644 (file)
index 0000000..cfda7f8
Binary files /dev/null and b/res/images/show_all_bg.png differ
index 273f5b8d0ada534ff71ca85b69de286ff4b00db5..6ff085fb426974e31519f2f1ba404f03d0778135 100644 (file)
 #include <badge_internal.h>
 #include <notification_setting_internal.h>
 #include <badge_setting.h>
+#include <app.h>
 
 #define AMOUNT_OF_CONTENT_ITEMS 3
+#define APP_NOTI_MAIN_LAYOUT "app-noti/main_layout"
+#define ALLOW_NOTIFICATIONS "Allow notifications"
+#define ADVANCED_SETTINGS "Advanced settings"
 
 typedef enum {
        APP_DETAILS_ALLOW_NOTI = 1,
@@ -34,6 +38,7 @@ typedef enum {
 
 item_info_s *g_app_info = NULL;
 Evas_Object *g_app_notification_genlist = NULL;
+static Evas_Object *g_check = NULL;
 
 static char *items[AMOUNT_OF_CONTENT_ITEMS] = {
        "IDS_QP_OPT_SHOW_ALL_CONTENT_ABB",
@@ -41,6 +46,11 @@ static char *items[AMOUNT_OF_CONTENT_ITEMS] = {
        "IDS_QP_OPT_DONT_SHOW_NOTIFICATIONS_ABB"
 };
 
+void set_check(Evas_Object *check)
+{
+       g_check = check;
+}
+
 static void close_app_details_cb(void *data, Evas_Object *obj, void *event_info)
 {
        NOTISET_TRACE_BEGIN;
@@ -77,19 +87,11 @@ static Evas_Object *widget_min_set(Evas_Object *obj,
 
 static Eina_Bool allow_noti_status_get()
 {
-       return get_allow_to_nofity(g_app_info->package_id);
+       //changed
+       return get_allow_to_nofity(g_app_info->appid);
 }
 
-static void allow_noti_status_set(Eina_Bool value)
-{
-       set_allow_to_nofity(g_app_info->package_id, value);
-}
 
-static void allow_noti_check_changed_cb(void *data, Evas_Object *obj, void *event_info)
-{
-       Eina_Bool state = elm_check_state_get(obj);
-       allow_noti_status_set(state);
-}
 
 static Eina_Bool popup_noti_status_get()
 {
@@ -98,7 +100,7 @@ static Eina_Bool popup_noti_status_get()
        bool state = false;
        notification_setting_h setting = NULL;
 
-       int err = notification_setting_get_setting_by_package_name(g_app_info->package_id, &setting);
+       int err = notification_setting_get_setting_by_package_name(g_app_info->appid, &setting);
        if (err != NOTIFICATION_ERROR_NONE) {
                NOTISET_ERR("notification_setting_get_setting_by_package_name [%d]\n", err);
        } else if (setting == NULL) {
@@ -119,7 +121,7 @@ static void popup_noti_status_set(Eina_Bool value)
        NOTISET_TRACE_BEGIN;
        notification_setting_h setting = NULL;
 
-       int err = notification_setting_get_setting_by_package_name(g_app_info->package_id, &setting);
+       int err = notification_setting_get_setting_by_package_name(g_app_info->appid, &setting);
        if (err != NOTIFICATION_ERROR_NONE) {
                NOTISET_ERR("notification_setting_get_setting_by_package_name [%d]\n", err);
        } else if (setting == NULL) {
@@ -195,6 +197,11 @@ static void app_badge_check_changed_cb(void *data, Evas_Object *obj, void *event
        app_badge_status_set(state);
 }
 
+Eina_Bool allow_noti_status_get_app_details_status()
+{
+       return allow_noti_status_get();
+}
+
 static int noti_on_lock_screen_status_get()
 {
        NOTISET_TRACE_BEGIN;
@@ -218,6 +225,34 @@ static int noti_on_lock_screen_status_get()
        return level;
 }
 
+void allow_noti_status_set(Eina_Bool value)
+{
+       popup_noti_status_set(value);
+       app_badge_status_set(value);
+       if (value == EINA_FALSE) {
+               if (g_check)
+                       elm_check_state_set(g_check, EINA_FALSE);
+       }
+       set_allow_to_nofity(g_app_info->appid, value);
+}
+
+static void allow_noti_check_changed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       Eina_Bool state = elm_check_state_get(obj);
+       Evas_Object *layout = (Evas_Object *)data;
+       allow_noti_status_set(state);
+       /*
+       NOTISET_DBG("trying to hide/show layout");
+       if (state == EINA_TRUE) {
+               NOTISET_DBG("show layout");
+               elm_object_signal_emit(layout, "show_text", "");
+       } else {
+               NOTISET_DBG("hide layout");
+               elm_object_signal_emit(layout, "hide_text", "");
+       }
+       */
+}
+
 static char *app_details_gl_text_get_cb(void *data, Evas_Object *obj, const char *part)
 {
        retv_if(!data, NULL);
@@ -493,12 +528,21 @@ static void app_details_gl_append(Evas_Object *genlist, char *style, App_Details
 static void fill_app_noti_gl(Evas_Object *genlist)
 {
        append_gl_item_list(genlist, get_apps_noti_allowed_list(), ITEM_STYLE_TYPE_ONE, "app-notification-details");
-       append_gl_start_option(genlist, "group_index", "blocked-noti");
-       append_gl_item_list(genlist, get_apps_noti_blocked_list(), ITEM_STYLE_TYPE_ONE, "app-notification-details");
+}
+
+void set_app_info(item_info_s *data_list)
+{
+       g_app_info = data_list;
 }
 
 static Eina_Bool app_details_pop_cb(void *data, Elm_Object_Item * it)
 {
+       ug_data *g_data = (ug_data *)data;
+
+       if (g_data) {
+               Evas_Object *check = elm_object_part_content_get(g_data->genlist_layout, "elm.swallow.button");
+               elm_check_state_set(check, check_all_status_get(g_data));
+       }
        update_app_notification_list_on_item(g_app_info);
        elm_genlist_clear(g_app_notification_genlist);
        fill_app_noti_gl(g_app_notification_genlist);
@@ -511,34 +555,59 @@ void app_details_create_view(ug_data *data, item_info_s *app_info)
 
        g_app_info = app_info;
 
+       Evas_Object *layout = elm_layout_add(data->naviframe);
+       char path[PATH_MAX] = {0, };
+
+       char *res_path = app_get_resource_path();
+       if (res_path) {
+               snprintf(path, PATH_MAX, "%s%s", res_path, "edje/app_noti_main_layout.edj");
+               free(res_path);
+       }
+       elm_layout_file_set(layout, path, APP_NOTI_MAIN_LAYOUT);
+
        Evas_Object *back_btn = elm_button_add(data->naviframe);
        elm_object_style_set(back_btn, "naviframe/back_btn/default");
        evas_object_smart_callback_add(back_btn, "clicked", close_app_details_cb, data->naviframe);
 
+       Evas_Object *check = elm_check_add(layout);
+       elm_object_text_set(check, ALLOW_NOTIFICATIONS);
+
+       elm_object_style_set(check, "on&off");
+       elm_object_part_content_set(layout, "elm.swallow.button", check);
+       evas_object_show(check);
+       elm_check_state_set(check, allow_noti_status_get());
+       evas_object_smart_callback_add(check, "changed", allow_noti_check_changed_cb, layout);
+
+       Evas_Object *label = elm_label_add(layout);
+       elm_object_text_set(label, ADVANCED_SETTINGS);
+       elm_object_part_content_set(layout, "label_part_advanced_settings", label);
+       evas_object_show(label);
+
        /* Push to naviframe */
-       Evas_Object *genlist = elm_genlist_add(data->naviframe);
+       Evas_Object *genlist = elm_genlist_add(layout);
        elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
        evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
        evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
+       elm_object_part_content_set(layout, "advanced_settings", genlist);
+       evas_object_show(genlist);
 
-       app_details_gl_append(genlist, "1line", APP_DETAILS_ALLOW_NOTI);
-       app_details_gl_append(genlist, "group_index", APP_DETAILS_GROUP_INDEX);
        app_details_gl_append(genlist, "multiline", APP_DETAILS_POPUP_NOTI);
        app_details_gl_append(genlist, "1line", APP_DETAILS_APP_BADGE);
        app_details_gl_append(genlist, "1line", APP_DETAILS_NOTI_ON_LOCK);
 
-       Elm_Object_Item *navi_item = elm_naviframe_item_push(data->naviframe, g_app_info->name, back_btn, NULL, genlist, NULL);
-       elm_naviframe_item_pop_cb_set(navi_item, app_details_pop_cb, NULL);
+       Elm_Object_Item *navi_item = elm_naviframe_item_push(data->naviframe, g_app_info->name, back_btn, NULL, layout, NULL);
+       evas_object_show(data->naviframe);
+       evas_object_show(layout);
+       elm_naviframe_item_pop_cb_set(navi_item, app_details_pop_cb, data);
 
        data->list_sub = genlist;
 }
 
 Evas_Object *create_app_notification_gl(ug_data *ugd)
 {
-       Evas_Object *parent = ugd->naviframe;
        Evas_Object *genlist;
 
-       genlist = elm_genlist_add(parent);
+       genlist = elm_genlist_add(ugd->genlist_layout);
        elm_genlist_mode_set(genlist, ELM_LIST_SCROLL);
        elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
        evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -550,5 +619,6 @@ Evas_Object *create_app_notification_gl(ug_data *ugd)
 
        fill_app_noti_gl(genlist);
        g_app_notification_genlist = genlist;
+       evas_object_show(genlist);
        return genlist;
 }
index 003f22e35bf7cb57c79940e34d4ec2df1caef6df..5e8d69636b4f096666d8ea414b8ec9eccf77721b 100644 (file)
 
 static ug_data *g_ug_data = NULL;
 
+static void allow_top_noti_check_changed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       set_app_info((item_info_s *)data);
+       Eina_Bool state = elm_check_state_get(obj);
+       allow_noti_status_set(state);
+}
+
+static Eina_Bool allow_top_noti_status_get()
+{
+       return allow_noti_status_get_app_details_status();
+}
+
 ug_data *get_app_ui_data()
 {
        return g_ug_data;
@@ -40,6 +52,23 @@ void set_app_ui_data(ug_data *data)
        g_ug_data = data;
 }
 
+Eina_Bool check_all_status_get(ug_data *ugd)
+{
+       Eina_Bool status = EINA_TRUE;
+       bool flag = false;
+       Elm_Object_Item *gen_item = elm_genlist_first_item_get(ugd->list_main);
+       while (gen_item) {
+               flag = true;
+               item_info_s *item = (item_info_s *)elm_object_item_data_get(gen_item);
+               status = status && get_allow_to_nofity(item->appid);
+               gen_item = elm_genlist_item_next_get(gen_item);
+       }
+
+       if (flag)
+               return status;
+       else
+               return EINA_FALSE;
+}
 
 Evas_Object *create_layout(Evas_Object *parent)
 {
@@ -211,7 +240,12 @@ static Evas_Object *gl_content_get_cb(void *data, Evas_Object *obj, const char *
 
        if (!strcmp(part, "elm.icon")) {
                if (data_list->item_style == ITEM_STYLE_TYPE_ONE) {
-                       return NULL;
+                       set_app_info(data_list);
+                       Evas_Object *check = create_check(obj, "on&off");
+                       elm_check_state_set(check, allow_top_noti_status_get());
+                       evas_object_smart_callback_add(check, "changed", allow_top_noti_check_changed_cb, data_list);
+                       data_list->my_check = check;
+                       return check;
                } else if (data_list->item_style == ITEM_STYLE_DEFAULT) {
                        content = create_check(obj, "default");
                        elm_check_state_set(content, data_list->do_not_disturb_except);
index 64af2d0a14f25b2a335887c6446f8b134dae5460..8b5557f6775bd4c9ea55793595184e4758cbb5c8 100644 (file)
@@ -37,10 +37,6 @@ void do_not_disturb_append_items_in_list(Evas_Object *genlist)
 {
        append_gl_start_option(genlist, "multiline", "do-not-disturb");
        append_gl_start_option(genlist, "multiline", "set-schedule-multiline");
-       append_gl_start_option(genlist, "multiline", "allowed-calls");
-       Eina_List *list = eina_list_clone(get_excepted_apps_list());
-       Eina_List *allowed_list = eina_list_merge(get_first_excepted_apps_list(), list);
-       append_gl_full_item(genlist, do_not_disturb_allowed_apps_cont_cb, allowed_list);
 }
 
 Evas_Object *do_not_disturb_allowed_apps_cont_cb(Evas_Object* parent, void *data)
@@ -49,7 +45,6 @@ Evas_Object *do_not_disturb_allowed_apps_cont_cb(Evas_Object* parent, void *data
        retv_if(ug_main == NULL, NULL);
 
        Evas_Object *full_layout = create_custom_layout(parent, ALLOWED_LAYOUT_NAME);
-       elm_object_part_text_set(full_layout, ALLOWED_LAYOUT_TEXT_PART, APP_STRING("IDS_QP_HEADER_ALLOW_NOTIFICATIONS_FROM_ABB"));
 
        Evas_Object *select_button = elm_button_add(full_layout);
        evas_object_size_hint_weight_set(select_button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -59,7 +54,7 @@ Evas_Object *do_not_disturb_allowed_apps_cont_cb(Evas_Object* parent, void *data
        evas_object_smart_callback_add(select_button, "clicked", exception_application_clicked_cb, ug_main);
        evas_object_show(select_button);
 
-       elm_object_part_content_set(full_layout, ALLOWED_LAYOUT_BUTTON_PART, select_button);
+       //elm_object_part_content_set(full_layout, ALLOWED_LAYOUT_BUTTON_PART, select_button);
 
        retv_if(!data, full_layout);
        Eina_List *allowed_apps_list = (Eina_List *)data;
index a37702f9c637b4a693435262644cb05d576fac16..d502ffbb870e20bf1bacff591296adb1e1f1bceb 100644 (file)
 #define PADDING_TOP 300
 #define LAYOUT_NAME "lockscreen_notification"
 
+#define DND_APP_NOTI_MAIN_LAYOUT "app-noti2/main_layout2"
+#define DND_ALLOW_NOTI_FROM "Allow notifications from"
+#define APP_NOTI_LIST_MAIN_LAYOUT"app-noti/main_layout"
+#define SHOW_ALL "Show all"
+#define SELECT_APPS "Select the apps you want to receive notifications from below."
+
 static void update_character_orientation();
 
 typedef enum {
@@ -71,6 +77,24 @@ static Evas_Object *_create_win()
        return conform;
 }
 
+static void allow_all_noti_changed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       ug_data *ugd = (ug_data *) data;
+       Eina_Bool state = elm_check_state_get(obj);
+
+       if (state == EINA_TRUE) {
+               Elm_Object_Item *gen_item = elm_genlist_first_item_get(ugd->list_main);
+               while (gen_item) {
+                       item_info_s *item = (item_info_s *)elm_object_item_data_get(gen_item);
+                       set_app_info(item);
+                       allow_noti_status_set(true);
+                       Evas_Object *check = item->my_check;
+                       elm_check_state_set(check, true);
+                       gen_item = elm_genlist_item_next_get(gen_item);
+               }
+       }
+}
+
 
 static Eina_Bool _notifiacation_setting_main_pop_cb(void *data, Elm_Object_Item * it)
 {
@@ -84,6 +108,27 @@ static Eina_Bool _notifiacation_setting_main_pop_cb(void *data, Elm_Object_Item
        return EINA_FALSE;
 }
 
+static Evas_Object *_create_do_not_disturb_lower_gl(ug_data *ugd)
+{
+       Evas_Object *parent = ugd->naviframe;
+
+       Evas_Object *genlist = elm_genlist_add(parent);
+       elm_genlist_mode_set(genlist, ELM_LIST_SCROLL);
+       elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
+       evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
+       elm_genlist_block_count_set(genlist, 1);
+
+       /* Add Smart Callback */
+       evas_object_smart_callback_add(genlist, "contracted", gl_contracted_cb, NULL);
+
+       Eina_List *list = eina_list_clone(get_excepted_apps_list());
+       Eina_List *allowed_list = eina_list_merge(get_first_excepted_apps_list(), list);
+       append_gl_full_item(genlist, do_not_disturb_allowed_apps_cont_cb, allowed_list);
+
+       return genlist;
+}
+
 static Evas_Object *_create_do_not_disturb_gl(ug_data *ugd)
 {
        Evas_Object *parent = ugd->naviframe;
@@ -135,8 +180,34 @@ Evas_Object *_create_lockscreen_content(ug_data *ugd)
 static void *_update_dnd_view(void *data)
 {
        ug_data *ugd = (ug_data *) data;
+
+       Evas_Object *layout = elm_layout_add(ugd->naviframe);
+       char path[PATH_MAX] = {0, };
+
+       char *res_path = app_get_resource_path();
+       if (res_path) {
+               snprintf(path, PATH_MAX, "%s%s", res_path, "edje/app_noti_main_layout.edj");
+               free(res_path);
+       }
+
+       elm_layout_file_set(layout, path, DND_APP_NOTI_MAIN_LAYOUT);
+
        ugd->list_main = _create_do_not_disturb_gl(ugd);
-       elm_object_item_content_set(ugd->navi_item, ugd->list_main);
+       elm_object_part_content_set(layout, "dnd_bg", ugd->list_main);
+       evas_object_show(ugd->list_main);
+
+       Evas_Object *label = elm_label_add(layout);
+       elm_object_text_set(label, DND_ALLOW_NOTI_FROM);
+       elm_object_part_content_set(layout, "label_part_allow_noti_from", label);
+       evas_object_show(label);
+
+       Evas_Object *genlist = _create_do_not_disturb_lower_gl(ugd);
+       elm_object_part_content_set(layout, "genlist_part_content", genlist);
+       evas_object_show(genlist);
+
+       elm_object_item_content_set(ugd->navi_item, layout);
+       evas_object_show(layout);
+
        return NULL;
 }
 
@@ -233,17 +304,47 @@ static void _create_notif_view(void *data)
                return;
        }
 
-       /* Create genlist */
-       ugd->list_main = create_app_notification_gl(ugd);
+       ugd->genlist_layout = elm_layout_add(ugd->naviframe);
+       char path[PATH_MAX] = {0, };
+
+       char *res_path = app_get_resource_path();
+       if (res_path) {
+               snprintf(path, PATH_MAX, "%s%s", res_path, "edje/app_noti_main_layout.edj");
+               free(res_path);
+       }
+
+       elm_layout_file_set(ugd->genlist_layout, path, APP_NOTI_LIST_MAIN_LAYOUT);
 
        /* back Button */
        Evas_Object *back_btn = elm_button_add(ugd->naviframe);
        elm_object_style_set(back_btn, "naviframe/back_btn/default");
        evas_object_smart_callback_add(back_btn, "clicked", back_button_cb, ugd->naviframe);
 
+       Evas_Object *check = elm_check_add(ugd->genlist_layout);
+       elm_object_text_set(check, SHOW_ALL);
+       elm_object_style_set(check, "on&off");
+       elm_object_part_content_set(ugd->genlist_layout, "elm.swallow.button", check);
+       evas_object_show(check);
+
+       Evas_Object *label = elm_label_add(ugd->genlist_layout);
+       elm_object_text_set(label, SELECT_APPS);
+       elm_object_part_content_set(ugd->genlist_layout, "label_part", label);
+       evas_object_show(label);
+
+       /* Create genlist*/
+       ugd->list_main = create_app_notification_gl(ugd);
+       elm_object_part_content_set(ugd->genlist_layout, "elm.swallow.content", ugd->list_main);
+       evas_object_show(ugd->list_main);
+
        /* Push to naviframe */
-       ugd->navi_item = elm_naviframe_item_push(ugd->naviframe, APP_STRING("IDS_ST_HEADER_APP_NOTIFICATIONS_ABB"), back_btn, NULL, ugd->list_main, NULL);
+       ugd->navi_item = elm_naviframe_item_push(ugd->naviframe, APP_STRING("IDS_ST_HEADER_APP_NOTIFICATIONS_ABB"), back_btn, NULL, ugd->genlist_layout, NULL);
+       evas_object_show(ugd->naviframe);
+       evas_object_show(ugd->genlist_layout);
        elm_naviframe_item_pop_cb_set(ugd->navi_item, _notifiacation_setting_main_pop_cb, ugd);
+
+       elm_check_state_set(check, check_all_status_get(ugd));
+       evas_object_smart_callback_add(check, "changed", allow_all_noti_changed_cb, ugd);
+  set_check(check);
 }
 
 static Evas_Object *_create_fullview(Evas_Object *parent, ug_data *ugd, app_type type)
index 24039ec0820d5577334979793f7fee2bd3c65c76..b5d5123c7c9b3e6fdcc5d99116cea31f8b455b62 100644 (file)
@@ -44,10 +44,7 @@ Eina_Bool create_app_notification_list()
        EINA_LIST_FOREACH(not_excepted_list, l, data) {
                item_info_s *item_info = (item_info_s*) data;
                if (item_info->name) {
-                       if (item_info->allow_to_notify)
-                               setting_info->apps_noti_allowed_list = eina_list_append(setting_info->apps_noti_allowed_list, item_info);
-                       else
-                               setting_info->apps_noti_blocked_list = eina_list_append(setting_info->apps_noti_blocked_list, item_info);
+                       setting_info->apps_noti_allowed_list = eina_list_append(setting_info->apps_noti_allowed_list, item_info);
                } else {
                        free_item_info(item_info);
                }
@@ -56,7 +53,6 @@ Eina_Bool create_app_notification_list()
        eina_list_free(not_excepted_list);
 
        setting_info->apps_noti_allowed_list = eina_list_sort(setting_info->apps_noti_allowed_list, eina_list_count(setting_info->apps_noti_allowed_list), apps_sort_cb);
-       setting_info->apps_noti_blocked_list = eina_list_sort(setting_info->apps_noti_blocked_list, eina_list_count(setting_info->apps_noti_blocked_list), apps_sort_cb);
        return EINA_TRUE;
 }
 
@@ -65,11 +61,7 @@ void update_app_notification_list_on_item(item_info_s *item_info)
        ret_if(!item_info);
 
        setting_info->apps_noti_allowed_list = eina_list_remove(setting_info->apps_noti_allowed_list, item_info);
-       setting_info->apps_noti_blocked_list = eina_list_remove(setting_info->apps_noti_blocked_list, item_info);
-       if (get_allow_to_nofity(item_info->package_id))
-               setting_info->apps_noti_allowed_list = eina_list_sorted_insert(setting_info->apps_noti_allowed_list, apps_sort_cb, item_info);
-       else
-               setting_info->apps_noti_blocked_list = eina_list_sorted_insert(setting_info->apps_noti_blocked_list, apps_sort_cb, item_info);
+       setting_info->apps_noti_allowed_list = eina_list_sorted_insert(setting_info->apps_noti_allowed_list, apps_sort_cb, item_info);
 }
 
 void create_do_not_disturb_application_list()