From 83007c0633f1b6071b31933f8343c89f06969b7e Mon Sep 17 00:00:00 2001 From: Igor Olshevskyi Date: Wed, 6 Apr 2016 13:40:01 +0300 Subject: [PATCH] TizenRefApp-6065 [Call UI] Add possibility close application on click on End Call view empty background Change-Id: I9ba9456bf16f3532ea43d2ae7da62e9e66342ff8 --- src/callui-view-callend.c | 13 +++++++++++ src/callui-view-incoming-call.c | 50 ++++++++++++++++++++++++++++------------- 2 files changed, 47 insertions(+), 16 deletions(-) diff --git a/src/callui-view-callend.c b/src/callui-view-callend.c index 5db07ac..02c851e 100644 --- a/src/callui-view-callend.c +++ b/src/callui-view-callend.c @@ -78,6 +78,8 @@ static callui_result_e __create_single_contact_info(callui_view_callend_h vd, co static void __set_emergency_call_info(callui_view_callend_h vd, const callui_call_state_data_t *call_data); static void __set_conference_call_info(callui_view_callend_h vd, const callui_call_state_data_t *call_data); +static void __bg_mouse_down_cb(void *data, Evas_Object *o, const char *emission, const char *source); + callui_view_callend_h _callui_view_callend_new() { callui_view_callend_h callend_view = calloc(1, sizeof(_callui_view_callend_t)); @@ -108,6 +110,13 @@ static callui_result_e __callui_view_callend_oncreate(call_view_data_base_t *vie return __update_displayed_data(vd); } +static void __bg_mouse_down_cb(void *data, Evas_Object *o, const char *emission, const char *source) +{ + CALLUI_RETURN_IF_FAIL(data); + + _callui_common_exit_app(); +} + static callui_result_e __callui_view_callend_ondestroy(call_view_data_base_t *view_data) { CALLUI_RETURN_VALUE_IF_FAIL(view_data, CALLUI_RESULT_INVALID_PARAM); @@ -118,6 +127,8 @@ static callui_result_e __callui_view_callend_ondestroy(call_view_data_base_t *vi free(vd->time_string); + edje_object_signal_callback_del_full(_EDJ(vd->base_view.contents), "mouse,down,*", "background", __bg_mouse_down_cb, vd); + DELETE_EVAS_OBJECT(vd->create_update_popup); DELETE_EVAS_OBJECT(vd->base_view.contents); @@ -134,6 +145,8 @@ static callui_result_e __create_main_content(callui_view_callend_h vd) CALLUI_RETURN_VALUE_IF_FAIL(vd->base_view.contents, CALLUI_RESULT_ALLOCATION_FAIL); elm_object_part_content_set(ad->main_ly, "elm.swallow.content", vd->base_view.contents); + edje_object_signal_callback_add(_EDJ(vd->base_view.contents), "mouse,down,*", "background", __bg_mouse_down_cb, vd); + return CALLUI_RESULT_OK; } diff --git a/src/callui-view-incoming-call.c b/src/callui-view-incoming-call.c index dc6578b..c86f123 100644 --- a/src/callui-view-incoming-call.c +++ b/src/callui-view-incoming-call.c @@ -80,16 +80,21 @@ static void __reject_msg_list_param_reset(callui_view_incoming_call_h vd); static void __reject_screen_transit_complete_cb(void *data, Elm_Transit *transit); static Eina_Bool __reject_msg_show_sliding_effect(void *data); static Evas_Event_Flags __reject_msg_flick_gesture_move_event_cb(void *data, void *event_info); -static void __reject_msg_create_gesture_layer(callui_view_incoming_call_h vd); static void __reject_msg_bg_mouse_up_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info); static void __reject_msg_bg_mouse_down_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info); static void __reject_msg_bg_mouse_move_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info); static void __reject_msg_list_height_update(callui_view_incoming_call_h vd); -static void __reject_msg_create_genlist(callui_view_incoming_call_h vd); static Eina_Bool __reject_msg_check_tel_num(const char *call_num); -static Evas_Object *__create_reject_msg_layout(callui_view_incoming_call_h vd); + +static void __create_reject_msg_genlist(callui_view_incoming_call_h vd); + +static void __create_reject_msg_layout(callui_view_incoming_call_h vd); +static void __destroy_reject_msg_layout(callui_view_incoming_call_h vd); + +static void __create_reject_msg_gesture_layer(callui_view_incoming_call_h vd); +static void __destroy_reject_msg_gesture_layer(callui_view_incoming_call_h vd); callui_view_incoming_call_h _callui_view_incoming_call_new() { @@ -540,13 +545,20 @@ static Evas_Event_Flags __reject_msg_flick_gesture_move_event_cb(void *data, voi return EVAS_EVENT_FLAG_NONE; } -static void __reject_msg_create_gesture_layer(callui_view_incoming_call_h vd) +static void __destroy_reject_msg_gesture_layer(callui_view_incoming_call_h vd) { - Evas_Object *reject_msg_bg = _callui_edje_object_part_get(vd->reject_msg_layout, "reject_msg_bg"); if (vd->reject_msg_glayer) { - evas_object_del(vd->reject_msg_glayer); - vd->reject_msg_glayer = NULL; + elm_gesture_layer_cb_del(vd->reject_msg_glayer, + ELM_GESTURE_N_FLICKS, ELM_GESTURE_STATE_MOVE, + __reject_msg_flick_gesture_move_event_cb, vd); + + DELETE_EVAS_OBJECT(vd->reject_msg_glayer); } +} + +static void __create_reject_msg_gesture_layer(callui_view_incoming_call_h vd) +{ + Evas_Object *reject_msg_bg = _callui_edje_object_part_get(vd->reject_msg_layout, "reject_msg_bg"); vd->reject_msg_glayer = elm_gesture_layer_add(vd->reject_msg_layout); if (!elm_gesture_layer_attach(vd->reject_msg_glayer, reject_msg_bg)) { @@ -554,7 +566,9 @@ static void __reject_msg_create_gesture_layer(callui_view_incoming_call_h vd) evas_object_del(vd->reject_msg_glayer); vd->reject_msg_glayer = NULL; } else { - elm_gesture_layer_cb_set(vd->reject_msg_glayer, ELM_GESTURE_N_FLICKS, ELM_GESTURE_STATE_MOVE, __reject_msg_flick_gesture_move_event_cb, vd); + elm_gesture_layer_cb_set(vd->reject_msg_glayer, + ELM_GESTURE_N_FLICKS, ELM_GESTURE_STATE_MOVE, + __reject_msg_flick_gesture_move_event_cb, vd); } } @@ -638,7 +652,7 @@ static void __reject_msg_list_height_update(callui_view_incoming_call_h vd) } } -static void __reject_msg_create_genlist(callui_view_incoming_call_h vd) +static void __create_reject_msg_genlist(callui_view_incoming_call_h vd) { int msg_cnt = 0; callui_app_data_t *ad = vd->base_view.ad; @@ -700,9 +714,9 @@ static callui_result_e __update_displayed_data(callui_view_incoming_call_h vd) } if (!__reject_msg_check_tel_num(call_number)) { - DELETE_EVAS_OBJECT(vd->reject_msg_layout); + __destroy_reject_msg_layout(vd); } else { - __reject_msg_create_genlist(vd); + __create_reject_msg_genlist(vd); } evas_object_show(vd->base_view.contents); @@ -725,7 +739,13 @@ static Eina_Bool __reject_msg_check_tel_num(const char *call_num) return EINA_TRUE; } -static Evas_Object *__create_reject_msg_layout(callui_view_incoming_call_h vd) +static void __destroy_reject_msg_layout(callui_view_incoming_call_h vd) +{ + __destroy_reject_msg_gesture_layer(vd); + DELETE_EVAS_OBJECT(vd->reject_msg_layout); +} + +static void __create_reject_msg_layout(callui_view_incoming_call_h vd) { callui_app_data_t *ad = vd->base_view.ad; @@ -733,7 +753,7 @@ static Evas_Object *__create_reject_msg_layout(callui_view_incoming_call_h vd) evas_object_resize(vd->reject_msg_layout, ad->root_w, ad->root_h); - __reject_msg_create_gesture_layer(vd); + __create_reject_msg_gesture_layer(vd); Evas_Object *reject_msg_bg = _callui_edje_object_part_get(vd->reject_msg_layout, "reject_msg_bg"); evas_object_event_callback_add(reject_msg_bg, EVAS_CALLBACK_MOUSE_DOWN, __reject_msg_bg_mouse_down_cb, vd); @@ -749,8 +769,6 @@ static Evas_Object *__create_reject_msg_layout(callui_view_incoming_call_h vd) __reject_msg_list_param_reset(vd); evas_object_show(vd->reject_msg_layout); - - return vd->reject_msg_layout; } static callui_result_e __create_main_content(callui_view_incoming_call_h vd) @@ -777,7 +795,7 @@ static callui_result_e __create_main_content(callui_view_incoming_call_h vd) evas_object_resize(vd->dimming_ly, ad->root_w, ad->root_h); evas_object_move(vd->dimming_ly, 0, 0); - CALLUI_RETURN_VALUE_IF_FAIL(__create_reject_msg_layout(vd), CALLUI_RESULT_FAIL); + __create_reject_msg_layout(vd); return res; } -- 2.7.4