Text scroll animations continue to play even if TextLabel called SetProperty.
Text scroll animations don't be played if TextLabel called SetProperty after setting stop.
Change-Id: I9ecae3c4aea50cf1032d4ee0135b9d7d41701d04
case DevelTextLabel::AutoScrollStopMode::IMMEDIATE:
{
mScrollAnimation.Stop();
case DevelTextLabel::AutoScrollStopMode::IMMEDIATE:
{
mScrollAnimation.Stop();
+ CleanUp();
+ mScrollerInterface.ScrollingFinished();
break;
}
case DevelTextLabel::AutoScrollStopMode::FINISH_LOOP:
break;
}
case DevelTextLabel::AutoScrollStopMode::FINISH_LOOP:
- DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Undifined AutoScrollStopMode\n" );
+ DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Undifined AutoScrollStopMode\n" );
CleanUp(); // If already scrolling then restart with new parameters
CleanUp(); // If already scrolling then restart with new parameters
+ float animationProgress = 0.0f;
+ int remainedLoop = mLoopCount;
if ( mScrollAnimation )
{
if ( mScrollAnimation )
{
+ if( mScrollAnimation.GetState() == Animation::PLAYING )
+ {
+ animationProgress = mScrollAnimation.GetCurrentProgress();
+
+ if( mLoopCount > 0 ) // If not a ininity loop, then calculate remained loop
+ {
+ remainedLoop = mLoopCount - ( mScrollAnimation.GetCurrentLoop() );
+ remainedLoop = ( remainedLoop <= 0 ? 1 : remainedLoop );
+ }
+ }
mScrollAnimation.Clear();
}
mScrollAnimation.Clear();
}
scrollAmount = -scrollAmount; // reverse direction of scrollung
}
scrollAmount = -scrollAmount; // reverse direction of scrollung
}
- StartScrolling( scrollAmount, scrollDuration, mLoopCount );
+ StartScrolling( scrollAmount, scrollDuration, remainedLoop );
+ mScrollAnimation.SetCurrentProgress(animationProgress);
}
void TextScroller::AutoScrollAnimationFinished( Dali::Animation& animation )
}
void TextScroller::AutoScrollAnimationFinished( Dali::Animation& animation )