Revert "widget scroll issue" 32/108132/1
authorYOUNG HUN JO <hoon.cho@samsung.com>
Tue, 3 Jan 2017 06:24:14 +0000 (22:24 -0800)
committerYOUNG HUN JO <hoon.cho@samsung.com>
Tue, 3 Jan 2017 06:24:14 +0000 (22:24 -0800)
This reverts commit 94bc78d203113bd062664a23f9228fa14a03f42c.

Change-Id: Ib4d4d0f7742437d49edba2a12fed5924c701aca1

src/cluster_view.c

index fc40c19..0d8da7f 100755 (executable)
@@ -100,13 +100,6 @@ static mouse_info_t cluster_mouse_info = {
        .pressed_obj = NULL,
 };
 
-//#define SCROLL_TIMING_ISSUE
-#ifdef SCROLL_TIMING_ISSUE
-#define SCROLL_TIMING_INTERVAL 0.001
-
-Ecore_Timer *__scroll_timing_timer = NULL;
-#endif
-
 static Eina_Hash *cluster_menu_table = NULL;
 
 Evas_Object *__cluster_view_create_base_gui(Evas_Object *win);
@@ -161,7 +154,7 @@ static void __cluster_view_scroll_drag_stop_cb(void *data, Evas_Object *obj, voi
 static void __cluster_view_scroll_anim_start_cb(void *data, Evas_Object *obj, void *event_info);
 static void __cluster_view_scroll_anim_stop_cb(void *data, Evas_Object *obj, void *event_info);
 static void __cluster_view_scroll_start(void);
-static Eina_Bool __cluster_view_scroll_stop(void *data);
+static Eina_Bool __cluster_view_scorll_stop(void *data);
 static void __cluster_view_allpage_get_page_pos(int page_idx, int *w, int *h);
 static int __cluster_view_allpage_get_page_index(int x, int y);
 static void __cluster_view_allpage_reposition(void);
@@ -737,42 +730,15 @@ static void __cluster_view_scroll_to_home(void)
        __cluster_view_scroll_to_page(CLUSTER_HOME_PAGE, true);
 }
 
-#ifdef SCROLL_TIMING_ISSUE
-static Eina_Bool __cluster_view_scroll_show_page(void *data)
-{
-       int page_idx = *((int*)data);
-       page_indicator_set_current_page(cluster_view_s.indicator, page_idx);
-       LOGD("show %d page", page_idx);
-       elm_scroller_page_show(cluster_view_s.scroller, page_idx, 0);
-       __cluster_view_scroll_stop(NULL);
-
-       return ECORE_CALLBACK_CANCEL;
-}
-#endif
-
 static void __cluster_view_scroll_to_page(int page_idx, bool animation)
 {
-       __cluster_view_scroll_start();
-
        if (animation) {
                LOGD("bring in %d page", page_idx);
                elm_scroller_page_bring_in(cluster_view_s.scroller, page_idx, 0);
        } else {
-#ifdef SCROLL_TIMING_ISSUE
-               static int __page_idx = 0;
-               __page_idx = page_idx;
-
-               if (__scroll_timing_timer) {
-                       ecore_timer_del(__scroll_timing_timer);
-                       __scroll_timing_timer = NULL;
-               }
-               __scroll_timing_timer = ecore_timer_add(SCROLL_TIMING_INTERVAL, __cluster_view_scroll_show_page, &__page_idx);
-#else
                page_indicator_set_current_page(cluster_view_s.indicator, page_idx);
                LOGD("show %d page", page_idx);
                elm_scroller_page_show(cluster_view_s.scroller, page_idx, 0);
-               __cluster_view_scroll_stop(NULL);
-#endif
        }
 }
 
@@ -1697,7 +1663,7 @@ static void __cluster_view_scroll_drag_stop_cb(void *data, Evas_Object *obj, voi
                cluster_view_s.scroll_stop_timer = NULL;
        }
 
-       cluster_view_s.scroll_stop_timer = ecore_timer_add(SCROLL_STOP_TIME, __cluster_view_scroll_stop, NULL);
+       cluster_view_s.scroll_stop_timer = ecore_timer_add(SCROLL_STOP_TIME, __cluster_view_scorll_stop, NULL);
 }
 
 static void __cluster_view_scroll_anim_start_cb(void *data, Evas_Object *obj, void *event_info)
@@ -1710,7 +1676,7 @@ static void __cluster_view_scroll_anim_start_cb(void *data, Evas_Object *obj, vo
 
 static void __cluster_view_scroll_anim_stop_cb(void *data, Evas_Object *obj, void *event_info)
 {
-       __cluster_view_scroll_stop(NULL);
+       __cluster_view_scorll_stop(NULL);
 }
 
 static void __cluster_view_scroll_start(void)
@@ -1728,7 +1694,7 @@ static void __cluster_view_scroll_start(void)
        }
 }
 
-static Eina_Bool __cluster_view_scroll_stop(void *data)
+static Eina_Bool __cluster_view_scorll_stop(void *data)
 {
        if (!cluster_view_s.is_srolling) {
                LOGE("scroll is already stopped");
@@ -1754,19 +1720,13 @@ static Eina_Bool __cluster_view_scroll_timer_cb(void *data)
        cluster_page_t *current_page = (cluster_page_t *)eina_list_nth(cluster_view_s.page_list, cluster_view_s.current_page);
 
        int next_page_idx = 0;
-       if (MIRRORING_X(cluster_mouse_info.move_x, CLUSTER_VIEW_W) > CLUSTER_EDIT_RIGHT_SCROLL_REGION) {
+       if (cluster_mouse_info.move_x > CLUSTER_EDIT_RIGHT_SCROLL_REGION) {
                next_page_idx = current_page->page_index + 1;
-       } else if (MIRRORING_X(cluster_mouse_info.move_x, CLUSTER_VIEW_W) < CLUSTER_EDIT_LEFT_SCROLL_REGION) {
+       } else if (cluster_mouse_info.move_x < CLUSTER_EDIT_LEFT_SCROLL_REGION) {
                next_page_idx = current_page->page_index - 1;
        } else {
-               cluster_view_s.edit_mode_scroll_timer = NULL;
                return ECORE_CALLBACK_CANCEL;
        }
-
-       if (next_page_idx < 0 || next_page_idx >= cluster_view_s.page_count) {
-               return ECORE_CALLBACK_RENEW;
-       }
-
        cluster_page_drag_cancel(current_page);
        __cluster_view_scroll_to_page(next_page_idx, true);
        return ECORE_CALLBACK_RENEW;