View: Delete notify popup when toast is timeout 54/47154/3
authorHyojung Jo <hj903.jo@samsung.com>
Mon, 31 Aug 2015 08:49:20 +0000 (17:49 +0900)
committerHyojung Jo <hj903.jo@samsung.com>
Mon, 31 Aug 2015 23:37:40 +0000 (08:37 +0900)
Change-Id: I47fa408a8dcc8f1dd35b57347b5ede47b954b876
Signed-off-by: Hyojung Jo <hj903.jo@samsung.com>
include/define.h
src/common/utils.c
src/view/view_base.c

index 449c5b2..1a5eadf 100644 (file)
@@ -62,6 +62,7 @@
 #define SIG_INVISIBLE "invisible"
 #define SIG_DISABLE "elm,state,disabled"
 #define SIG_TOGGLE "toggle"
+#define SIG_TIMEOUT "timeout"
 
 /* Source */
 #define SRC_EDC "edc"
index ed0958c..a491626 100644 (file)
@@ -184,6 +184,14 @@ Evas_Object *utils_add_table(Evas_Object *parent, const char *part,
        return table;
 }
 
+static void _notify_timeout_cb(void *data, Evas_Object *obj, void *ei)
+{
+       if (!obj)
+               return;
+
+       evas_object_del(obj);
+}
+
 Evas_Object *utils_add_notify(Evas_Object *parent, const char *text,
                const char *noti_style, const char *label_style, int timeout)
 {
@@ -224,6 +232,8 @@ Evas_Object *utils_add_notify(Evas_Object *parent, const char *text,
        if (text)
                elm_object_text_set(lbl, text);
 
+       evas_object_smart_callback_add(notify, SIG_TIMEOUT,
+                       _notify_timeout_cb, NULL);
        evas_object_show(notify);
 
        return notify;
index 26cb993..4fe5bf3 100644 (file)
@@ -332,9 +332,6 @@ static void _grid_key_down_cb(int id, void *data, Evas *e, Evas_Object *obj,
                if (!gdata)
                        return;
 
-               if (priv->notify)
-                       evas_object_hide(priv->notify);
-
                viewmgr_update_view(VIEW_ACTION_MENU, UPDATE_DATA, gdata);
                viewmgr_show_view(VIEW_ACTION_MENU);
        }
@@ -541,6 +538,7 @@ static void _update(void *view_data, int update_type, void *data)
        case UPDATE_SHOW_TOAST:
                priv->notify = utils_add_notify(priv->base, (char *)data,
                                STYLE_TOAST, STYLE_TOAST, SIZE_TOAST_TIMEOUT);
+
                break;
 
        default: