Screen reader features implementation. 77/121577/1
authorKamil Lipiszko <k.lipiszko@samsung.com>
Thu, 17 Nov 2016 13:37:04 +0000 (14:37 +0100)
committerLukasz Stanislawski <l.stanislaws@samsung.com>
Tue, 28 Mar 2017 09:02:26 +0000 (11:02 +0200)
Change-Id: I2001ff4d3f19f3a883f95167160fd81cced67e97

res/edje/item.edc
res/po/en_US.po
src/item.c
src/main.c

index 9216dae..0f02381 100644 (file)
@@ -74,16 +74,6 @@ collections {
                                        align: 0.5 0.0;
                                }
                        }
-                       part {
-                               name: "focus";
-                               type: SWALLOW;
-                               scale: 1;
-                               description {
-                                       state: "default" 0.0;
-                                       rel1 { relative: 0.0 0.0; to: "bg"; }
-                                       rel2 { relative: 1.0 1.0; to: "bg"; }
-                               }
-                       }
                }
        }
        group {
@@ -134,6 +124,16 @@ collections {
                                        align: 0.0 0.5;
                                }
                        }
+                       part {
+                               name: "focus";
+                               type: SWALLOW;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1.to: "icon";
+                                       rel2.to: "icon";
+                               }
+                       }
                } //parts
        } //group
 
@@ -215,14 +215,12 @@ collections {
                                }
                        }
                        part {
-                               name: "event";
-                               type: RECT;
+                               name: "focus";
+                               type: SWALLOW;
                                description {
                                        state: "default" 0.0;
-                                       color: 0 0 0 0;
                                        rel1.to: "clear_img";
                                        rel2.to: "clear_img";
-                                       visible: 1;
                                }
                        }
                } //parts
@@ -230,7 +228,7 @@ collections {
                        program {
                                name: "event,click";
                                signal: "mouse,clicked,1";
-                               source: "event";
+                               source: "clear_img";
                                action: SIGNAL_EMIT "click" "clear_item";
                        }
                }
index 8191061..c06cf3d 100755 (executable)
@@ -5,3 +5,11 @@ msgstr "No recently used apps"
 msgid "IDS_TASKMGR_BUTTON_CLOSE_ALL_ABB2"
 msgstr "Clear all"
 
+msgid "IDS_TASKMGR_APP_ITEM_DESCRIPTION"
+msgstr "Double tap to open %s. Double tap and hold, then drag left or right to close %s."
+
+msgid "IDS_TASKMGR_CLEAR_ALL_DESCRIPTION"
+msgstr "Double tap to close all apps."
+
+msgid "IDS_TASKMGR_RECENT_APPLICATIONS"
+msgstr "Recent applications."
index a450099..c255bdd 100644 (file)
@@ -74,11 +74,10 @@ void item_clear_all_disabled_set(Evas_Object *scroller)
 
 
 
-static void _clear_all_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source)
+static void _clear_all_clicked_cb(void *data, Evas_Object *obj, void *event_info)
 {
        Evas_Object *scroller = data;
        ret_if(!scroller);
-       _D("");
        scroller_pop_all_item(scroller, 1);
 }
 
@@ -89,6 +88,7 @@ Evas_Object *item_clear_all_create(Evas_Object *scroller)
        retv_if(!scroller, NULL);
 
        Evas_Object *clear_item = NULL;
+       Evas_Object *focus = NULL;
 
        clear_item = elm_layout_add(scroller);
        retv_if(!clear_item, NULL);
@@ -101,13 +101,18 @@ Evas_Object *item_clear_all_create(Evas_Object *scroller)
 
        elm_object_part_text_set(clear_item, "name", _("IDS_TASKMGR_BUTTON_CLOSE_ALL_ABB2"));
 
-       elm_object_signal_callback_add(clear_item, "click", "clear_item", _clear_all_clicked_cb, scroller);
        evas_object_data_set(scroller, PRIVATE_DATA_KEY_CLEAR, clear_item);
 
        evas_object_show(clear_item);
 
-       return clear_item;
+       focus = elm_button_add(clear_item);
+       elm_object_style_set(focus, "focus");
+       elm_object_part_content_set(clear_item, "focus", focus);
+       evas_object_smart_callback_add(focus, "clicked", _clear_all_clicked_cb, scroller);
+       elm_atspi_accessible_name_set(focus, _("IDS_TASKMGR_BUTTON_CLOSE_ALL_ABB2"));
+       elm_atspi_accessible_description_set(focus, _("IDS_TASKMGR_CLEAR_ALL_DESCRIPTION"));
 
+       return clear_item;
 }
 
 
@@ -393,8 +398,8 @@ static void _down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
        }
 
        evas_object_data_set(item_outer, PRIVATE_DATA_KEY_PRESSED, (void *) 1);
-       evas_object_data_set(item_outer, PRIVATE_DATA_KEY_DOWN_X, (void *) x);
-       evas_object_data_set(item_outer, PRIVATE_DATA_KEY_DOWN_Y, (void *) y);
+       evas_object_data_set(item_outer, PRIVATE_DATA_KEY_DOWN_X, (void *) -1);
+       evas_object_data_set(item_outer, PRIVATE_DATA_KEY_DOWN_Y, (void *) -1);
        evas_object_data_set(item_outer, PRIVATE_DATA_KEY_DOWN_TIME, (void *)down_time);
 
        evas_object_geometry_get(item_outer, &rect_x, &rect_y, &rect_w, &rect_h);
@@ -444,6 +449,14 @@ static void _move_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
        down_x = (int) evas_object_data_get(item_outer, PRIVATE_DATA_KEY_DOWN_X);
        down_y = (int) evas_object_data_get(item_outer, PRIVATE_DATA_KEY_DOWN_Y);
 
+       if (down_x < 0 || down_y < 0) {
+               evas_object_data_set(item_outer, PRIVATE_DATA_KEY_DOWN_X, (void *)ei->cur.output.x);
+               evas_object_data_set(item_outer, PRIVATE_DATA_KEY_DOWN_Y, (void *)ei->cur.output.y);
+               down_x = ei->cur.output.x;
+               down_y = ei->cur.output.y;
+       }
+
+
        outer_x = (int)evas_object_data_get(item_outer, PRIVATE_DATA_KEY_ITEM_X);
        outer_y = (int)evas_object_data_get(item_outer, PRIVATE_DATA_KEY_ITEM_Y);
 
@@ -598,6 +611,9 @@ static void _clicked_cb(void *data, Evas_Object *obj, void *event_info)
 
 Evas_Object *item_create(Evas_Object *scroller, list_type_default_s *info)
 {
+       char description[512] = {0, };
+       const char *format = _("IDS_TASKMGR_APP_ITEM_DESCRIPTION");
+
        retv_if(NULL == scroller, NULL);
        retv_if(NULL == info, NULL);
 
@@ -631,8 +647,11 @@ Evas_Object *item_create(Evas_Object *scroller, list_type_default_s *info)
        focus = elm_button_add(scroller);
        goto_if(NULL == focus, ERROR);
        elm_object_style_set(focus, "focus");
-       elm_object_part_content_set(item, "focus", focus);
+       elm_object_part_content_set(item_inner, "focus", focus);
        evas_object_smart_callback_add(focus, "clicked", _clicked_cb, item);
+       elm_atspi_accessible_name_set(focus, info->name);
+       sprintf(description, format, info->name, info->name);
+       elm_atspi_accessible_description_set(focus, description);
 
        evas_object_data_set(item, DATA_KEY_ITEM_INFO, info);
 
index eec214d..e87af72 100644 (file)
@@ -141,6 +141,11 @@ static Eina_Bool _list_timer_cb(void *data)
 
        elm_object_part_text_set(main_info.layout, "no,apps,txt", _("IDS_TASKMGR_NPBODY_NO_RECENTLY_USED_APPS"));
 
+       Evas_Object *label = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(main_info.layout), "no,apps,txt");
+       Evas_Object *atspi_label = elm_access_object_register(label, main_info.layout);
+       elm_atspi_accessible_role_set(atspi_label, ELM_ATSPI_ROLE_LABEL);
+       elm_atspi_accessible_name_set(atspi_label, _("IDS_TASKMGR_NPBODY_NO_RECENTLY_USED_APPS"));
+
        main_info.pkg_list = list_pkg_list_get();
        if (!main_info.pkg_list) {
                _E("pkg_list is empty");
@@ -181,6 +186,7 @@ static bool _create_cb(void *data)
 
        main_info.win = elm_win_add(NULL, "Task-mgr", ELM_WIN_BASIC);
        retv_if(!main_info.win, false);
+       elm_win_title_set(main_info.win, _("IDS_TASKMGR_RECENT_APPLICATIONS"));
 
        elm_win_screen_size_get(main_info.win, NULL, NULL, &main_info.root_w, &main_info.root_h);
        _D("screen size is (%d, %d)", main_info.root_w, main_info.root_h);