@@ -12,13 +12,11 @@ public class SKLottiePlayer
1212 private bool isInForwardPhase = true ;
1313 private int repeatsCompleted = 0 ;
1414
15- private TimeSpan _progress ;
16-
1715 /// <summary>Gets the total duration of the loaded animation.</summary>
1816 public TimeSpan Duration { get ; private set ; } = TimeSpan . Zero ;
1917
2018 /// <summary>Gets the current playback position.</summary>
21- public TimeSpan Progress => _progress ;
19+ public TimeSpan Progress { get ; private set ; }
2220
2321 /// <summary>Gets whether the animation has completed all repeats.</summary>
2422 public bool IsComplete { get ; private set ; } = false ;
@@ -60,8 +58,8 @@ public void SetAnimation(Skottie.Animation? newAnimation)
6058 /// </summary>
6159 public void Seek ( TimeSpan position )
6260 {
63- _progress = position ;
64- UpdateProgress ( _progress ) ;
61+ Progress = position ;
62+ UpdateProgress ( Progress ) ;
6563 AnimationUpdated ? . Invoke ( this , EventArgs . Empty ) ;
6664 }
6765
@@ -184,8 +182,8 @@ private void Reset()
184182 Duration = animation ? . Duration ?? TimeSpan . Zero ;
185183
186184 // Directly set the initial position without triggering completion logic.
187- _progress = AnimationSpeed < 0 ? Duration : TimeSpan . Zero ;
188- animation ? . SeekFrameTime ( _progress . TotalSeconds ) ;
185+ Progress = AnimationSpeed < 0 ? Duration : TimeSpan . Zero ;
186+ animation ? . SeekFrameTime ( Progress . TotalSeconds ) ;
189187 AnimationUpdated ? . Invoke ( this , EventArgs . Empty ) ;
190188 }
191189}
0 commit comments