elm: access: genlist: Do not center align when genlist item is highlighted in wearabl...
authorJunsuChoi <jsuya.choi@samsung.com>
Wed, 13 Dec 2017 08:58:01 +0000 (14:28 +0530)
committerJiyoun Park <jy0703.park@samsung.com>
Thu, 21 Dec 2017 13:30:52 +0000 (22:30 +0900)
orig: 65e5539a7aaee40ac132de03da18eebd820bb71e
Change-Id: I9c95392d1160510bfafbd0e9bdcdab8b7babea84
Signed-off-by: Shilpa Singh <shilpa.singh@samsung.com>
src/lib/elementary/elm_genlist.c

index 4ba15f7..db846df 100644 (file)
@@ -9095,26 +9095,22 @@ _elm_genlist_item_efl_access_component_highlight_grab(Eo *eo_it, Elm_Gen_Item *i
    efl_access_component_highlight_grab(efl_super(EO_OBJ(it), ELM_GENLIST_ITEM_CLASS));
    //
 #else
-   // if item is realized check if in viewport
-   if (VIEW(it))
-     {
-        Evas_Coord wy, wh, y, h;
-        evas_object_geometry_get(WIDGET(it), NULL, &wy, NULL, &wh);
-        evas_object_geometry_get(VIEW(it), NULL, &y, NULL, &h);
-        //TIZEN_ONLY(20161104) : Accessibility : synchronized highlight of atspi and item align feature for wearable profile
-        elm_genlist_item_bring_in(eo_it, ELM_GENLIST_ITEM_SCROLLTO_MIDDLE);
-        //
-     }
-   else // if item is not realized we should search if we are over or below viewport
-     {
-        Eina_List *realized;
-        realized = elm_genlist_realized_items_get(WIDGET(it));
-        if (realized)
-          {
-             elm_genlist_item_bring_in(eo_it, ELM_GENLIST_ITEM_SCROLLTO_MIDDLE);
-             eina_list_free(realized);
-          }
-     }
+   // TIZEN_ONLY(20171011) : atspi : Do not center align when genlist item is highlighted in wearable profile
+   //FIXME : First, last item is called centered because it may not have a proxy image.
+   //        This part will be revised in the next version.
+   Eina_List *realized = elm_genlist_realized_items_get(WIDGET(it));
+   if (VIEW(it) || realized)
+     {
+        Elm_Object_Item *first_it = elm_genlist_first_item_get(WIDGET(it));
+        Elm_Object_Item *last_it = elm_genlist_last_item_get(WIDGET(it));
+        if (first_it == eo_it || last_it == eo_it)
+          elm_genlist_item_bring_in(eo_it, ELM_GENLIST_ITEM_SCROLLTO_MIDDLE);
+        else
+          elm_genlist_item_bring_in(eo_it, ELM_GENLIST_ITEM_SCROLLTO_IN);
+      }
+   if (realized)
+     eina_list_free(realized);
+   //
 
    if (VIEW(it))
      elm_object_accessibility_highlight_set(EO_OBJ(it), EINA_TRUE);