static void _anim_stop_cb(void *data, Evas_Object *scroller, void *event_info)
{
- _D("Invoked");
+ _D("stop the scroller(%p) animation", scroller);
+
+ /* page_scroller_focus & index_bring_in in _drag_stop_cb & _anim_stop_cb */
+ do {
+ Evas_Coord x, y, w, h;
+ elm_scroller_region_get(scroller, &x, &y, &w, &h);
+
+ if (x % w) return;
- if (menu_screen_is_tts()) {
+ int cur_idx = page_scroller_get_current_page_no(scroller);
+ int idx = 0;
+ if (w) idx = x / w;
+ if (cur_idx == idx) return;
+
+ page_scroller_bring_in(scroller, idx);
page_scroller_focus(scroller);
- }
+ } while (0);
+
}
static void _anim_start_cb(void *data, Evas_Object *scroller, void *event_info)
{
- Evas_Coord x;
- Evas_Coord y;
- Evas_Coord w;
- Evas_Coord h;
- Evas_Object *index;
- Elm_Object_Item *idx_it;
-
- int idx;
- int drag_start;
- int previous_x;
- int threshold;
-
- _D("Invoked");
-
- drag_start = (int) evas_object_data_get(scroller, "drag_start");
- previous_x = (int) evas_object_data_get(scroller, "previous_x");
- index = evas_object_data_get(scroller, "index");
+ _D("start the scroller(%p) animation", scroller);
- ret_if(drag_start == 0);
+ int drag_start = (int) evas_object_data_get(scroller, "drag_start");
+ if (drag_start == 0) return;
evas_object_data_set(scroller, "drag_start", (void *) 0);
+}
- elm_scroller_region_get(scroller, &x, &y, &w, &h);
- threshold = w * PAGE_SCROLL_SENSITIVE;
-
- idx_it = elm_index_selected_item_get(index, 0);
- idx = (int) elm_object_item_data_get(idx_it);
-
- if (abs(previous_x - x) > threshold) {
- if (x > previous_x) idx ++;
- else if ((x < previous_x) && (idx != 0)) idx --;
- }
- ret_if(idx >= _count_pages(scroller) || idx < 0);
- page_scroller_bring_in(scroller, idx);
-}
static void _drag_stop_cb(void *data, Evas_Object *scroller, void *event_info)
{
- Evas_Coord x;
- Evas_Coord w;
- Evas_Coord y;
- Evas_Coord h;
+ Evas_Coord x, y, w, h;
int previous_x;
_D("Invoked");
if (x == previous_x) {
_D("\e[33mHold scroller (previous) %d (current) %d\e[0m", previous_x, x);
}
+
+ /* page_scroller_focus & index_bring_in in _drag_stop_cb & _anim_stop_cb */
+ do {
+ if (x % w) return;
+
+ int cur_idx = page_scroller_get_current_page_no(scroller);
+ int idx = 0;
+ if (w) idx = x / w;
+
+ if (cur_idx == idx) return;
+
+ page_scroller_bring_in(scroller, idx);
+ page_scroller_focus(scroller);
+ } while (0);
}
width = menu_screen_get_root_width();
height = (int) ((double) PROP_PORTRAIT_HEIGHT * ((double) menu_screen_get_root_height()));
elm_scroller_page_size_set(scroller, width, height);
+ elm_scroller_page_scroll_limit_set(scroller, 1, 1);
evas_object_size_hint_weight_set(scroller, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(scroller, EVAS_HINT_FILL, EVAS_HINT_FILL);