TizenRefApp-7622 [Call UI] Implement highlighting element in Conference call view 51/97251/3
authorIgor Olshevskyi <i.olshevskyi@samsung.com>
Fri, 11 Nov 2016 12:38:56 +0000 (14:38 +0200)
committerIgor Olshevskyi <i.olshevskyi@samsung.com>
Mon, 14 Nov 2016 14:20:32 +0000 (06:20 -0800)
Change-Id: I1f29919035e5fb11b9d25cd51d5c5b2de81856f7

edje_src/edc/callui-view-caller-info.edc
edje_src/edc/callui-view-main-layout.edc
src/callui-view-multi-call-conf.c

index 3b4825e..ddbc1ad 100644 (file)
@@ -76,6 +76,8 @@
 #define CI_EC_PHONE_NUMB_SIZE_MIN                              0 46
 #define CI_EC_PHONE_NUMB_PAD_TOP                               (CI_EC_CONT_NAME_PAD_TOP + CI_EC_CONT_NAME_SIZE_MIN + CI_EC_CONT_NAME_PAD_BOTTOM)
 
+#define CI_CONF_CALLER_INFO_ACCESS_PAD_BOTTOM  45
+
 styles {
        style { name: "ci_contact_info_first_line";
                base: "font=Tizen:style=Light font_size=64 color=#fafafaff align=center valign=center ellipsis=1.0";
@@ -94,7 +96,7 @@ styles {
        }
 }
 
-group{ name: "elm/layout/callui/manage_calls";
+group{ name: "elm/button/base/callui/manage_calls";
        images {
                image: "call_multi_ic_arrow.png" COMP;
        }
@@ -126,6 +128,14 @@ group{ name: "elm/layout/callui/manage_calls";
                                map.rotation.y: 180.0;
                        }
                )
+               CU_PART_RECT( "over",
+                       mouse_events: 1;
+                       description { state: "default" 0.0;
+                               color: COLOR_BG_ALPHA;
+                               rel1 { relative: 0.0 0.0; to: "bg"; }
+                               rel2 { relative: 1.0 1.0; to: "bg"; }
+                       }
+               )
        }
        programs {
                program { name: "ltr";
@@ -152,6 +162,19 @@ group{ name: "elm/layout/callui/manage_calls";
                        action: STATE_SET "rtl" 0 0;
                        target: "btn";
                }
+               program { name: "mouse_clicked";
+                       signal: "mouse,clicked,1";
+                       source: "over";
+                       after: "touch_sound";
+                       after: "clicked_signal";
+               }
+               program { name: "touch_sound";
+                       action: RUN_PLUGIN "touch_sound";
+               }
+               program { name: "clicked_signal";
+                       in: 0.001 0.0;
+                       action: SIGNAL_EMIT "elm,action,click" "";
+               }
        }
 }
 
@@ -473,6 +496,32 @@ group{
                                inherit: "default" 0.0;
                        }
                )
+               CU_PART_SPACER("caller_info_conf.access.padding.bottom",
+                       description { state: "default" 0.0;
+                               min: 0 CI_CONF_CALLER_INFO_ACCESS_PAD_BOTTOM;
+                               fixed: 0 1;
+                               rel1.relative: 0.0 1.0;
+                               align: 0.0 1.0;
+                       }
+               )
+               CU_PART_RECT( "caller_info_conf.access",
+                       mouse_events: 1;
+                       repeat_events: 1;
+                       description { state: "default" 0.0;
+                               fixed: 1 1;
+                               rel1 { relative: 1.0 0.0;       to_x: "extend.padding.left";    to_y: "contact_name"; }
+                               rel2 { relative: 0.0 0.0;       to_x: "extend.padding.right";   to_y: "caller_info_conf.access.padding.bottom"; }
+                               color: COLOR_BG_ALPHA;
+                       }
+                       description { state: "show" 0.0;
+                               inherit: "default" 0.0;
+                               visible: 1;
+                       }
+                       description { state: "hide" 0.0;
+                               inherit: "default" 0.0;
+                               visible: 0;
+                       }
+               )
        }
        programs {
                script {
@@ -720,5 +769,20 @@ group{
                        source: "ec_add_contact.click_area";
                        action: SIGNAL_EMIT "add_contact.clicked" "caller_info";
                }
+
+               // ACCESSIBILITY
+
+               program { name: "show_conf_call_access_part";
+                       signal: "show_conf_call_access_part";
+                       source: "caller_info";
+                       action: STATE_SET "show" 0.0;
+                       target: "caller_info_conf.access";
+               }
+               program { name: "hide_conf_call_access_part";
+                       signal: "hide_conf_call_access_part";
+                       source: "caller_info";
+                       action: STATE_SET "hide" 0.0;
+                       target: "caller_info_conf.access";
+               }
        }
 }
index 25cdc8d..26ba51f 100644 (file)
@@ -14,6 +14,9 @@
  * limitations under the License.
  */
 
+#define MAIN_VIEW_LAYOUT_CALLER_INFO_ACCESS_PAD_BOTTOM 20
+#define MAIN_VIEW_LAYOUT_CALLER_INFO_ACCESS_PAD_TOP            5
+
 group { name: "elm/layout/callui/app_main";
        parts {
                CU_PART_SPACER( "bg",
@@ -64,7 +67,8 @@ group { name: "elm/layout/callui/view_main";
                CU_PART_PADDING_LEFT(MAIN_VIEW_LAYOUT_PAD_LEFT)
                CU_PART_PADDING_RIGHT(MAIN_VIEW_LAYOUT_PAD_RIGHT)
                CU_PART_PADDING_TOP_NAME("title_txt.padding.top", CALL_STATUS_TXT_PAD_TOP)
-               CU_PART_PADDING_TOP_NAME("caller_info.access.padding.top", (CALL_STATUS_TXT_PAD_TOP+CALL_STATUS_TXT_HEIGHT+5))
+               CU_PART_PADDING_TOP_NAME("caller_info.access.padding.top", (CALL_STATUS_TXT_PAD_TOP+CALL_STATUS_TXT_HEIGHT+MAIN_VIEW_LAYOUT_CALLER_INFO_ACCESS_PAD_TOP))
+               CU_PART_PADDING_BOTTOM_NAME("caller_info.access.padding.bottom", (MAIN_VIEW_LAYOUT_CALLER_INF_PAD_BOTTOM+MAIN_VIEW_LAYOUT_CALLER_INFO_ACCESS_PAD_BOTTOM))
                CU_PART_PADDING_BOTTOM_NAME( "caller_info.padding.bottom", MAIN_VIEW_LAYOUT_CALLER_INF_PAD_BOTTOM)
                CU_PART_TEXTBLOCK( "call_txt_status",
                        description { state: "default" 0.0;
@@ -199,7 +203,7 @@ group { name: "elm/layout/callui/view_main";
                        description { state: "default" 0.0;
                                fixed: 1 1;
                                rel1 { relative: 1.0 1.0;       to_x: "padding.left";   to_y: "caller_info.access.padding.top"; }
-                               rel2 { relative: 0.0 0.0;       to_x: "padding.right";  to_y: "caller_info.padding.bottom"; }
+                               rel2 { relative: 0.0 0.0;       to_x: "padding.right";  to_y: "caller_info.access.padding.bottom"; }
                                color: COLOR_BG_ALPHA;
                        }
                        description { state: "show" 0.0;
index 62777d8..dbac05c 100755 (executable)
 #include "callui-view-layout.h"
 #include "callui-keypad.h"
 #include "callui-state-provider.h"
+#include "callui-accessibility-utils.h"
 
-#define CALLUI_LY_STYLE_MANAGE_CALLS   "manage_calls"
+#define CALLUI_BTN_STYLE_MANAGE_CALLS  "callui/manage_calls"
 
 struct _callui_view_mc_conf {
        call_view_data_base_t base_view;
 
        Evas_Object *caller_info;
+       Evas_Object *manage_calls_btn;
        callui_keypad_h keypad;
-
-} callui_view_mc_list;
+};
 
 typedef struct _callui_view_mc_conf _callui_view_mc_conf_t;
 
@@ -45,12 +46,17 @@ static callui_result_e __callui_view_multi_call_conf_ondestroy(call_view_data_ba
 static callui_result_e __create_main_content(callui_view_mc_conf_h vd, Evas_Object *parent);
 static callui_result_e __update_displayed_data(callui_view_mc_conf_h vd);
 
-static void __manage_calls_btn_clicked_cb(void *data, Evas_Object *o, const char *emission, const char *source);
+static void __manage_calls_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info);
 static void __end_call_btn_click_cb(void *data, Evas_Object *obj, void *event_info);
 static void __more_btn_click_cb(void *data, Evas_Object *obj, void *event_info);
 static void __keypad_show_state_change_cd(void *data, callui_keypad_state_event_e visibility);
 static Eina_Bool __call_duration_timer_cb(void* data);
 
+static callui_result_e __create_accessible_objects(callui_view_mc_conf_h vd);
+static void __register_accessibility_rout_start_and_end_points(callui_view_mc_conf_h vd);
+static void __register_accessibility_rout_default(callui_view_mc_conf_h vd);
+static void __unregister_accessibility_rout_default(callui_view_mc_conf_h vd);
+
 callui_view_mc_conf_h _callui_view_multi_call_conf_new()
 {
        callui_view_mc_conf_h mc_list_conf = calloc(1, sizeof(_callui_view_mc_conf_t));
@@ -80,13 +86,15 @@ static callui_result_e __create_main_content(callui_view_mc_conf_h vd, Evas_Obje
        CALLUI_RETURN_VALUE_IF_FAIL(vd->caller_info, CALLUI_RESULT_ALLOCATION_FAIL);
        elm_object_part_content_set(vd->base_view.contents, CALLUI_PART_SWL_CALLER_INFO, vd->caller_info);
 
-       /* Manage button Layout */
-       Evas_Object *manage_calls_ly = _callui_create_layout(vd->base_view.contents, CALLUI_LY_STYLE_MANAGE_CALLS);
-       CALLUI_RETURN_VALUE_IF_FAIL(manage_calls_ly, CALLUI_RESULT_ALLOCATION_FAIL);
-       elm_object_part_content_set(vd->caller_info, "manage_calls_btn", manage_calls_ly);
-       edje_object_signal_callback_add(_EDJ(manage_calls_ly), "mouse,clicked,1", "btn", __manage_calls_btn_clicked_cb, vd);
+       /* Manage calls button */
+       vd->manage_calls_btn = elm_button_add(vd->base_view.contents);
+       CALLUI_RETURN_VALUE_IF_FAIL(vd->manage_calls_btn, CALLUI_RESULT_ALLOCATION_FAIL);
+       elm_object_style_set(vd->manage_calls_btn, CALLUI_BTN_STYLE_MANAGE_CALLS);
+       evas_object_smart_callback_add(vd->manage_calls_btn, "clicked", __manage_calls_btn_clicked_cb, vd);
+       elm_object_part_content_set(vd->caller_info, "manage_calls_btn", vd->manage_calls_btn);
+
        if (_callui_common_is_mirrored_mode_on()) {
-               elm_object_signal_emit(manage_calls_ly, "set_rtl_mode", "manage_calls");
+               elm_object_signal_emit(vd->manage_calls_btn, "set_rtl_mode", "manage_calls");
        }
 
        _callui_action_bar_show(ad->action_bar);
@@ -94,9 +102,15 @@ static callui_result_e __create_main_content(callui_view_mc_conf_h vd, Evas_Obje
        _callui_keypad_clear_input(ad->keypad);
        _callui_keypad_add_show_status_change_cb(ad->keypad, __keypad_show_state_change_cd, vd);
 
-       CALLUI_RETURN_VALUE_IF_FAIL(
-                       _callui_create_end_call_button(vd->base_view.contents, __end_call_btn_click_cb, vd),
-                       CALLUI_RESULT_ALLOCATION_FAIL);
+       vd->base_view.ao_last = _callui_create_end_call_button(vd->base_view.contents, __end_call_btn_click_cb, vd);
+       CALLUI_RETURN_VALUE_IF_FAIL(vd->base_view.ao_last, CALLUI_RESULT_ALLOCATION_FAIL);
+
+       if (__create_accessible_objects(vd) == CALLUI_RESULT_OK) {
+               __register_accessibility_rout_start_and_end_points(vd);
+               __register_accessibility_rout_default(vd);
+       } else {
+               err("Register accessible objects failed");
+       }
 
        return CALLUI_RESULT_OK;
 }
@@ -246,7 +260,7 @@ static callui_result_e __callui_view_multi_call_conf_ondestroy(call_view_data_ba
        return CALLUI_RESULT_OK;
 }
 
-static void __manage_calls_btn_clicked_cb(void *data, Evas_Object *o, const char *emission, const char *source)
+static void __manage_calls_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
 {
        callui_view_mc_conf_h vd = (callui_view_mc_conf_h)data;
        callui_app_data_t *ad = vd->base_view.ad;
@@ -280,13 +294,75 @@ static void __keypad_show_state_change_cd(void *data, callui_keypad_state_event_
 
        switch (visibility) {
        case CALLUI_KEYPAD_STATE_EVENT_START_SHOW:
+               __unregister_accessibility_rout_default(vd);
+               _callui_au_register_base_view_accessibility_rout_with_keypad(&vd->base_view);
                elm_object_signal_emit(vd->base_view.contents, "hide_caller_info", "view_main");
+               elm_object_signal_emit(vd->caller_info, "hide_conf_call_access_part", "caller_info");
                break;
        case CALLUI_KEYPAD_STATE_EVENT_HIDDEN:
        case CALLUI_KEYPAD_STATE_EVENT_QUICK_HIDDEN:
+               _callui_au_unregister_base_view_accessibility_rout_with_keypad(&vd->base_view);
+               __register_accessibility_rout_default(vd);
                elm_object_signal_emit(vd->base_view.contents, "show_caller_info", "view_main");
+               elm_object_signal_emit(vd->caller_info, "show_conf_call_access_part", "caller_info");
                break;
        default:
                break;
        }
 }
+
+/* Accessibility */
+
+static void __register_accessibility_rout_start_and_end_points(callui_view_mc_conf_h vd)
+{
+       vd->base_view.ao_first = _callui_au_create_accessible_object(vd->base_view.contents, vd->base_view.contents, "access.rect");
+       _callui_au_set_highlight_ability(vd->base_view.ao_first, false);
+
+       callui_result_e res = _callui_au_append_symmetric_relationship(vd->base_view.ao_first, vd->base_view.ao_call_status);
+       CALLUI_RETURN_IF_FAIL(res == CALLUI_RESULT_OK);
+
+       res = _callui_au_append_relationship_end_point(vd->base_view.ao_last);
+       CALLUI_RETURN_IF_FAIL(res == CALLUI_RESULT_OK);
+}
+
+static callui_result_e __create_accessible_objects(callui_view_mc_conf_h vd)
+{
+       vd->base_view.ao_call_status = _callui_au_create_accessible_object(vd->base_view.contents, vd->base_view.contents, "call_txt_status.access");
+       CALLUI_RETURN_VALUE_IF_FAIL(vd->base_view.ao_call_status, CALLUI_RESULT_FAIL);
+
+       vd->base_view.ao_caller_info = _callui_au_create_accessible_object(vd->caller_info, vd->caller_info, "caller_info_conf.access");
+       CALLUI_RETURN_VALUE_IF_FAIL(vd->base_view.ao_caller_info, CALLUI_RESULT_FAIL);
+
+       return CALLUI_RESULT_OK;
+}
+
+static void __register_accessibility_rout_default(callui_view_mc_conf_h vd)
+{
+       Evas_Object *ab_start_obj;
+       Evas_Object *ab_end_obj;
+
+       callui_result_e res = _callui_action_get_accessible_objects(vd->base_view.ad->action_bar, &ab_start_obj, &ab_end_obj);
+       CALLUI_RETURN_IF_FAIL(res == CALLUI_RESULT_OK);
+
+       res = _callui_au_append_symmetric_relationship(vd->base_view.ao_call_status, vd->base_view.ao_caller_info);
+       CALLUI_RETURN_IF_FAIL(res == CALLUI_RESULT_OK);
+       res = _callui_au_append_symmetric_relationship(vd->base_view.ao_caller_info, vd->manage_calls_btn);
+       CALLUI_RETURN_IF_FAIL(res == CALLUI_RESULT_OK);
+       res = _callui_au_append_symmetric_relationship(vd->manage_calls_btn, ab_start_obj);
+       CALLUI_RETURN_IF_FAIL(res == CALLUI_RESULT_OK);
+       res = _callui_au_append_symmetric_relationship(ab_end_obj, vd->base_view.ao_last);
+       CALLUI_RETURN_IF_FAIL(res == CALLUI_RESULT_OK);
+}
+
+static void __unregister_accessibility_rout_default(callui_view_mc_conf_h vd)
+{
+       Evas_Object *ab_start_obj;
+       Evas_Object *ab_end_obj;
+
+       CALLUI_RETURN_IF_FAIL(_callui_action_get_accessible_objects(vd->base_view.ad->action_bar, &ab_start_obj, &ab_end_obj) == CALLUI_RESULT_OK);
+
+       _callui_au_remove_symmetric_relationship(vd->base_view.ao_call_status, vd->base_view.ao_caller_info);
+       _callui_au_remove_symmetric_relationship(vd->base_view.ao_caller_info, vd->manage_calls_btn);
+       _callui_au_remove_symmetric_relationship(vd->manage_calls_btn, ab_start_obj);
+       _callui_au_remove_symmetric_relationship(ab_end_obj, vd->base_view.ao_last);
+}