Add close function for moments-popup 15/134515/1
authorjin0.kim <jin0.kim@samsung.com>
Mon, 19 Jun 2017 04:46:05 +0000 (13:16 +0830)
committerjin0.kim <jin0.kim@samsung.com>
Mon, 19 Jun 2017 04:46:05 +0000 (13:16 +0830)
Change-Id: I74c2e4b98627194798782490b3a4852872944b30

inc/moments/moments_control_view.h
src/home_app_manager.c
src/moments/moments_control_view.c

index c5ecbb1f1f5b4bceb3b6e46f09dfc03f4952e8f9..de2981f10172d0b58026efb5f7f1341309734a59 100755 (executable)
@@ -69,5 +69,10 @@ position_t *moments_control_get_button_position(int total_count, int index);
 void moments_control_clear_button_list(void);
 
 Eina_List * __t__get_moments_control_button_list(void);
+bool moments_control_get_do_not_disturb_popup_visible(void);
+bool moments_control_get_flight_mode_popup_visible(void);
+void moments_control_do_not_disturb_popup_close(void);
+void moments_control_flight_mode_popup_close(void);
+
 #endif
 
index 56458f64a8bf3d3ad0e806fc9e259289ef675910..26c98ff28b1a4218a79b5454acd88bf04b079a4f 100755 (executable)
@@ -50,6 +50,7 @@
 #include "notification/noti_detail_view.h"
 #include "notification/noti_time.h"
 #include "moments/moments.h"
+#include "moments/moments_control_view.h"
 #include "common_conf.h"
 #include "test.h"
 
@@ -1165,8 +1166,11 @@ void app_control(app_control_h service, void *data)
                        } else if (focused_page == main_info.clock_focus) {
                                if (moments_get_visible()) {
                                        moments_hide();
-                               }
-                               else {
+                               } else if (moments_control_get_do_not_disturb_popup_visible() == true) {
+                                       moments_control_do_not_disturb_popup_close();
+                               } else if (moments_control_get_flight_mode_popup_visible() == true) {
+                                       moments_control_flight_mode_popup_close();
+                               } else {
                                        apps_show();
                                }
                        }
index b2038e224ed3c16ae5f0f3603d248671a87943f6..080175052a5fa40a1b90eb2180270eba4376fede 100755 (executable)
@@ -567,6 +567,21 @@ static Evas_Object *__do_not_disturb_popup_view_create()
        return popup;
 }
 
+bool moments_control_get_do_not_disturb_popup_visible(void)
+{
+       if (s_info.do_not_disturb_popup != NULL && evas_object_visible_get(s_info.do_not_disturb_popup) == true)
+               return true;
+
+       return false;
+}
+
+bool moments_control_get_flight_mode_popup_visible(void)
+{
+       if (s_info.flight_mode_popup != NULL && evas_object_visible_get(s_info.flight_mode_popup) == true)
+               return true;
+
+       return false;
+}
 
 static void __do_not_disturb_pressed_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
@@ -597,6 +612,16 @@ static void __flight_mode_popup_cancel_cb(void *data, Evas_Object *obj, void *ev
        }
 }
 
+void moments_control_do_not_disturb_popup_close(void)
+{
+       __do_not_disturb_popup_cancel_cb(NULL, NULL, NULL);
+}
+
+void moments_control_flight_mode_popup_close(void)
+{
+       __flight_mode_popup_cancel_cb(NULL, NULL, NULL);
+}
+
 static void __flight_mode_popup_ok_cb(void *data, Evas_Object *obj, void *event_info)
 {
        if (evas_object_visible_get(s_info.flight_mode_popup) == false) {