Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WinUI] Fix gif animation initial state #20169

Merged
merged 1 commit into from
Feb 2, 2024
Merged

Conversation

mattleibow
Copy link
Member

Description of Change

Animated GIF on WinUI are not correctly respecting the IsAnimationPlaying because the actual image is animated, not the view. However, the image has to actually be loaded and on-screen before we can start/stop playing.

This PR waits for the image to be fully loaded and presented before handling the animation.

This PR needs:

Based on the work in:

@mattleibow mattleibow requested a review from a team as a code owner January 26, 2024 02:05
@mattleibow mattleibow changed the title Dev/winui gif init [WinUI] Fix gif animation initial state Jan 26, 2024
@ghost ghost added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Jan 26, 2024
public partial class ImageHandler : ViewHandler<IImage, Image>
public partial class ImageHandler : ViewHandler<IImage, WImage>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image === WImage, just using the type alias as it got confusing.

Comment on lines -45 to -46
if (destinationContext is WImage imageView)
imageView.UpdateIsAnimationPlaying(image);
Copy link
Member Author

@mattleibow mattleibow Jan 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This did nothing as the image is only animatable after it is decoded - which is after it is on-screen.

@mattleibow mattleibow merged commit 3f7409b into main Feb 2, 2024
47 checks passed
@mattleibow mattleibow deleted the dev/winui-gif-init branch February 2, 2024 13:10
@github-actions github-actions bot locked and limited conversation to collaborators Mar 4, 2024
@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants