DALI_ACTION_REGISTRATION( Toolkit, ItemView, "stopScrolling", ACTION_STOP_SCROLLING )
+DALI_ACTION_REGISTRATION( Toolkit, ItemView, "enableRefresh", ACTION_ENABLE_REFRESH )
+DALI_ACTION_REGISTRATION( Toolkit, ItemView, "disableRefresh", ACTION_DISABLE_REFRESH )
+
DALI_TYPE_REGISTRATION_END()
bool FindById( const ItemContainer& items, ItemId id )
mIsFlicking(false),
mAddingItems(false),
mRefreshEnabled(true),
+ mRefreshNotificationEnabled(true),
mInAnimation(false)
{
}
void ItemView::OnRefreshNotification(PropertyNotification& source)
{
- // Cancel scroll animation to prevent any fighting of setting the scroll position property by scroll bar during fast scroll.
- if(!mRefreshEnabled && mScrollAnimation)
+ if( mRefreshNotificationEnabled )
{
- RemoveAnimation(mScrollAnimation);
- }
+ // Cancel scroll animation to prevent any fighting of setting the scroll position property by scroll bar during fast scroll.
+ if(!mRefreshEnabled && mScrollAnimation)
+ {
+ RemoveAnimation(mScrollAnimation);
+ }
- // Only cache extra items when it is not a fast scroll
- DoRefresh(GetCurrentLayoutPosition(0), mRefreshEnabled || mScrollAnimation);
+ // Only cache extra items when it is not a fast scroll
+ DoRefresh(GetCurrentLayoutPosition(0), mRefreshEnabled || mScrollAnimation);
+ }
}
void ItemView::Refresh()
{
GetImpl( itemView ).DoStopScrolling();
}
+ else if ( 0 == strcmp( actionName.c_str(), ACTION_ENABLE_REFRESH ) )
+ {
+ GetImpl( itemView ).SetRefreshNotificationEnabled( true );
+ }
+ else if ( 0 == strcmp( actionName.c_str(), ACTION_DISABLE_REFRESH ) )
+ {
+ GetImpl( itemView ).SetRefreshNotificationEnabled( false );
+ }
return true;
}
}
}
+void ItemView::SetRefreshNotificationEnabled( bool enabled )
+{
+ mRefreshNotificationEnabled = enabled;
+}
+
} // namespace Internal
} // namespace Toolkit