TizenRefApp-6853 Prepare layout of sample-notification for "Notifications on Lockscre... 01/83001/2
authorOleksander Kostenko <o.kostenko@samsung.com>
Mon, 8 Aug 2016 11:44:37 +0000 (14:44 +0300)
committerOleksander Kostenko <o.kostenko@samsung.com>
Tue, 9 Aug 2016 08:37:01 +0000 (11:37 +0300)
Change-Id: Ief4f4a87bff6c6979545d6488cb6668d2302eff0
Signed-off-by: Oleksander Kostenko <o.kostenko@samsung.com>
Build/build_edc.mk
Build/flags.mk
Build/makefile.mk
inc/common-efl.h
inc/lock_screen_content.h [new file with mode: 0644]
project_def.prop
src/CMakeLists.txt
src/common-efl.c
src/lock_screen_content.c [new file with mode: 0644]
src/main.c

index 38e559846f9e21b9ba4dc9a63da8430f2a0b3087..8485bb295313bb47601ede0f82c240d880515ba1 100644 (file)
@@ -58,9 +58,9 @@ ifneq ($$(strip $$(_ALL_SRCS)),)
 
 _ENC_SRCS := $$(call ENCODE_4MAKE,$$(_ALL_SRCS)) 
 
-_COMPILER_FLAGS := -id "$$(SDK_TOOLPATH)/enventor/share/enventor/images"
-_COMPILER_FLAGS += -sd "$$(SDK_TOOLPATH)/enventor/share/enventor/sounds"
-_COMPILER_FLAGS += -fd "$$(SDK_TOOLPATH)/enventor/share/enventor/fonts"
+_COMPILER_FLAGS := -id "$$(_OUTPUT_DIR)" -id "$$(SDK_TOOLPATH)/enventor/share/enventor/images"
+_COMPILER_FLAGS += -sd "$$(_OUTPUT_DIR)" -sd "$$(SDK_TOOLPATH)/enventor/share/enventor/sounds"
+_COMPILER_FLAGS += -fd "$$(_OUTPUT_DIR)" -fd "$$(SDK_TOOLPATH)/enventor/share/enventor/fonts"
 
 ifneq ($$(strip $$(_IMAGE_DIRS)),)
 _COMPILER_FLAGS += $$(addprefix -id ,$$(_IMAGE_DIRS))
index 1f3c7f8147a92ccfb2d95b55cf1681554bdd002f..556cbd1e18aa8009140175c7f0a569059dfa95ca 100644 (file)
@@ -1,8 +1,8 @@
 
-DEBUG_OP = -g3 
+DEBUG_OP = -g 
 CPP_DEBUG_OP = 
 
-OPTIMIZATION_OP = -O0 
+OPTIMIZATION_OP = -O3 
 CPP_OPTIMIZATION_OP = 
 
 COMPILE_FLAGS = $(DEBUG_OP) $(OPTIMIZATION_OP) -Wall -c -fmessage-length=0 -fPIC 
index b07df262cd4f746feac5b28b64d2c5d9a5f69ff3..7384d248a72e6cf4305aa0dce3e4f5ec1269e55a 100644 (file)
@@ -2,7 +2,7 @@
 # Usege : make -f <proj_root>/Build/makefile -C <proj_root> 
 #
  
-BUILD_SCRIPT_VERSION := 1.2.0
+BUILD_SCRIPT_VERSION := 1.2.2
 
 .PHONY : app_version app_clean build_version
 
@@ -63,7 +63,7 @@ ifeq ($(strip $(APPTYPE)),sharedLib)
 EXT_OP := -fPIC
 endif
 
-C_OPT := $(C_COMPILE_FLAGS) $(TC_COMPILER_MISC) $(RS_COMPILER_MISC) $(EXT_OP) --sysroot="$(SYSROOT)" -Werror-implicit-function-declaration $(M_OPT)
+C_OPT := $(COMPILE_FLAGS) $(TC_COMPILER_MISC) $(RS_COMPILER_MISC) $(EXT_OP) --sysroot="$(SYSROOT)" -Werror-implicit-function-declaration $(M_OPT)
 CPP_OPT := $(CPP_COMPILE_FLAGS) $(TC_COMPILER_MISC) $(RS_COMPILER_MISC) $(EXT_OP) --sysroot="$(SYSROOT)" -Werror-implicit-function-declaration $(M_OPT)
 C_OPT_FILE := $(PLATFORM_INCS_FILE)
 
@@ -85,7 +85,7 @@ endif
 
 ifneq ($(strip $(USER_LIB_DIRS)),)
 _ENC_USER_LIB_DIRS := $(call ENCODE_4MAKE,$(USER_LIB_DIRS))
-_ENC_USER_LIB_DIRS := $(addprefix -L,$(call $(_ENC_USER_LIB_DIRS))
+_ENC_USER_LIB_DIRS := $(addprefix -L,$(_ENC_USER_LIB_DIRS))
 LIBPATHS := $(call DECODE_4MAKE,$(_ENC_USER_LIB_DIRS))
 endif
 
index 5f0ede7957523452d1fc6bb31c5840fb7f9e50c6..5b449b884af35e1656a694f5c7398c29d600ddf8 100755 (executable)
@@ -77,7 +77,6 @@ enum {
        ITEM_STYLE_RADIO,
 };
 
-
 ug_data* get_app_ui_data() ;
 void set_app_ui_data(ug_data *data);
 
diff --git a/inc/lock_screen_content.h b/inc/lock_screen_content.h
new file mode 100644 (file)
index 0000000..f253f2a
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2009 - 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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 __LOCK_SCREEN_CONTENT_H__
+#define __LOCK_SCREEN_CONTENT_H__
+
+/**
+ * @brief Show all content in notification on lock screen menu
+ */
+void show_all_content_clicked();
+
+/**
+ * @brief Hide sensitive content in notification on lock screen menu
+ */
+void hide_sensitive_content_clicked();
+
+/**
+ * @brief Clear the list of apps in notification on lock screen menu
+ */
+void do_not_show_notifications_clicked();
+
+#endif /* __LOCK_SCREEN_CONTENT_H__ */
index e82619dc9999699edcc82367f08712051eac1333..d5c73db62d74eed042e859ba8cece4d30e2478c7 100644 (file)
@@ -8,15 +8,14 @@ type = app
 # Project Profile
 profile = mobile-3.0
 
-# C Sources
-USER_SRCS = src/common-efl.c src/do-not-disturb-efl.c src/notification-setting-info.c src/excepted-apps-efl.c src/main.c src/allowed-calls.c src/pkgmgr-setting-info.c src/set-schedule-info.c 
-USER_SRCS_ABS = 
+# C/CPP Sources
+USER_SRCS = src/common-efl.c src/do-not-disturb-efl.c src/notification-setting-info.c src/excepted-apps-efl.c src/main.c src/allowed-calls.c src/pkgmgr-setting-info.c src/lock_screen_content.c src/set-schedule-info.c 
 
 # EDC Sources
 USER_EDCS =  
 
 # PO Sources
-USER_POS = res/po/fr.po res/po/it_IT.po res/po/et.po res/po/sr.po res/po/hy.po res/po/ca.po res/po/is.po res/po/hi.po res/po/az.po res/po/en_US.po res/po/hr.po res/po/ka.po res/po/zh_HK.po res/po/pl.po res/po/el_GR.po res/po/ko_KR.po res/po/lt.po res/po/sl.po res/po/uz.po res/po/sv.po res/po/fi.po res/po/fr_CA.po res/po/eu.po res/po/bg.po res/po/ja_JP.po res/po/en_PH.po res/po/nl.po res/po/gl.po res/po/uk.po res/po/de.po res/po/tr_TR.po res/po/zh_TW.po res/po/en.po res/po/lv.po res/po/nb.po res/po/pt_PT.po res/po/ru_RU.po res/po/da.po res/po/ro.po res/po/es_ES.po res/po/mk.po res/po/ga.po res/po/sk.po res/po/kk.po res/po/cs.po res/po/pt_BR.po res/po/hu.po res/po/zh_CN.po res/po/ar.po res/po/es_US.po 
+USER_POS = res/po/fr.po res/po/it_IT.po res/po/et.po res/po/sr.po res/po/hy.po res/po/ca.po res/po/is.po res/po/hi.po res/po/az.po res/po/en_US.po res/po/hr.po res/po/ka.po res/po/zh_HK.po res/po/pl.po res/po/el_GR.po res/po/ko_KR.po res/po/lt.po res/po/sl.po res/po/uz.po res/po/sv.po res/po/fi.po res/po/eu.po res/po/fr_CA.po res/po/bg.po res/po/ja_JP.po res/po/en_PH.po res/po/nl.po res/po/gl.po res/po/uk.po res/po/de.po res/po/tr_TR.po res/po/zh_TW.po res/po/en.po res/po/lv.po res/po/nb.po res/po/pt_PT.po res/po/ru_RU.po res/po/da.po res/po/ro.po res/po/es_ES.po res/po/mk.po res/po/ga.po res/po/sk.po res/po/kk.po res/po/cs.po res/po/pt_BR.po res/po/hu.po res/po/zh_CN.po res/po/ar.po res/po/es_US.po 
 
 # User Defines
 USER_DEFS = 
@@ -31,42 +30,32 @@ USER_LIBS =
 
 # User Objects
 USER_OBJS = 
-USER_OBJS_ABS = 
 
 # User Includes
 ## C Compiler
-USER_INC_DIRS = inc 
-USER_INC_DIRS_ABS = 
+USER_C_INC_DIRS = inc 
 USER_INC_FILES = 
-USER_INC_FILES_ABS = 
 ## C++ Compiler
 USER_CPP_INC_DIRS = 
-USER_CPP_INC_DIRS_ABS = 
 USER_CPP_INC_FILES = 
-USER_CPP_INC_FILES_ABS = 
+
+USER_INC_DIRS = $(USER_C_INC_DIRS) $(USER_CPP_INC_DIRS)
 
 # User Library Path
 USER_LIB_DIRS = 
-USER_LIB_DIRS_ABS = 
 
 # EDC Resource Path
-USER_EDCS_IMAGE_DIRS = edje/images 
-USER_EDCS_IMAGE_DIRS_ABS = 
-USER_EDCS_SOUND_DIRS = edje/sounds 
-USER_EDCS_SOUND_DIRS_ABS = 
-USER_EDCS_FONT_DIRS = edje/fonts 
-USER_EDCS_FONT_DIRS_ABS = 
+USER_EDCS_IMAGE_DIRS = ${OUTPUT_DIR} edje/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/repeat_weekly_item.edc res/edje/setting_notification.edc res/edje/reject_calls_popup.edc res/edje/time_button_layout.edc 
-USER_EXT_EDC0_EDCS_IMAGE_DIRS = edje/images 
-USER_EXT_EDC0_EDCS_IMAGE_DIRS_ABS = 
-USER_EXT_EDC0_EDCS_SOUND_DIRS = edje/sounds 
-USER_EXT_EDC0_EDCS_SOUND_DIRS_ABS = 
-USER_EXT_EDC0_EDCS_FONT_DIRS = edje/fonts 
-USER_EXT_EDC0_EDCS_FONT_DIRS_ABS = 
+USER_EXT_EDC0_EDCS_IMAGE_DIRS = ${OUTPUT_DIR} edje/images 
+USER_EXT_EDC0_EDCS_SOUND_DIRS = ${OUTPUT_DIR} edje/sounds 
+USER_EXT_EDC0_EDCS_FONT_DIRS = ${OUTPUT_DIR} edje/fonts 
 
 # Resource Filter
 USER_RES_INCLUDE = 
index 8488f735f3ec4624535d1b81d5fd42389c1dfac0..072d55b2b5d5818ad0677a0ef09564f251dc46c3 100644 (file)
@@ -11,6 +11,7 @@ SET(SRCS
        common-efl.c
        do-not-disturb-efl.c
        excepted-apps-efl.c
+       lock_screen_content.c
        main.c
        notification-setting-info.c
     pkgmgr-setting-info.c
index f17e1a03ad8d8d1607ec1b54aaf729543e3472ec..e75d3a8d7e1e5c0be9a84c1068a45be8146a9110 100755 (executable)
@@ -19,6 +19,7 @@
 #include "common-efl.h"
 #include "set-scedule-info.h"
 #include "allowed-calls.h"
+#include "lock_screen_content.h"
 
 #define ICON_SIZE 82
 
@@ -338,6 +339,19 @@ static void gl_radio_sel_cb(void *data, Evas_Object *obj, void *event_info)
     elm_genlist_item_selected_set(it, EINA_FALSE);
     radio = elm_object_item_part_content_get(it, "elm.swallow.end");
     elm_radio_value_set(radio, index + 1);
+
+    switch (index)
+    {
+        case 0:
+            show_all_content_clicked();
+            break;
+        case 1:
+            hide_sensitive_content_clicked();
+            break;
+        case 2:
+            do_not_show_notifications_clicked();
+            break;
+    }
 }
 
 void append_gl_radio_item_list(Evas_Object *genlist, Eina_List* list, char *style)
@@ -489,13 +503,32 @@ static char *_gl_option_text_get_cb(void *data, Evas_Object *obj, const char *pa
             return strdup(APP_STRING("IDS_ST_MBODY_ALLOWED_CALLS_ABB"));
         }
     }
+    else if(!strcmp(data, "show-all-content"))
+    {
+
+        if(!strcmp("elm.text", part))
+            return strdup("Picture.jpg");
+        else if(!strcmp("elm.text.sub", part))
+            return strdup("Download complete");
+        else if(!strcmp("elm.text.sub.end", part))
+            return strdup("Time");
+    }
+    else if(!strcmp(data, "hide-sensitive-content"))
+    {
+        if(!strcmp("elm.text", part))
+            return strdup("Download manager");
+        else if(!strcmp("elm.text.sub", part))
+            return strdup("Content hidden");
+        else if(!strcmp("elm.text.sub.end", part))
+            return strdup("Date");
+    }
 
        return NULL;
 }
 
 static Evas_Object* _gl_option_content_get_cb(void *data, Evas_Object *obj, const char *part)
 {
-       retv_if(!data, NULL);
+    retv_if(!data, NULL);
 
     if(!strcmp(data, "do-not-disturb") && !strcmp(part, "elm.swallow.end"))
     {
@@ -531,6 +564,12 @@ static Evas_Object* _gl_option_content_get_cb(void *data, Evas_Object *obj, cons
     {
         return start_end_time_item(obj, false);
     }
+
+    if ((!strcmp(data, "hide-sensitive-content") || !strcmp(data, "show-all-content")) && !strcmp(part, "elm.swallow.icon"))
+    {
+       return create_icon(obj, NULL);
+    }
+
     return NULL;
 }
 
@@ -584,26 +623,27 @@ Elm_Widget_Item *append_gl_allow_all(Evas_Object *genlist)
        return item;
 }
 
-void append_gl_start_option(Evas_Object *genlist, char *style, char *ugName) {
+void append_gl_start_option(Evas_Object *genlist, char *style, char *ugName)
+{
     NOTISET_TRACE_BEGIN;
 
-       Elm_Genlist_Item_Class *itc = elm_genlist_item_class_new();
-       ret_if(!itc);
+    Elm_Genlist_Item_Class *itc = elm_genlist_item_class_new();
+    ret_if(!itc);
 
-       itc->item_style = style;
-       itc->func.text_get = _gl_option_text_get_cb;
-       itc->func.content_get = _gl_option_content_get_cb;
-       itc->func.del = gl_del_cb;
+    itc->item_style = style;
+    itc->func.text_get = _gl_option_text_get_cb;
+    itc->func.content_get = _gl_option_content_get_cb;
+    itc->func.del = gl_del_cb;
 
-       elm_genlist_item_append(genlist,                                            /* genlist object */
-                                           itc,                                                        /* item class */
-                                           ugName,                                                     /* item class user data */
-                                           NULL,                                                       /* parent item */
-                                           ELM_GENLIST_ITEM_NONE,                      /* item type */
-                                           gl_selected_cb,                             /* select smart callback */
-                                           ugName);                                            /* smart callback user data */
+    elm_genlist_item_append(genlist,                    /* genlist object */
+                            itc,                        /* item class */
+                            ugName,                     /* item class user data */
+                            NULL,                       /* parent item */
+                            ELM_GENLIST_ITEM_NONE,      /* item type */
+                            gl_selected_cb,             /* select smart callback */
+                            ugName);                    /* smart callback user data */
 
-       elm_genlist_item_class_free(itc);
+    elm_genlist_item_class_free(itc);
 }
 
 void cancel_button_noti_ls_cb(void *data, Evas_Object *obj, void *event_info)
diff --git a/src/lock_screen_content.c b/src/lock_screen_content.c
new file mode 100644 (file)
index 0000000..5620738
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2009 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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 "common-efl.h"
+
+void show_all_content_clicked()
+{
+    NOTISET_TRACE_BEGIN;
+    ug_data *ugd = get_app_ui_data();
+
+    Elm_Object_Item *genlist_item = elm_genlist_first_item_get(ugd->list_sub);
+
+    if(genlist_item)
+        elm_genlist_clear(ugd->list_sub);
+
+    append_gl_start_option(ugd->list_sub, "type1", "show-all-content");
+
+}
+
+void hide_sensitive_content_clicked()
+{
+    NOTISET_TRACE_BEGIN;
+    ug_data *ugd = get_app_ui_data();
+
+    Elm_Object_Item *genlist_item = elm_genlist_first_item_get(ugd->list_sub);
+
+    if(genlist_item)
+        elm_genlist_clear(ugd->list_sub);
+
+    append_gl_start_option(ugd->list_sub, "type1", "hide-sensitive-content");
+}
+
+void do_not_show_notifications_clicked()
+{
+    NOTISET_TRACE_BEGIN;
+    ug_data *ugd = get_app_ui_data();
+
+    elm_genlist_clear(ugd->list_sub);
+}
+
index 87f6c0b9cfb2cf2a6d7b715afafa2d59ac2576d1..a4c8b9b6629c1a327bf5bc478d5313ed06452af8 100755 (executable)
@@ -30,6 +30,7 @@
 #define APP_NOTIFICATIONS_OP "http://tizen.org/appcontrol/operation/setting/app_notifications"
 
 #define WHITE_COLOR 255, 255, 255, 255
+#define PADDING_TOP 300
 
 typedef enum
 {
@@ -101,24 +102,31 @@ static Evas_Object* _create_do_not_disturb_gl(ug_data *ugd)
 
 Evas_Object* _create_lockscreen_content(ug_data *ugd)
 {
+    Evas_Object *bg = create_background(ugd->naviframe);
+    evas_object_size_hint_align_set(bg, EVAS_HINT_FILL, EVAS_HINT_FILL);
+    evas_object_show(bg);
+
     /* box */
-    Evas_Object *box = elm_box_add(ugd->naviframe);
+    Evas_Object *box = elm_box_add(bg);
+    elm_object_part_content_set(bg, "elm.swallow.content", box);
     elm_box_homogeneous_set(box, EINA_FALSE);
     evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
     evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
 
-    Evas_Object *bg = create_background(box);
-    evas_object_size_hint_align_set(bg, EVAS_HINT_FILL, EVAS_HINT_FILL);
-
-    Evas_Object *layout = create_layout(bg);
-    evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
-    elm_object_part_content_set(bg, "elm.swallow.content", layout);
-    elm_box_pack_end(box, bg);
+    /* Upper genlist */
+    Evas_Object *upper_genlist = elm_genlist_add(box);
+    evas_object_size_hint_weight_set(upper_genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+    evas_object_size_hint_align_set(upper_genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
+    evas_object_size_hint_padding_set(upper_genlist, 0, 0, PADDING_TOP, 0);
+    elm_genlist_mode_set(upper_genlist, ELM_LIST_COMPRESS);
+    evas_object_show(upper_genlist);
+    ugd->list_sub = upper_genlist;
+    elm_box_pack_end(box, upper_genlist);
 
     /* Lower genlist */
     Evas_Object *lower_genlist = elm_genlist_add(box);
     append_gl_radio_item_list(lower_genlist, get_lower_noti_list(), "default");
-    evas_object_size_hint_weight_set(lower_genlist, EVAS_HINT_EXPAND, 0.5);
+    evas_object_size_hint_weight_set(lower_genlist, EVAS_HINT_EXPAND, 0.8);
     evas_object_size_hint_align_set(lower_genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
     elm_genlist_mode_set(lower_genlist, ELM_LIST_COMPRESS);
     evas_object_show(lower_genlist);
@@ -126,7 +134,7 @@ Evas_Object* _create_lockscreen_content(ug_data *ugd)
 
     evas_object_show(box);
 
-    return box;
+    return bg;
 }
 
 Evas_Object* _create_app_notification_gl(ug_data *ugd)