atspi : Do not center align when genlist item is highlighted in wearable profile 58/154658/7
authorJunsuChoi <jsuya.choi@samsung.com>
Wed, 11 Oct 2017 03:21:55 +0000 (12:21 +0900)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Fri, 13 Oct 2017 05:17:52 +0000 (05:17 +0000)
Change-Id: Ia727191474485e89aac55a654db9a0dffc3aec54

src/mobile_lib/elm_genlist.c

index 36c0b9baef502fd5b787d1ea1e56556d9fea12f5..2111e0a6c233266225658621cedb240c729e75f0 100644 (file)
@@ -8736,25 +8736,22 @@ _elm_genlist_item_elm_interface_atspi_component_highlight_grab(Eo *eo_it, Elm_Ge
    eo_do_super(EO_OBJ(it), ELM_GENLIST_ITEM_CLASS, elm_interface_atspi_component_highlight_grab());
    //
 #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);
-        //
+   // 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);
       }
-   else // if item is not realized we should search if we are over or below viewport
-     {
-        Eina_List *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);
-          }
-     }
+   if (realized)
+     eina_list_free(realized);
+   //
 
    if (VIEW(it))
       elm_object_accessibility_highlight_set(EO_OBJ(it), EINA_TRUE);