Hello there,

 

I would like to suggest an idea so that genlist/list widget could properly
work when a user touches an item during scrolling or bouncing.

I believe that the user wants to hold scrolling or speed up the scrolling
for the interaction in general.

At this moment, list/genlist widgets do like that way. However, it also does
item choose operation with touch up event.

Thus, it runs item-selection operation even if the user just want to hold
the scrolling without select the item.

Ignoring item-selection operation while scrolling would be more natural
interaction I believe.

There should be three works to do:

 

In evas:

I think we could add a flag like EVAS_EVENT_FLAG_ON_SCROLL enumeration value
in Evas_Event_Flags enum.

It would not make any break I believe.

 

In els_scroller:

As well, there would some work in els_scroller for treating the flags in
_down & _up callbacks.

We should also add "scroll" member in "down" structure of els_scroller so
that _up callback can recognize

if previous down event occurred during scrolling.

 

In elm_list/elm_genlist:

genlist/list _down & _up callbacks should return when the flag is on.

 

I have attached the patches. Would anybody review the patch?

 

Thanks.

-----------------------------------------------------

Seokjae Jeong
Senior Engineer

SAMSUNG ELECTRONICS CO., LTD.

-----------------------------------------------------

 

Index: src/lib/Evas.h
===================================================================
--- src/lib/Evas.h      (revision 54143)
+++ src/lib/Evas.h      (working copy)
@@ -136,7 +136,8 @@
 typedef enum _Evas_Event_Flags
 {
    EVAS_EVENT_FLAG_NONE = 0, /**< No fancy flags set */
-   EVAS_EVENT_FLAG_ON_HOLD = (1 << 0) /**< This event is being delivered but 
should be put "on hold" until the on hold flag is unset. the event should be 
used for informational purposes and maybe some indications visually, but not 
actually perform anything */
+   EVAS_EVENT_FLAG_ON_HOLD = (1 << 0), /**< This event is being delivered but 
should be put "on hold" until the on hold flag is unset. the event should be 
used for informational purposes and maybe some indications visually, but not 
actually perform anything */
+   EVAS_EVENT_FLAG_ON_SCROLL = (1 << 1) /**< This event flag indicates the 
event occurs while scrolling; for exameple, DOWN event occurs during scrolling; 
the event should be used for informational purposes and maybe some indications 
visually, but not actually perform anything */
 } Evas_Event_Flags; /**< Flags for Events */
 
 /**
Index: src/lib/elm_genlist.c
===================================================================
--- src/lib/elm_genlist.c       (revision 54143)
+++ src/lib/elm_genlist.c       (working copy)
@@ -1004,6 +1004,7 @@
    Evas_Coord x, y;
 
    if (ev->button != 1) return;
+   if (ev->event_flags & EVAS_EVENT_FLAG_ON_SCROLL) return;
 
    it->down = 1;
    it->dragging  = 0;
@@ -1036,6 +1037,7 @@
    Eina_Bool dragged = EINA_FALSE;
 
    if (ev->button != 1) return;
+   if (ev->event_flags & EVAS_EVENT_FLAG_ON_SCROLL) return;
    it->down = 0;
    if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) it->wd->on_hold = EINA_TRUE;
    else it->wd->on_hold = EINA_FALSE;
Index: src/lib/elm_list.c
===================================================================
--- src/lib/elm_list.c  (revision 54143)
+++ src/lib/elm_list.c  (working copy)
@@ -730,6 +730,7 @@
    if (!wd) return;
    ELM_LIST_ITEM_CHECK_DELETED_RETURN(it);
    if (ev->button != 1) return;
+   if (ev->event_flags & EVAS_EVENT_FLAG_ON_SCROLL) return;
    if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) wd->on_hold = EINA_TRUE;
    else wd->on_hold = EINA_FALSE;
    wd->wasselected = it->selected;
@@ -756,6 +757,7 @@
    if (!wd) return;
    ELM_LIST_ITEM_CHECK_DELETED_RETURN(it);
    if (ev->button != 1) return;
+   if (ev->event_flags & EVAS_EVENT_FLAG_ON_SCROLL) return;
    if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) wd->on_hold = EINA_TRUE;
    else wd->on_hold = EINA_FALSE;
    wd->longpressed = EINA_FALSE;
Index: src/lib/els_scroller.c
===================================================================
--- src/lib/els_scroller.c      (revision 54143)
+++ src/lib/els_scroller.c      (working copy)
@@ -60,6 +60,7 @@
       unsigned char locked : 1;
       unsigned char bounce_x_hold : 1;
       unsigned char bounce_y_hold : 1;
+      unsigned char scroll : 1;
    } down;
 
    struct {
@@ -1334,6 +1335,8 @@
             (sd->down.momentum_animator) || (sd->scrollto.x.animator) ||
             (sd->scrollto.y.animator))
           {
+             ev->event_flags |= EVAS_EVENT_FLAG_ON_SCROLL;
+             sd->down.scroll = 1;
              _smart_anim_stop(sd->smart_obj);
           }
         if (sd->scrollto.x.animator)
@@ -1523,6 +1526,7 @@
                                       if (!sd->down.momentum_animator)
                                         {
                                            sd->down.momentum_animator = 
ecore_animator_add(_smart_momentum_animator, sd);
+                                           ev->event_flags |= 
EVAS_EVENT_FLAG_ON_SCROLL;
                                            _smart_anim_start(sd->smart_obj);
                                         }
                                       sd->down.anim_start = 
ecore_loop_time_get();
@@ -1550,13 +1554,21 @@
                            (!elm_widget_drag_child_locked_x_get(sd->widget)))
                          {
                             pgx = _smart_page_x_get(sd, ox);
-                            if (pgx != x) _smart_scrollto_x(sd, 
_elm_config->page_scroll_friction, pgx);
+                            if (pgx != x) 
+                              {
+                                 ev->event_flags |= EVAS_EVENT_FLAG_ON_SCROLL;
+                                 _smart_scrollto_x(sd, 
_elm_config->page_scroll_friction, pgx);
+                              }
                          }
                        if ((!sd->widget) || 
                            (!elm_widget_drag_child_locked_y_get(sd->widget)))
                          {
                             pgy = _smart_page_y_get(sd, oy);
-                            if (pgy != y) _smart_scrollto_y(sd, 
_elm_config->page_scroll_friction, pgy);
+                            if (pgy != y) 
+                              {
+                                 ev->event_flags |= EVAS_EVENT_FLAG_ON_SCROLL;
+                                 _smart_scrollto_y(sd, 
_elm_config->page_scroll_friction, pgy);
+                              }
                          }
                     }
               }
@@ -1586,6 +1598,11 @@
                        sd->down.hold_animator = NULL;
                     }
                }
+             if (sd->down.scroll)
+               {
+                  ev->event_flags |= EVAS_EVENT_FLAG_ON_SCROLL;
+                  sd->down.scroll = 0;
+               }
              if (sd->down.hold)
                {
                   ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to