Hello,
The difference between IsStarted
and IsRunning
is only that IsStarted
is true immediately after calling the Start()
method, while IsRunning
is only true after the animation actually starts. And after IsRunning
becomes True, CurrentPlayTime
will start timing.
For example, if I start the animation, call Pause() after 1 minute, and then wait 10 minutes, will CurrentPlayTime be 0:01:00 or 0:11:00?
The Pause()
method does not stop the CurrentPlayTime
timer, therefore, the value of it will be 0:11:00. You could verify it by referring to the following code:
var text = FindViewById<TextView>(Resource.Id.textView1);
var animator = ObjectAnimator.OfFloat(text, "translationY", 0, 900);
animator.SetDuration(5000);
animator.StartDelay = 2000;
Button Startbutton = FindViewById<Button>(Resource.Id.button1);
Button Pausebutton = FindViewById<Button>(Resource.Id.button2);
Button Resumebutton = FindViewById<Button>(Resource.Id.button3);
Startbutton.Click += (s, e) =>
{
animator.Start();
};
Pausebutton.Click += (s, e) =>
{
animator.Pause();
Console.WriteLine(animator.CurrentPlayTime);
};
Resumebutton.Click += (s, e) =>
{
animator.Resume();
Console.WriteLine(animator.CurrentPlayTime);
};
Best Regards,
Alec Liu.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.