From b3f63f352920f5be220e966924ca5dd5ecffaf9d Mon Sep 17 00:00:00 2001 From: Hyerim Kim Date: Thu, 8 Dec 2016 17:43:20 +0900 Subject: Modify to improve w-home notification - Add elm_atspi_bridge_utils_is_screen_reader_enabled() to check whether tts is enable or not - Fix bug about notification indicator Change-Id: I2011a679c509e9d1aa92fb681504e18e7393dd0a Signed-off-by: Hyerim Kim --- home/src/clock.c | 9 ++- home/src/notification/noti_detail_view.c | 85 ++++++++++++++++++++------- home/src/notification/noti_popup_small_view.c | 44 +++++++------- home/src/scroller.c | 4 +- 4 files changed, 97 insertions(+), 45 deletions(-) diff --git a/home/src/clock.c b/home/src/clock.c index bb5c90f..c067be7 100755 --- a/home/src/clock.c +++ b/home/src/clock.c @@ -487,8 +487,10 @@ static void _watch_face_visibility_changed_cb() if (vconf_get_bool(VCONFKEY_HOMESCREEN_WATCH_FACE_VISIBILITY, &watch_face_visibility) < 0) _E("Failed to get vconfkey[%s]", VCONFKEY_HOMESCREEN_WATCH_FACE_VISIBILITY); - if (watch_face_visibility == 1) - clock_service_read_time(); + if (elm_atspi_bridge_utils_is_screen_reader_enabled()) { + if (watch_face_visibility == 1) + clock_service_read_time(); + } } void clock_service_init(Evas_Object *win) @@ -519,7 +521,8 @@ void clock_service_init(Evas_Object *win) watch_manager_init(win); evas_object_smart_callback_add(win, WATCH_SMART_SIGNAL_ADDED, __watch_added, scroller); evas_object_smart_callback_add(win, WATCH_SMART_SIGNAL_REMOVED, __watch_removed, scroller); - clock_service_read_time(); + if (elm_atspi_bridge_utils_is_screen_reader_enabled()) + clock_service_read_time(); ret = _try_to_launch(pkg_name); if (ret < 0) { diff --git a/home/src/notification/noti_detail_view.c b/home/src/notification/noti_detail_view.c index d58b776..1b3ccc3 100755 --- a/home/src/notification/noti_detail_view.c +++ b/home/src/notification/noti_detail_view.c @@ -116,14 +116,16 @@ void noti_detail_view_set_back_key(Eina_Bool is_open_more_option) { _noti_detail_view_data_s.is_open_more_option = is_open_more_option; - if (is_open_more_option) { - elm_atspi_accessible_can_highlight_set(_noti_detail_view_data_s.box_up_ao, EINA_FALSE); - elm_atspi_accessible_can_highlight_set(_noti_detail_view_data_s.box_bottom_ao, EINA_FALSE); - elm_atspi_accessible_can_highlight_set(_noti_detail_view_data_s.more_option, EINA_TRUE); - } else { - elm_atspi_accessible_can_highlight_set(_noti_detail_view_data_s.box_up_ao, EINA_TRUE); - elm_atspi_accessible_can_highlight_set(_noti_detail_view_data_s.box_bottom_ao, EINA_TRUE); - elm_atspi_accessible_can_highlight_set(_noti_detail_view_data_s.more_option, EINA_FALSE); + if (elm_atspi_bridge_utils_is_screen_reader_enabled()) { + if (is_open_more_option) { + elm_atspi_accessible_can_highlight_set(_noti_detail_view_data_s.box_up_ao, EINA_FALSE); + elm_atspi_accessible_can_highlight_set(_noti_detail_view_data_s.box_bottom_ao, EINA_FALSE); + elm_atspi_accessible_can_highlight_set(_noti_detail_view_data_s.more_option, EINA_TRUE); + } else { + elm_atspi_accessible_can_highlight_set(_noti_detail_view_data_s.box_up_ao, EINA_TRUE); + elm_atspi_accessible_can_highlight_set(_noti_detail_view_data_s.box_bottom_ao, EINA_TRUE); + elm_atspi_accessible_can_highlight_set(_noti_detail_view_data_s.more_option, EINA_FALSE); + } } } @@ -146,6 +148,18 @@ void noti_detail_view_destroy() } _noti_detail_view_data_s.is_open_more_option = EINA_FALSE; + + if (elm_atspi_bridge_utils_is_screen_reader_enabled()) { + if (_noti_detail_view_data_s.box_bottom_ao != NULL) { + elm_access_object_unregister(_noti_detail_view_data_s.box_bottom); + _noti_detail_view_data_s.box_bottom_ao = NULL; + } + + if (_noti_detail_view_data_s.box_up_ao != NULL) { + elm_access_object_unregister(_noti_detail_view_data_s.box_up); + _noti_detail_view_data_s.box_up_ao = NULL; + } + } } static Evas_Object * _noti_create_detail_view_win() @@ -236,7 +250,9 @@ static Evas_Object* _noti_create_detail_view_scroller(Evas_Object *parent) goto OUT; } - evas_object_smart_callback_add(scroller, "scroll", _scroll_cb, NULL); + if (elm_atspi_bridge_utils_is_screen_reader_enabled()) + evas_object_smart_callback_add(scroller, "scroll", _scroll_cb, NULL); + evas_object_size_hint_weight_set(scroller, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO); evas_object_show(scroller); @@ -350,15 +366,40 @@ static void _noti_detail_view_box_pack_end() elm_box_pack_end(_noti_detail_view_data_s.box, _noti_detail_view_data_s.box_bottom); elm_box_recalculate(_noti_detail_view_data_s.box); - Evas_Object *ao = NULL; + _noti_detail_view_data_s.more_option = noti_create_more_option(_noti_detail_view_data_s.box, _noti_detail_view_data_s.circle_scroller); - ao = elm_access_object_register(_noti_detail_view_data_s.box_up, _noti_detail_view_data_s.box); - elm_atspi_accessible_description_set(ao, _noti_detail_view_data_s.up_screen_text); - elm_atspi_accessible_name_set(ao, app_name); - elm_atspi_accessible_reading_info_type_set(ao, (ELM_ACCESSIBLE_READING_INFO_TYPE_NAME | ELM_ACCESSIBLE_READING_INFO_TYPE_DESCRIPTION)); - _noti_detail_view_data_s.box_up_ao = ao; + if (elm_atspi_bridge_utils_is_screen_reader_enabled()) { + Evas_Object *ao = NULL; - _noti_detail_view_data_s.more_option = noti_create_more_option(_noti_detail_view_data_s.box, _noti_detail_view_data_s.circle_scroller); + ao = elm_access_object_register(_noti_detail_view_data_s.box_up, _noti_detail_view_data_s.box); + elm_atspi_accessible_description_set(ao, _noti_detail_view_data_s.up_screen_text); + elm_atspi_accessible_name_set(ao, app_name); + elm_atspi_accessible_reading_info_type_set(ao, (ELM_ACCESSIBLE_READING_INFO_TYPE_NAME | ELM_ACCESSIBLE_READING_INFO_TYPE_DESCRIPTION)); + _noti_detail_view_data_s.box_up_ao = ao; + + int x, y, w, h; + evas_object_geometry_get(_noti_detail_view_data_s.box_bottom, &x, &y, &w, &h); + + if (y < 300) { + if (!_noti_detail_view_data_s.box_bottom_ao) { + const char *actbtn_text = NULL; + + ao = elm_access_object_register(_noti_detail_view_data_s.box_bottom, _noti_detail_view_data_s.box); + actbtn_text = elm_object_part_text_get(_noti_detail_view_data_s.bottom_spacer, "actbtn,text"); + elm_atspi_accessible_name_set(ao, actbtn_text); + elm_atspi_accessible_reading_info_type_set(ao, ELM_ACCESSIBLE_READING_INFO_TYPE_NAME); + + char *appid = evas_object_data_get(_noti_detail_view_data_s.box, DATA_KEY_APP_ID); + elm_access_action_cb_set(ao, ELM_ACCESS_ACTION_ACTIVATE, _noti_detail_view_activate_cb, appid); + _noti_detail_view_data_s.box_bottom_ao = ao; + } + } else { + if (_noti_detail_view_data_s.box_bottom_ao) { + _noti_detail_view_data_s.box_bottom_ao = NULL; + elm_access_object_unregister(_noti_detail_view_data_s.box_bottom); + } + } + } } static bool _noti_detail_view_check_package_info(const char *package_id) @@ -505,7 +546,8 @@ static void _noti_detail_view_set_contents(Eina_Bool is_popup) _noti_detail_view_data_s.item_list = eina_list_append(_noti_detail_view_data_s.item_list, _noti_detail_view_data_s.title_label); - elm_atspi_accessible_can_highlight_set(_noti_detail_view_data_s.title_label, EINA_FALSE); + if (elm_atspi_bridge_utils_is_screen_reader_enabled()) + elm_atspi_accessible_can_highlight_set(_noti_detail_view_data_s.title_label, EINA_FALSE); free(set_text); } @@ -525,7 +567,8 @@ static void _noti_detail_view_set_contents(Eina_Bool is_popup) _noti_detail_view_data_s.item_list = eina_list_append(_noti_detail_view_data_s.item_list, _noti_detail_view_data_s.time_label); - elm_atspi_accessible_can_highlight_set(_noti_detail_view_data_s.time_label, EINA_FALSE); + if (elm_atspi_bridge_utils_is_screen_reader_enabled()) + elm_atspi_accessible_can_highlight_set(_noti_detail_view_data_s.time_label, EINA_FALSE); free(set_text); } @@ -543,7 +586,8 @@ static void _noti_detail_view_set_contents(Eina_Bool is_popup) _noti_detail_view_data_s.item_list = eina_list_append(_noti_detail_view_data_s.item_list, _noti_detail_view_data_s.contents_title_label); - elm_atspi_accessible_can_highlight_set(_noti_detail_view_data_s.contents_title_label, EINA_FALSE); + if (elm_atspi_bridge_utils_is_screen_reader_enabled()) + elm_atspi_accessible_can_highlight_set(_noti_detail_view_data_s.contents_title_label, EINA_FALSE); free(set_text); } @@ -566,7 +610,8 @@ static void _noti_detail_view_set_contents(Eina_Bool is_popup) _noti_detail_view_data_s.item_list = eina_list_append(_noti_detail_view_data_s.item_list, _noti_detail_view_data_s.paragraph_label); - elm_atspi_accessible_can_highlight_set(_noti_detail_view_data_s.paragraph_label, EINA_FALSE); + if (elm_atspi_bridge_utils_is_screen_reader_enabled()) + elm_atspi_accessible_can_highlight_set(_noti_detail_view_data_s.paragraph_label, EINA_FALSE); free(set_text); } diff --git a/home/src/notification/noti_popup_small_view.c b/home/src/notification/noti_popup_small_view.c index d14a76b..507a3e1 100644 --- a/home/src/notification/noti_popup_small_view.c +++ b/home/src/notification/noti_popup_small_view.c @@ -198,12 +198,9 @@ int noti_small_popup_view_create(notification_h notification) char *main_text = NULL; char *icon_path = NULL; char *app_name = NULL, *app_id = NULL; - char *screen_text; Evas_Object *noti_win = NULL; Evas_Object *noti_layout = NULL; - int screen_buffer_size = 0; - if (notification == NULL) { _E("notification is null"); ret = W_HOME_ERROR_FAIL; @@ -255,23 +252,30 @@ int noti_small_popup_view_create(notification_h notification) app_name = _noti_small_popup_view_get_app_name(app_id); - if (main_text) - screen_buffer_size += strlen(main_text); - if (app_name) - screen_buffer_size += strlen(app_name); - - screen_text = (char *)calloc(screen_buffer_size+5, sizeof(char)); - - if (app_name) { - strncat(screen_text, app_name, strlen(app_name)); - strncat(screen_text, ". ", 2); + /* For Accessibility */ + if (elm_atspi_bridge_utils_is_screen_reader_enabled()) { + int screen_buffer_size = 0; + char *screen_text; + + if (main_text) + screen_buffer_size += strlen(main_text); + if (app_name) + screen_buffer_size += strlen(app_name); + + screen_text = (char *)calloc(screen_buffer_size+5, sizeof(char)); + + if (app_name) { + strncat(screen_text, app_name, strlen(app_name)); + strncat(screen_text, ". ", 2); + } + if (main_text) { + strncat(screen_text, main_text, strlen(main_text)); + strncat(screen_text, ". ", 2); + } + + elm_atspi_bridge_utils_say(screen_text, EINA_FALSE, NULL, NULL); + free(screen_text); } - if (main_text) { - strncat(screen_text, main_text, strlen(main_text)); - strncat(screen_text, ". ", 2); - } - - elm_atspi_bridge_utils_say(screen_text, EINA_FALSE, NULL, NULL); /* Show notification window */ evas_object_show(noti_layout); @@ -284,8 +288,6 @@ int noti_small_popup_view_create(notification_h notification) elm_object_signal_callback_add(noti_layout, "image_clicked", "noti_popup_small_view", _noti_small_popup_view_image_clicked_cb, NULL); - free(screen_text); - /* Register callback function for auto removal */ ecore_timer_add(_NOTI_SMALL_POPUP_VIEW_AUTO_REMOVAL_INTERVAL, _noti_small_popup_view_auto_removal_timer_cb, NULL); diff --git a/home/src/scroller.c b/home/src/scroller.c index e0f0124..95ebc63 100755 --- a/home/src/scroller.c +++ b/home/src/scroller.c @@ -532,7 +532,9 @@ static void _anim_stop_cb(void *data, Evas_Object *scroller, void *event_info) ret_if(!page_info); page_info->is_focused_page = EINA_TRUE; - clock_service_set_noti_indicator_icon(); + + if (clock_service_check_noti_indicator_enable()) + clock_service_set_noti_indicator_icon(); } if (page == main_get_info()->clock_focus) { -- cgit v1.2.3 From 7609f6d639c6e7a3c360ac6c5d8a933ea6f06beb Mon Sep 17 00:00:00 2001 From: junkyu han Date: Sun, 11 Dec 2016 20:51:00 +0900 Subject: Add button for click event Change-Id: Ia041b3d0abadbd226c0d64a1716b1d9c4046a36a --- home/include/scroller.h | 2 +- home/src/edit.c | 13 +++---------- home/src/page.c | 9 +++++++++ 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/home/include/scroller.h b/home/include/scroller.h index 5b5ad14..64835d4 100644 --- a/home/include/scroller.h +++ b/home/include/scroller.h @@ -136,5 +136,5 @@ extern void scroller_restore_inner_focus(Evas_Object *scroller); extern void scroller_reorder_with_list(Evas_Object *scroller, Eina_List *list, page_direction_e page_direction); extern void scroller_add_index_hide_timer(Evas_Object *scroller); extern void scroller_remove_index_hide_timer(Evas_Object *scroller); -extern void scroller_update_access_widget_name(Evas_Object *scroller); +extern void scroller_update_access_widget_description(Evas_Object *scroller); #endif /* __W_HOME_SCROLLER_H__ */ diff --git a/home/src/edit.c b/home/src/edit.c index c354e71..8327b6d 100755 --- a/home/src/edit.c +++ b/home/src/edit.c @@ -604,12 +604,6 @@ static void _up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) scroller_enable_focus_on_scroll(page_info->scroller); scroller_enable_index_on_scroll(page_info->scroller); - if (evas_object_data_del(page_info->scroller, PRIVATE_DATA_KEY_EDIT_ITEM_IS_MOVED) - && main_get_info()->is_tts) - { - elm_access_say(_("IDS_TTS_BODY_ITEM_MOVED")); - } - elm_object_signal_emit(page_info->layout, "hide", "checker"); elm_object_signal_emit(page_info->page_inner, "show", "del"); @@ -927,7 +921,6 @@ HAPI void edit_change_focus(Evas_Object *edit_scroller, Evas_Object *page_curren if (!unfocusable) { elm_object_signal_emit(focused_page_info->page_inner, "deselect", "cover"); elm_object_signal_emit(focused_page_info->page_inner, "deselect", "line"); - elm_object_signal_emit(focused_page_info->page_inner, "hide", "del"); } elm_object_signal_emit(focused_page_info->page_inner, "enable", "blocker"); } @@ -940,9 +933,6 @@ OUT: /* Focusable page */ elm_object_signal_emit(page_info->page_inner, "select", "cover"); elm_object_signal_emit(page_info->page_inner, "select", "line"); - if (page_info->removable) { - elm_object_signal_emit(page_info->page_inner, "show", "del"); - } } @@ -1708,6 +1698,9 @@ Evas_Object *edit_create_proxy_page(Evas_Object *edit_scroller, Evas_Object *rea return NULL; } elm_object_signal_emit(proxy_page_info->page_inner, "enable", "blocker"); + if (proxy_page_info->removable) { + elm_object_signal_emit(proxy_page_info->page_inner, "show", "del"); + } /* Edit Access Object */ access_info_t *access_info = NULL; diff --git a/home/src/page.c b/home/src/page.c index 5caf1ed..acaa8af 100755 --- a/home/src/page.c +++ b/home/src/page.c @@ -263,6 +263,15 @@ HAPI Evas_Object *page_create(Evas_Object *scroller evas_object_data_set(page_inner, PRIVATE_DATA_KEY_PAGE_ACCESS_OBJECT, NULL); + focus = elm_button_add(page_inner); + retv_if(!focus, NULL); + + elm_object_theme_set(focus, main_get_info()->theme); + elm_object_style_set(focus, "transparent"); + elm_object_part_content_set(page_inner, "focus", focus); + evas_object_size_hint_weight_set(focus, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_atspi_accessible_can_highlight_set(focus, EINA_FALSE); + page_info->width = width; page_info->height = height; -- cgit v1.2.3