Make volume hide when another application is clicked 22/74322/1 submit/accepted/tizen_common/20160614.015826 submit/accepted/tizen_common/20160616.055350
authorjunkyu han <junkyu.han@samsung.com>
Tue, 14 Jun 2016 01:30:14 +0000 (10:30 +0900)
committerjunkyu han <junkyu.han@samsung.com>
Tue, 14 Jun 2016 01:30:49 +0000 (10:30 +0900)
Change-Id: I37bd1aa8d97b6358968f1582c2eece8aa9c54fbe

data/volume_app.edc
src/control.c
src/view.c

index 7ff90c7..fcf27a2 100755 (executable)
@@ -246,6 +246,15 @@ RESOURCE_IMAGE_PRESS("00_volume_icon_settings_pressed.png");
                                        color: 0 0 0 0;
                                }
                        }
+                       part {
+                               name : "bg_for_event";
+                               type : RECT;
+
+                               description {
+                                       state : "default" 0.0;
+                                       color: 0 0 0 0;
+                               }
+                       }
 
                        part {
                                name : "bg";
@@ -551,6 +560,12 @@ RESOURCE_IMAGE_PRESS("00_volume_icon_settings_pressed.png");
                                action: STATE_SET "default" 0.0;
                                target: "bg";
                        }
+                       program{
+                               name: "volume_down_for_hide";
+                               signal: "mouse,down,1";
+                               source: "bg_for_event";
+                               action: SIGNAL_EMIT "hide,volume" "hide";
+                       }
                }
        }
 }
index 38bc890..454c184 100755 (executable)
@@ -364,6 +364,8 @@ Eina_Bool volume_control_show_view(int status, sound_type_e sound_type, int soun
                //@TODO: need to check
                volume_view_volume_icon_set(sound_type, sound, vibration, bt_opened);
 
+               volume_service_region_set(win, false);
+
                return EINA_TRUE;
        }
 }
index 2b8525a..3227b2c 100755 (executable)
@@ -400,6 +400,13 @@ void _connect_to_wm(Evas_Object *win)
        }
 }
 
+static void _down_for_hide(void *data, Evas_Object *obj, const char* emission, const char* source)
+{
+       LOGD("Down for HIDE");
+
+       volume_control_hide_view();
+}
+
 volume_error_e volume_view_layout_create(Evas_Object *win)
 {
        LOGD("Layout create");
@@ -430,6 +437,9 @@ volume_error_e volume_view_layout_create(Evas_Object *win)
        view_info.slider = slider;
        elm_object_part_content_set(ly_outer, "sw.slider", slider);
 
+       /* add callback for hide */
+       elm_object_signal_callback_add(ly_outer, "hide,volume", "hide", _down_for_hide, NULL);
+
        return VOLUME_ERROR_OK;
 }