atspi: Enhance find unrealized item of genlist when called highlight_grab 08/177308/2
authorJunsuChoi <jsuya.choi@samsung.com>
Fri, 27 Apr 2018 04:28:12 +0000 (13:28 +0900)
committerjunsu choi <jsuya.choi@samsung.com>
Fri, 27 Apr 2018 04:28:37 +0000 (04:28 +0000)
Change-Id: I77822bfab815f9e27a57acf6b645ec4438f8b27d

src/mobile_lib/elm_genlist.c
src/mobile_lib/elm_widget_genlist.h

index 1d0e6c9b95bf4d22acaf95b4dd835df47186663f..49f3aa2424d4543fb302cf82ef2e75414cb199b5 100644 (file)
@@ -2000,6 +2000,9 @@ _item_realize(Elm_Gen_Item *it,
         evas_object_smart_callback_call(WIDGET(it),
           SIG_WIDGET_ATSPI_HIGHLIGHTED, EO_OBJ(it));
         //
+        //TIZEN_ONLY(20161104) : Accessibility : synchronized highlight of atspi and item align feature for wearable profile
+        edje_object_signal_emit(VIEW(it), SIGNAL_ITEM_HIGHLIGHTED, "elm");
+        //
      }
 }
 
@@ -8778,16 +8781,20 @@ _elm_genlist_item_elm_interface_atspi_component_highlight_grab(Eo *eo_it, Elm_Ge
 {
    ELM_GENLIST_DATA_GET(WIDGET(it), sd);
 
-   //TIZEN_ONLY(20170119): Show the object highlighted by highlight_grab when the object is completely out of the scroll
-   eo_do_super(EO_OBJ(it), ELM_GENLIST_ITEM_CLASS, elm_interface_atspi_component_highlight_grab());
-
-   //TIZEN_ONLY(20170412) Make atspi,(un)highlighted work on widget item
-   // If you call eo_do_super, then you do NOT have to call smart callback.
-   evas_object_smart_callback_call(WIDGET(it), "atspi,highlighted", EO_OBJ(it));
-   //
-
+   if (VIEW(it))
+     {
+        //TIZEN_ONLY(20170119): Show the object highlighted by highlight_grab when the object is completely out of the scroll
+        eo_do_super(EO_OBJ(it), ELM_GENLIST_ITEM_CLASS, elm_interface_atspi_component_highlight_grab());
 
-   if (!VIEW(it))
+        //TIZEN_ONLY(20170412) Make atspi,(un)highlighted work on widget item
+        // If you call eo_do_super, then you do NOT have to call smart callback.
+        evas_object_smart_callback_call(WIDGET(it), "atspi,highlighted", EO_OBJ(it));
+        //
+        //TIZEN_ONLY(20161104) : Accessibility : synchronized highlight of atspi and item align feature for wearable profile
+        edje_object_signal_emit(VIEW(it), SIGNAL_ITEM_HIGHLIGHTED, "elm");
+        //
+     }
+   else
      {
        if (!TIZEN_PROFILE_WEARABLE)
          {
@@ -8795,12 +8802,26 @@ _elm_genlist_item_elm_interface_atspi_component_highlight_grab(Eo *eo_it, Elm_Ge
             elm_genlist_item_bring_in(eo_it, ELM_GENLIST_ITEM_SCROLLTO_IN);
             //
          }
+       else
+         {
+            Eina_List *realized = elm_genlist_realized_items_get(WIDGET(it));
+            if (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);
+                 eina_list_free(realized);
+                 /* FIXME : Adjusted_item is not unnecessary when find unrealized item and highlight
+                            Because In realized function will find unrealized item and highlight focus. */
+                 sd->adjusted_item = NULL;
+              }
+         }
+       sd->atspi_item_to_highlight = it;//it will be highlighted when realized
      }
 
-   //TIZEN_ONLY(20161104) : Accessibility : synchronized highlight of atspi and item align feature for wearable profile
-   edje_object_signal_emit(VIEW(it), SIGNAL_ITEM_HIGHLIGHTED, "elm");
-   //
-
    return EINA_TRUE;
 }
 
@@ -8808,10 +8829,6 @@ EOLIAN static Eina_Bool
 _elm_genlist_item_elm_interface_atspi_component_highlight_clear(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
 {
    ELM_GENLIST_DATA_GET(WIDGET(it), sd);
-   //TIZEN_ONLY(20161104) : Accessibility : synchronized highlight of atspi and item align feature for wearable profile
-   if(sd->currently_highlighted_item == it)
-     sd->currently_highlighted_item = NULL;
-   //
    if (sd->atspi_item_to_highlight == it)
        sd->atspi_item_to_highlight = NULL;
    elm_object_accessibility_highlight_set(EO_OBJ(it), EINA_FALSE);
index b633b1e1ad4869ebdaa9ac7066e82f0d7d7fb453..3724e050cc5af2c785ef51a55cafa56a6b22ce0a 100644 (file)
@@ -210,9 +210,6 @@ struct _Elm_Genlist_Data
    int                                   scroll_delta_y_backup;
    //
    Elm_Gen_Item                         *aligned_item;
-   //TIZEN_ONLY(20161104) : Accessibility : synchronized highlight of atspi and item align feature for wearable profile
-   Elm_Gen_Item                         *currently_highlighted_item;
-   //
 
    Eina_List                            *filter_queue;
    Eina_List                            *filtered_list;