Hide action menu view when app is paused 13/47413/3 accepted/tizen/tv/20150903.111011 submit/tizen/20150903.102204
authorHyojung Jo <hj903.jo@samsung.com>
Thu, 3 Sep 2015 07:29:09 +0000 (16:29 +0900)
committerHyojung Jo <hj903.jo@samsung.com>
Thu, 3 Sep 2015 07:41:45 +0000 (16:41 +0900)
Change-Id: Ia8451e30ea001f1aac85a45f82aad95cde3130ec
Signed-off-by: Hyojung Jo <hj903.jo@samsung.com>
src/main.c

index 6fd76e9..9330e02 100644 (file)
@@ -17,6 +17,7 @@
 #include <app.h>
 #include <Elementary.h>
 #include <viewmgr.h>
+#include <inputmgr.h>
 #include <ui-gadget.h>
 #include <app_debug.h>
 
@@ -126,6 +127,26 @@ static void _app_control(app_control_h control, void *data)
                _ERR("Push view failed.");
 }
 
+static void _pause(void *data)
+{
+       view_state state;
+
+       state = viewmgr_get_view_state(VIEW_ACTION_MENU);
+       if (state == VIEW_STATE_VISIBLE)
+               viewmgr_hide_view(VIEW_ACTION_MENU);
+
+       state = viewmgr_get_view_state(VIEW_PIN);
+       if (state == VIEW_STATE_VISIBLE)
+               viewmgr_hide_view(VIEW_PIN);
+
+       inputmgr_enable(EINA_FALSE);
+}
+
+static void _resume(void *data)
+{
+       inputmgr_enable(EINA_TRUE);
+}
+
 int main(int argc, char *argv[])
 {
        struct _appdata ad;
@@ -133,6 +154,8 @@ int main(int argc, char *argv[])
                .create = _create,
                .terminate = _terminate,
                .app_control = _app_control,
+               .pause = _pause,
+               .resume = _resume,
        };
 
        memset(&ad, 0x00, sizeof(ad));