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

Add ProgressRing #558

Merged
merged 6 commits into from
May 3, 2024
Merged

Add ProgressRing #558

merged 6 commits into from
May 3, 2024

Conversation

amwx
Copy link
Owner

@amwx amwx commented Apr 28, 2024

Another little thing I've been experimenting with. This PR adds the modern style ProgressRing control to FA!

Previous attempts have run into issues with performance around this. This version shifts the animation over the Composition thread which should significantly help with that, and keep the progress ring running smoothly even if the UI thread slows for whatever reason. Thus, the actual attempt is done directly with Skia and will require the Skia rendering backend.
WinUI's AnimatedVisualPlayer (Lottie) also runs on the composition thread, so behavior should basically be identical. I wasn't able to make sense of the generated Lottie AnimatedVisualSource for WinUI's progress ring, so this attempt is entirely reverse engineered by watching the animation - it seems close enough to me.

Media1.mp4

@amwx amwx added this to the v2.1 milestone Apr 28, 2024
@robloo
Copy link
Contributor

robloo commented Apr 28, 2024

It was a good idea to use composition here to offload the animation-related changes to another thread! You also have a good eye to figure out that animation by looking just at the graphics! Going to test this out more when it's released for sure.

The only thing I notice is the animated delay going to 100 % determinate progress. I believe in WinUI determinate changes are updated instantly so a delay may be unexpected here -- especially for fast percentage changes.

@amwx
Copy link
Owner Author

amwx commented Apr 28, 2024

The only thing I notice is the animated delay going to 100 % determinate progress. I believe in WinUI determinate changes are updated instantly so a delay may be unexpected here -- especially for fast percentage changes.

No, that is correct (you can see it in the WinUI 3 gallery). I almost left it out because it had to be coded in and I don't really like it, but if I did inevitably someone would want it. It is instantaneous, however, if you decrease the value (100 to 25) - the animation only plays if the value increases.

@robloo
Copy link
Contributor

robloo commented Apr 28, 2024

Ah, OK. When WinUI started switching to the Lottie animations that's about when I stopped following the project closely. So I'm thinking of old functionality then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants