-TextScroller::TextScroller( ScrollerInterface& scrollerInterface ) : mScrollerInterface( scrollerInterface ),
- mScrollDeltaIndex( Property::INVALID_INDEX ),
- mScrollSpeed( MINIMUM_SCROLL_SPEED ),
- mLoopCount( 1 ),
- mWrapGap( 0.0f )
+void TextScroller::StopScrolling()
+{
+ if ( mScrollAnimation && mScrollAnimation.GetState() == Animation::PLAYING )
+ {
+ switch( mStopMode )
+ {
+ case DevelTextLabel::AutoScrollStopMode::IMMEDIATE:
+ {
+ mScrollAnimation.Stop();
+ mScrollerInterface.ScrollingFinished();
+ break;
+ }
+ case DevelTextLabel::AutoScrollStopMode::FINISH_LOOP:
+ {
+ mScrollAnimation.SetLoopCount( 1 ); // As animation already playing this allows the current animation to finish instead of trying to stop mid-way
+ break;
+ }
+ default:
+ {
+ DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Undifined AutoScrollStopMode\n" );
+ }
+ }
+ }
+}
+
+DevelTextLabel::AutoScrollStopMode::Type TextScroller::GetStopMode() const
+{
+ return mStopMode;
+}
+
+TextScroller::TextScroller( ScrollerInterface& scrollerInterface )
+: mScrollerInterface( scrollerInterface ),
+ mScrollDeltaIndex( Property::INVALID_INDEX ),
+ mScrollSpeed( MINIMUM_SCROLL_SPEED ),
+ mLoopCount( 1 ),
+ mLoopDelay( 0.0f ),
+ mWrapGap( 0.0f ),
+ mStopMode( DevelTextLabel::AutoScrollStopMode::FINISH_LOOP )