_elm_scroll_wanted_coordinates_update(sid, x, y);
}
+//TIZEN_ONLY(20190219): fix page snap behavior.
static void
-_elm_scroll_drag_start(Elm_Scrollable_Smart_Interface_Data *sid)
+_elm_scroll_scroll_start(Elm_Scrollable_Smart_Interface_Data *sid)
{
sid->current_page.x = _elm_scroll_page_x_get(sid, 0, EINA_FALSE);
sid->current_page.y = _elm_scroll_page_y_get(sid, 0, EINA_FALSE);
- if (sid->cb_func.drag_start)
- sid->cb_func.drag_start(sid->obj, NULL);
+ sid->scrolling = EINA_TRUE;
+
+ if (sid->cb_func.scroll_start)
+ sid->cb_func.scroll_start(sid->obj, NULL);
}
static void
-_elm_scroll_drag_stop(Elm_Scrollable_Smart_Interface_Data *sid)
+_elm_scroll_scroll_stop(Elm_Scrollable_Smart_Interface_Data *sid)
{
Evas_Coord x, y;
+ sid->scrolling = EINA_FALSE;
+ x = _elm_scroll_page_x_get(sid, 0, EINA_FALSE);
+ y = _elm_scroll_page_y_get(sid, 0, EINA_FALSE);
+ if ((sid->cb_func.page_change) &&
+ ((x != sid->current_page.x) || (y != sid->current_page.y)))
+ sid->cb_func.page_change(sid->obj, NULL);
+ sid->current_page.x = x;
+ sid->current_page.y = y;
+
+ if (sid->cb_func.scroll_stop)
+ sid->cb_func.scroll_stop(sid->obj, NULL);
+}
+//
- if (!(sid->down.bounce_x_animator) && !(sid->down.bounce_y_animator) &&
- !(sid->scrollto.x.animator) && !(sid->scrollto.y.animator))
- {
- x = _elm_scroll_page_x_get(sid, 0, EINA_FALSE);
- y = _elm_scroll_page_y_get(sid, 0, EINA_FALSE);
- if (sid->cb_func.page_change &&
- ((x != sid->current_page.x) || (y != sid->current_page.y)))
- sid->cb_func.page_change(sid->obj, NULL);
- sid->current_page.x = x;
- sid->current_page.y = y;
- }
+static void
+_elm_scroll_drag_start(Elm_Scrollable_Smart_Interface_Data *sid)
+{
+ if (sid->cb_func.drag_start)
+ sid->cb_func.drag_start(sid->obj, NULL);
+ //TIZEN_ONLY(20190219): fix page snap behavior.
+ if (!sid->scrolling)
+ _elm_scroll_scroll_start(sid);
+ //
+}
+
+static void
+_elm_scroll_drag_stop(Elm_Scrollable_Smart_Interface_Data *sid)
+{
if (sid->cb_func.drag_stop)
sid->cb_func.drag_stop(sid->obj, NULL);
}
static void
_elm_scroll_anim_start(Elm_Scrollable_Smart_Interface_Data *sid)
{
- sid->current_page.x = _elm_scroll_page_x_get(sid, 0, EINA_FALSE);
- sid->current_page.y = _elm_scroll_page_y_get(sid, 0, EINA_FALSE);
-
if (sid->cb_func.animate_start)
sid->cb_func.animate_start(sid->obj, NULL);
+
+ //TIZEN_ONLY(20190219): fix page snap behavior.
+ if (!sid->scrolling)
+ _elm_scroll_scroll_start(sid);
+ //
}
static void
{
Evas_Coord x, y;
- if (sid->cb_func.page_change)
- {
- x = _elm_scroll_page_x_get(sid, 0, EINA_FALSE);
- y = _elm_scroll_page_y_get(sid, 0, EINA_FALSE);
- if ((x != sid->current_page.x) || (y != sid->current_page.y))
- sid->cb_func.page_change(sid->obj, NULL);
- sid->current_page.x = x;
- sid->current_page.y = y;
- }
-
if (sid->cb_func.animate_stop)
sid->cb_func.animate_stop(sid->obj, NULL);
+
+ //TIZEN_ONLY(20190219): fix page snap behavior.
+ if (sid->scrolling)
+ _elm_scroll_scroll_stop(sid);
+ //
}
static void
if (!_paging_is_enabled(sid))
_elm_scroll_bounce_eval(sid);
+
+ //TIZEN_ONLY(20190219): fix page snap behavior.
+ if (sid->scrolling && !sid->down.momentum_animator &&
+ !sid->down.bounce_x_animator && !sid->down.bounce_y_animator &&
+ !sid->scrollto.x.animator && !sid->scrollto.y.animator)
+ _elm_scroll_scroll_stop(sid);
+ //
}
}
sid->cb_func.animate_stop = animate_stop_cb;
}
+//TIZEN_ONLY(20190219): fix page snap behavior.
+EOLIAN static void
+_elm_interface_scrollable_scroll_start_cb_set(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, Elm_Interface_Scrollable_Cb scroll_start_cb)
+{
+ sid->cb_func.scroll_start = scroll_start_cb;
+}
+
+EOLIAN static void
+_elm_interface_scrollable_scroll_stop_cb_set(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, Elm_Interface_Scrollable_Cb scroll_stop_cb)
+{
+ sid->cb_func.scroll_stop = scroll_stop_cb;
+}
+//
+
EOLIAN static void
_elm_interface_scrollable_page_change_cb_set(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid, Elm_Interface_Scrollable_Cb page_change_cb EINA_UNUSED)
{
sid->momentum_animator_disabled = EINA_FALSE;
sid->bounce_animator_disabled = EINA_FALSE;
sid->block = EFL_UI_SCROLL_BLOCK_NONE;
+ //TIZEN_ONLY(20190219): fix page snap behavior.
+ sid->scrolling = EINA_FALSE;
+ //
_elm_scroll_scroll_bar_reset(sid);
(obj, EFL_UI_EVENT_SCROLL_DRAG_STOP, NULL);
}
+//TIZEN_ONLY(20190219): fix page snap behavior.
+static void
+_scroll_start_cb(Evas_Object *obj,
+ void *data EINA_UNUSED)
+{
+ efl_event_callback_legacy_call
+ (obj, EFL_UI_EVENT_SCROLL_START, NULL);
+}
+
+static void
+_scroll_stop_cb(Evas_Object *obj,
+ void *data EINA_UNUSED)
+{
+ efl_event_callback_legacy_call
+ (obj, EFL_UI_EVENT_SCROLL_STOP, NULL);
+}
+//
+
static void
_vbar_drag_cb(Evas_Object *obj,
void *data EINA_UNUSED)
elm_interface_scrollable_scroll_right_cb_set(obj, _scroll_right_cb);
elm_interface_scrollable_scroll_up_cb_set(obj, _scroll_up_cb);
elm_interface_scrollable_scroll_down_cb_set(obj, _scroll_down_cb);
+ //TIZEN_ONLY(20190219): fix page snap behavior.
+ elm_interface_scrollable_scroll_start_cb_set(obj, _scroll_start_cb);
+ elm_interface_scrollable_scroll_stop_cb_set(obj, _scroll_stop_cb);
+ //
elm_interface_scrollable_animate_start_cb_set(obj, _scroll_anim_start_cb);
elm_interface_scrollable_animate_stop_cb_set(obj, _scroll_anim_stop_cb);
elm_interface_scrollable_drag_start_cb_set(obj, _scroll_drag_start_cb);