Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Steps to reproduce:
1. Calling AnimationDrawable.SetVisible(false, false) to pause the animation.
2. Calling AnimationDrawable.SetVisible(true, false) to unpause/resume the animation from where it was paused.
Unpause/resume of the animation started on the 0th frame, instead of continuing from where it was paused.
Please provide a reproducible test case.
Created attachment 15196 [details]
Codes that reproduces the bug
I have attached a simple project that demonstrates the issue. Any suggestions for the fix would be greatly appreciated.
Thank you very much!
Sample codes is also available on
Included test codes in the attachment and on GitHub.
Thank you for Attachment #15196 [details]. I "ported" it to Java, and observed the same behavior, so this isn't a binding problem.
Investigating further...would you believe that the documentation is wrong? :-)
> If restart is false, the animation will resume from the most recent frame.
That's not what the *implementation* does:
Specifically line 123-124:
boolean startFromZero = restart || !mRunning ||
mCurFrame >= mAnimationState.getChildCount();
When you call SetVisible(true, false), `restart` is false, but `changed` (see github) will be true, causing us to evaluate line 123. mRunning will be `false` (see unscheduleSelf(), called by setVisible(), so startFromZero is:
boolean startFromZero = false || !false || ...
which means startFromZero will be *true*, which is why we observe that the animation restarts at frame 0.
I'm currently unable to ascertain *how* this is *supposed* to work.
Guess: perhaps SetVisible(true, true) is for one-shot animations:
while SetVisible(true, false) is meaningless when done after a SetVisible(false,*)? I'm not sure, but that certainly *seems* to be the case.