Languages

Menu
Sites
Language
Gesture Recognition problem.

In my App I have pushed a Scroller in the Naviframe.
In the Scroller I have added a gesture layer and attached to it. So that a touch gesture can be implemented.

  g = elm_gesture_layer_add(bubble_scroller);
      elm_gesture_layer_attach(g, bubble_scroller);

then I have the following Call Backs

      elm_gesture_layer_cb_set(g, ELM_GESTURE_MOMENTUM, ELM_GESTURE_STATE_START, _momentum_start, bubble_scroller);
   elm_gesture_layer_cb_set(g, ELM_GESTURE_MOMENTUM, ELM_GESTURE_STATE_MOVE, _momentum_move, bubble_scroller);

In the Implemetation of the call backs i have shown the the points recognised by the gesture layer.
by this process i can draw what i want by moving my  finger In the app  screen.
But there is a problem showing the points. When I move my finger from the main window ( where the scroller is as well as the gesture layer attached) to the title bar the gesture layer also recognises the Title bar points. But it should not recognise the Title bar points. As I have only attached the gesture layer in the Scroller the main window of the App. But the layer recognises the whole screen including the Title Bar. 
Please give me some idea so that I can only recognise a specific object points. Not the whole screen points.

 

Responses

4 Replies
Mosharraf Hossain

the _momentum_move call back is as follows
 

static Evas_Event_Flags
_momentum_move(void *data , void *event_info)
{


    Evas_Object *point = NULL;
 Elm_Gesture_Momentum_Info *p = (Elm_Gesture_Momentum_Info *) event_info;
     

 dlog_print(DLOG_ERROR, LOG_TAG, "momentum_move, [%d,%d]", p->x2, p->y2);


 point = evas_object_rectangle_add(evas_object_evas_get((Evas_Object*)data));
 evas_object_pass_events_set(point, EINA_TRUE);
 evas_object_color_set(point, MOVE_COLOR);
 evas_object_resize(point, SMALL_POINT_RECT, SMALL_POINT_RECT);
 evas_object_move(point, p->x2, p->y2);
 evas_object_show(point);

 momentum_list = eina_list_append(momentum_list, point);

   return EVAS_EVENT_FLAG_ON_HOLD;
}

 

colin Rao

Hi,

I've try such testing, create a box with two sub box, and push to naviframe. only register the guesture layer on one sub box, sample code as below:

    box = elm_box_add(view);
    evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
    evas_object_show(box);

    Evas_Object *rect = evas_object_rectangle_add(evas_object_evas_get(box));
    evas_object_size_hint_weight_set(rect,EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set(rect, EVAS_HINT_FILL, EVAS_HINT_FILL);
    evas_object_color_set(rect, 204, 204, 204, 255);
    evas_object_repeat_events_set(rect, EINA_TRUE);
    elm_box_pack_end(box, rect);
    evas_object_show(rect);

    ad->gl = elm_gesture_layer_add(ad->win);
    elm_gesture_layer_attach(ad->gl, rect);
    elm_gesture_layer_cb_set(ad->gl, ELM_GESTURE_MOMENTUM, ELM_GESTURE_STATE_START, _momentum_start, NULL);
    elm_gesture_layer_cb_set(ad->gl, ELM_GESTURE_MOMENTUM, ELM_GESTURE_STATE_MOVE, _momentum_move, NULL);

    elm_box_pack_end(view, box);

Actually result is,

1) tap out of the box, guesture event callback not get called; tap on the box, gesture event callback get called normally;

2) tap out of the box and move finger into the box, gesture event callback not get called; tap on the box and move finger out from the box, gesture event always get called, even though move the finger out the box.

Is it a bug?

colin Rao

Also do below testing, actually result same as above.

elm_gesture_layer_add(ad->win); // chang the ad->win to the sub box, or rect.

 

Mosharraf Hossain

Yes I am also getting the same problem.
tap on the box and move finger out from the box, gesture event always get called, even though move the finger out the box.
Dont know whether it is a Bug or Not.