void ItemView::OnRefreshNotification(PropertyNotification& source)
{
- if(mRefreshEnabled || mScrollAnimation)
+ // Cancel scroll animation to prevent any fighting of setting the scroll position property by scroll bar during fast scroll.
+ if(!mRefreshEnabled && mScrollAnimation)
{
- // Only refresh the cache during normal scrolling
- DoRefresh(GetCurrentLayoutPosition(0), true);
+ RemoveAnimation(mScrollAnimation);
}
+
+ // Only cache extra items when it is not a fast scroll
+ DoRefresh(GetCurrentLayoutPosition(0), mRefreshEnabled || mScrollAnimation);
}
void ItemView::Refresh()
Toolkit::Scrollable::Property::SCROLL_POSITION_MIN_Y,
Toolkit::Scrollable::Property::SCROLL_POSITION_MAX_Y,
Toolkit::ItemView::Property::SCROLL_CONTENT_SIZE);
- scrollBar.ScrollPositionIntervalReachedSignal().Connect( this, &ItemView::OnScrollPositionChanged );
}
}
}
}
}
-void ItemView::OnScrollPositionChanged( float position )
-{
- // Cancel scroll animation to prevent any fighting of setting the scroll position property.
- if(!mRefreshEnabled)
- {
- RemoveAnimation(mScrollAnimation);
- }
-
- // Refresh the cache immediately when the scroll position is changed.
- DoRefresh(position, false); // No need to cache extra items.
-}
-
bool ItemView::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
{
Dali::BaseHandle handle( object );