maui
maui copied to clipboard
[Android] Fix gif animation initial state
Description of Change
Fix gif animation initial state.
To validate the changes, launch the .NET MAUI Gallery and navigate to the Image samples or, use the existing related tests previously ignored and now passing.

Issues Fixed
Fixes #7019
Thank you for your pull request. We are auto-formatting your source code to follow our code guidelines.
/rebase
@mattleibow Could I have your feedback here when you have time? Thanks in advance.
I see windows does have this: https://github.com/dotnet/maui/blob/main/src/Core/src/Platform/Windows/ImageSourcePartExtensions.cs#L46
Should we consolidate in either the image setter or the handler? I like the handler because that is more extensible/custmisable? @PureWeen
Hmmm, maybe windows is separate since it reads gif as NOT animated:
Let me try force playing...
Looking at the code, Android does go onto another thread and somehow it still works... We need to await I think to avoid potential threading issues. We can fix Windows separately. Even calling Stop directly does not do anything.
This is why it passes on Windows... They are not even there!
OK, Windows is a totally separate thing with all sorts of issues.
I have fixed this issue on Windows in #20169 and also enavledenabled the tests in https://github.com/dotnet/maui/pull/20167