Fixed the wrong scroll signal sequence in ItemView 08/24208/1
authorRichard Huang <r.huang@samsung.com>
Mon, 7 Jul 2014 16:33:12 +0000 (17:33 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 8 Jul 2014 17:48:07 +0000 (18:48 +0100)
[problem]     The scroll signal sequence is wrong in ItemView. while scrolling ItemView
              by panning, ScrollCompleted signal is emitted before ScrollStarted signal.
[cause]       The touch down event always causes the ScrollCompleted signal to be emitted
              because it assumes the touch down event is to cancel the ongoing scrolling.
              But actually you need to touch down first in order to start the pan.
[solution]    Only emit the ScrollCompleted signal when there is an ongoing scroll animation.

Change-Id: Ib641698b1b3771cfce53d54cec42423fb228ce17
Signed-off-by: Adeel Kazmi <adeel.kazmi@samsung.com>
base/dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp

index affea11..600a882 100644 (file)
@@ -1111,7 +1111,10 @@ bool ItemView::OnTouchEvent(const TouchEvent& event)
     mScrollOvershoot = 0.0f;
     AnimateScrollOvershoot(0.0f);
 
-    mScrollCompletedSignalV2.Emit(GetCurrentScrollPosition());
+    if(mScrollAnimation)
+    {
+      mScrollCompletedSignalV2.Emit(GetCurrentScrollPosition());
+    }
 
     RemoveAnimation(mScrollAnimation);
   }
@@ -1521,6 +1524,7 @@ void ItemView::OnScrollFinished(Animation& source)
 
 void ItemView::OnLayoutActivationScrollFinished(Animation& source)
 {
+  RemoveAnimation(mScrollAnimation);
   mRefreshEnabled = true;
   DoRefresh(GetCurrentLayoutPosition(0), true);
 }