rel1.relative, 1.0 0.0;
rel2.relative, 1.0 0.0;
state, "default" 0.0;
- min, 37 50;
+ min, 38 50;
align, 1.0 0.0;
fixed, 1 1;
}
to_x, "margin.notification";
relative, 1.0 1.0;
}
- min, 489 0;
+ min, 490 0;
align, 0.0 0.0;
fixed, 1 0;
visible, 0;
rel2.relative, 0.0 0.0;
color, 48 48 48 255;
align, 0.0 0.0;
- min, 375 65;
+ min, 376 66;
fixed, 1 1;
+ visible, 1;
}
part {
name, PART_NOTIFICATION_TITLE;
description {
state, "default" 0.0;
text {
- font, "TizenSans";
+ font, FONT_LIGHT;
text, STR_SQUARE_TITLE;
size, 36;
align, 0.5 0.5;
+ min, 1 1;
+ ellipsis, -1;
}
color, 255 255 255 179;
align, 0.0 0.0;
fixed, 1 1;
+ visible, 1;
}
}
}
rel1.relative, 1.0 0.0;
rel2.relative, 1.0 0.0;
align, 1.0 0.0;
- min, 99 65;
+ min, 98 66;
fixed, 1 1;
}
}
to_y, PART_NOTIFICATION_TITLE;
relative, 1.0 1.0;
}
- min, 0 63;
+ min, 0 62;
align, 0.0 0.0;
fixed, 1 1;
}
}
min, 0 0;
align, 0.0 0.0;
- fixed, 1 1;
+ fixed, 0 0;
+ visible, 1;
+ }
+ description {
+ state, "no_notification" 0.0;
+ inherit, "default" 0.0;
+ visible, 0;
+ }
+ }
+ part {
+ name, PART_NOTIFICATION_NO_NOTIFICATION_BG;
+ type, RECT;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ rel1 {
+ to_y, "padding.notification.list";
+ relative, 0.0 1.0;
+ }
+ rel2 {
+ to_y, "padding.notification.list";
+ }
+ color, 48 48 48 255;
+ min, 0 788;
+ align, 0.0 0.0;
+ fixed, 0 1;
+ visible, 0;
+ }
+ description {
+ state, "no_notification" 0.0;
+ inherit, "default" 0.0;
+ visible, 1;
+ }
+
+ part {
+ name, PART_NOTIFICATION_NO_NOTIFICATION;
+ type, TEXT;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ text {
+ text, STR_NONOTIFICATION;
+ font, FONT_LIGHT;
+ size, 28;
+ align, 0.5 0.5;
+ }
+ color, 255 255 255 128;
+ align, 0.5 0.5;
+ fixed, 0 1;
+ visible, 0;
+ }
+ description {
+ state, "no_notification" 0.0;
+ inherit, "default" 0.0;
+ visible, 1;
+ }
}
}
}
to_x, "margin.info";
relative, 0.0 1.0;
}
- min, 500 246;
+ min, 0 246;
align, 1.0 0.0;
- fixed, 1 1;
+ fixed, 0 1;
visible, 0;
}
part {
scale, 1;
description {
state, "default" 0.0;
- rel1.relative, 0.0 0.0;
+ rel1.relative, 1.0 0.0;
rel2.relative, 1.0 0.0;
text {
- font, "TizenSans";
+ font, FONT_LIGHT;
text, STR_DEFAULT_USER_MESSAGE;
size, 56;
align, 1.0 0.0;
+ min, 1 1;
+ ellipsis, -1;
}
min, 0 56;
- align, 0.0 0.0;
+ align, 1.0 0.0;
fixed, 1 1;
visible, 1;
}
to_y, PART_INFO_USER_MESSAGE;
relative, 1.0 1.0;
}
- min, 0 27;
- align, 0.0 0.0;
+ min, 0 24;
+ align, 1.0 0.0;
fixed, 1 1;
}
}
description {
state, "default" 0.0;
rel1.relative, 1.0 0.0;
- rel2.relative, 1.0 1.0;
+ rel2.relative, 1.0 0.0;
text {
- font, "TizenSans";
- text, STR_DEFAULT_TIME_MINUTE;
+ font, FONT_LIGHT;
size, 120;
align, 0.0 1.0;
+ min, 1 0;
+ ellipsis, -1;
}
- min, 132 120;
+ min, 0 120;
align, 1.0 0.0;
fixed, 1 1;
visible, 1;
to_x, PART_INFO_TIME_MINUTE;
relative, 0.0 1.0;
}
- min, 22 120;
+ min, 28 120;
align, 1.0 0.0;
fixed, 1 1;
}
to_x, "padding_right.info.time_separator";
relative, 0.0 1.0;
}
- min, 15 120;
+ min, 14 120;
align, 1.0 0.0;
fixed, 1 1;
visible, 1;
to_x, PART_INFO_TIME_SEPARATOR;
relative, 0.0 1.0;
}
- min, 22 0;
+ min, 20 0;
align, 1.0 0.0;
fixed, 1 1;
}
relative, 0.0 0.0;
}
text {
- font, "TizenSans";
- text, STR_DEFAULT_TIME_HOUR;
+ font, FONT_LIGHT;
size, 120;
align, 0.0 1.0;
+ min, 1 0;
+ ellipsis, -1;
}
- min, 132 120;
+ min, 0 120;
align, 1.0 0.0;
fixed, 1 1;
visible, 1;
to_x, PART_INFO_TIME_HOUR;
relative, 0.0 0.0;
}
- min, 7 8;
+ min, 10 8;
align, 1.0 0.0;
fixed, 1 1;
}
relative, 0.0 1.0;
}
text {
- font, "TizenSans";
- text, STR_DEFAULT_TIME_AM_PM;
+ font, FONT_LIGHT;
size, 30;
- align, 1.0 0.0;
+ align, 1.0 1.0;
+ min, 1 0;
+ ellipsis, -1;
}
- min, 80 30;
+ min, 0 30;
align, 1.0 0.0;
fixed, 1 1;
visible, 1;
relative, 1.0 1.0;
}
text {
- font, "TizenSans";
- text, STR_DEFAULT_DATE;
+ font, FONT_LIGHT;
size, 30;
align, 1.0 1.0;
+ min, 1 1;
+ ellipsis, -1;
}
- min, 0 30;
- align, 0.0 0.0;
+ min, 0 46;
+ align, 1.0 0.0;
fixed, 1 1;
visible, 1;
}
}
}
}
+
+ programs {
+ program {
+ name, "no_notification";
+ signal, SIGNAL_NO_NOTIFICATION;
+ source, SOURCE_PROGRAM;
+ action, STATE_SET "no_notification" 0.0;
+ target, PART_NOTIFICATION_LIST;
+ target, PART_NOTIFICATION_NO_NOTIFICATION_BG;
+ target, PART_NOTIFICATION_NO_NOTIFICATION;
+ }
+ program {
+ name, "notification";
+ signal, SIGNAL_NOTIFICATION;
+ action, STATE_SET "default" 0.0;
+ source, SOURCE_PROGRAM;
+ target, PART_NOTIFICATION_LIST;
+ target, PART_NOTIFICATION_NO_NOTIFICATION_BG;
+ target, PART_NOTIFICATION_NO_NOTIFICATION;
+ }
+ }
}
group {
scale, 1;
description {
state, "default" 0.0;
- min, 489 112;
+ min, 490 112;
color, 51 51 51 255;
visible, 1;
}
to, "border_bg";
relative, 0.5 0.5;
}
- min, 485 108;
+ min, 486 108;
color, 0 0 0 255;
align, 0.5 0.5;
fixed, 1 1;
description {
state, "focused" 0.0;
inherit, "default" 0.0;
- min, 481 104;
- color, 46 46 46 51;
+ min, 482 104;
+ color, 46 46 46 255;
}
}
part {
to_x, "padding.icon";
relative, 1.0 0.5;
}
+ color, 255 255 255 153;
align, 0.0 0.5;
min, 54 54;
fixed, 1 1;
}
}
part {
- name, PART_TEXT;
+ name, PART_TITLE;
type, TEXT;
scale, 1;
description {
relative, 1.0 0.5;
}
text {
- font, "TizenSans";
+ font, FONT_LIGHT;
size, 27;
align, 0.0 0.5;
}
+ color, 255 255 255 128;
min, 354 27;
align, 0.0 0.5;
fixed, 1 1;
visible, 1;
}
+ description {
+ state, "focused" 0.0;
+ inherit, "default" 0.0;
+ color, 255 255 255 255;
+ text.font, FONT_REGULAR;
+ }
+ }
+ }
+ programs {
+ program {
+ name, "focused";
+ signal, SIGNAL_FOCUSED;
+ source, SOURCE_PROGRAM;
+ action, STATE_SET "focused" 0.0;
+ target, "border_bg";
+ target, "bg";
+ target, PART_TITLE;
+ }
+ program {
+ name, "unfocused";
+ signal, SIGNAL_UNFOCUSED;
+ source, SOURCE_PROGRAM;
+ action, STATE_SET "default" 0.0;
+ target, "border_bg";
+ target, "bg";
+ target, PART_TITLE;
}
}
}
rel2.relative, 1.0 0.0;
color, 48 48 48 255;
align, 1.0 0.0;
- min, 99 65;
+ min, 98 66;
fixed, 1 1;
}
part {
#include <inputmgr.h>
#include <app_debug.h>
#include <notification.h>
+#include <notification_internal.h>
#include <vconf.h>
#include "define.h"
#define KEY_USER_MESSAGE "db/setting/user_message"
+#define KEY_NOTI "KEY_NOTI"
#define CLOCK_UPDATE_DUR 1
#define NOTIFICATION_ITEM_PADDING_X 0
#define NOTIFICATION_ITEM_PADDING_Y 20
+#define SIG_CHILD_REMOVED "child,removed"
static void _clear_key_up_cb(int id, void *data,
Evas *e, Evas_Object *obj, Evas_Event_Key_Up *ev);
static void _clear_clicked_cb(int id, void *data, Evas_Object *obj);
+static void _child_removed_cb(void *data, Evas_Object *obj, void *ei);
+static void _focused_cb(int id, void *data,
+ Evas_Object *obj, Elm_Object_Item *item);
+static void _unfocused_cb(int id, void *data,
+ Evas_Object *obj, Elm_Object_Item *item);
+static void _mouse_move_cb(int id, void *data, Evas *e,
+ Evas_Object *obj, Evas_Event_Mouse_Move *ev);
struct _priv {
Evas_Object *base;
Evas_Object *list;
Evas_Object *clear_btn;
Ecore_Timer *clock_timer;
- notification_list_h noti_list;
};
static input_handler clear_handler = {
.clicked = _clear_clicked_cb
};
+static input_handler focus_handler = {
+ .focused = _focused_cb,
+ .unfocused = _unfocused_cb,
+ .mouse_move = _mouse_move_cb
+};
+
static void _print_user_message(struct _priv *priv)
{
char *message;
{
Evas_Object *icon, *item;
notification_h noti = NULL;
- notification_list_h get_list = NULL;
+ notification_list_h noti_list = NULL;
char *title = NULL, *icon_path = NULL;
elm_box_clear(priv->list);
- if (priv->noti_list) {
- notification_free_list(priv->noti_list);
- priv->noti_list = NULL;
- }
-
- notification_get_list(NOTIFICATION_TYPE_NOTI, -1, &priv->noti_list);
- if (priv->noti_list) {
+ notification_get_list(NOTIFICATION_TYPE_NOTI, -1, ¬i_list);
+ if (noti_list) {
elm_object_signal_emit(priv->base,
SIGNAL_NOTIFICATION, SOURCE_PROGRAM);
elm_object_disabled_set(priv->clear_btn, EINA_FALSE);
- get_list = notification_list_get_head(priv->noti_list);
- noti = notification_list_get_data(get_list);
- while (get_list != NULL) {
+ while (noti_list != NULL) {
+ noti = notification_list_get_data(noti_list);
+
item = elm_layout_add(priv->list);
elm_layout_file_set(item, EDJEFILE,
GRP_NOTIFICATION_ITEM);
elm_object_focus_allow_set(item, EINA_TRUE);
+ evas_object_data_set(item, KEY_NOTI, noti);
notification_get_image(noti,
NOTIFICATION_IMAGE_TYPE_ICON,
evas_object_show(item);
- get_list = notification_list_get_next(get_list);
- noti = notification_list_get_data(get_list);
+ inputmgr_add_callback(item, 0, &focus_handler, NULL);
+
+ noti_list = notification_list_remove(noti_list, noti);
}
} else {
elm_object_signal_emit(priv->base,
}
}
+static void _noti_changed_cb(void *data, notification_type_e type)
+{
+ struct _priv *priv = data;
+
+ if (priv)
+ _update_list(priv);
+}
+
static Evas_Object *_create(Evas_Object *win, void *data)
{
struct _priv *priv;
scroller = elm_scroller_add(priv->base);
if (!scroller)
goto error;
+ elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_OFF,
+ ELM_SCROLLER_POLICY_OFF);
elm_object_part_content_set(priv->base,
PART_NOTIFICATION_LIST, scroller);
evas_object_show(scroller);
NOTIFICATION_ITEM_PADDING_Y);
evas_object_show(priv->list);
elm_object_content_set(scroller, priv->list);
+ evas_object_smart_callback_add(priv->list, SIG_CHILD_REMOVED,
+ _child_removed_cb, NULL);
priv->clear_btn = elm_layout_add(priv->base);
elm_layout_file_set(priv->clear_btn, EDJEFILE, GRP_NOTIFICATION_CLEAR);
PART_NOTIFICATION_CLEAR, priv->clear_btn);
evas_object_show(priv->clear_btn);
+ inputmgr_add_callback(priv->clear_btn, 0, &focus_handler, NULL);
inputmgr_add_callback(priv->clear_btn, 0, &clear_handler, NULL);
viewmgr_set_view_data(SQUARE_VIEW, priv);
evas_object_show(priv->base);
start_clock_timer(priv);
+ notification_resister_changed_cb(_noti_changed_cb, priv);
}
static void _hide(void *view_data)
priv = (struct _priv *) view_data;
stop_clock_timer(priv);
+ notification_unresister_changed_cb(_noti_changed_cb);
evas_object_hide(priv->base);
}
priv = (struct _priv *) view_data;
- if (priv->noti_list) {
- notification_free_list(priv->noti_list);
- priv->noti_list = NULL;
- }
-
stop_clock_timer(priv);
+ inputmgr_remove_callback(priv->clear_btn, &clear_handler);
+ inputmgr_remove_callback(priv->clear_btn, &focus_handler);
evas_object_del(priv->base);
notification_delete_all(NOTIFICATION_TYPE_NOTI);
}
+static void _focused_cb(int id, void *data,
+ Evas_Object *obj, Elm_Object_Item *item)
+{
+ elm_object_signal_emit(obj, SIGNAL_FOCUSED, SOURCE_PROGRAM);
+}
+
+static void _unfocused_cb(int id, void *data,
+ Evas_Object *obj, Elm_Object_Item *item)
+{
+ elm_object_signal_emit(obj, SIGNAL_UNFOCUSED, SOURCE_PROGRAM);
+}
+
+static void _mouse_move_cb(int id, void *data, Evas *e,
+ Evas_Object *obj, Evas_Event_Mouse_Move *ev)
+{
+ if (!elm_object_focus_get(obj))
+ elm_object_focus_set(obj, EINA_TRUE);
+}
+
+static void _child_removed_cb(void *data, Evas_Object *obj, void *ei)
+{
+ notification_h noti;
+ Evas_Object *item = ei;
+
+ if (!ei)
+ return;
+
+ noti = evas_object_data_del(item, KEY_NOTI);
+ if (noti)
+ notification_free(noti);
+
+ inputmgr_remove_callback(item, &focus_handler);
+}
+
static view_class vclass = {
.view_id = SQUARE_VIEW,
.create = _create,