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

Animate the radio widget #2770

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Brady-Simon
Copy link

Overview

This PR uses the new animation API to animate the radio widget. The current animation scales/fades the dot icon as the is_selected state changes.

This also gates the animation behind a new animations feature that Hector specified and adds an optional animations feature to the scrollable example to demonstrate this change. To test this change locally:

  • with animations: cargo run -p scrollable --features animations
  • without animations: cargo run -p scrollable

Preview

Here's what the animation looks like (in light mode since the radio in dark mode isn't as clear):

animated-radio.mov

Side note: Hector mentioned on Discord to avoid animating more complex types like colors/backgrounds, so this PR doesn't add any general Style animation. Only f32/bool animations for now.

@Brady-Simon
Copy link
Author

An alternative animation would be to make the dot scale from a size of zero to its final size. I think I prefer the current animation but I want to at least present both options:

animated-radio-alt.mov

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.

1 participant