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

[Issue-26] Customize animations #28

Merged
merged 2 commits into from
May 5, 2023
Merged

[Issue-26] Customize animations #28

merged 2 commits into from
May 5, 2023

Conversation

mpospese
Copy link
Contributor

@mpospese mpospese commented May 4, 2023

Introduction

We should make our bottom sheet animations even more customizable than they already are by leveraging the Animation struct that's already in YCoreUI (and used by Y—Snackbar and Y—SideMenu).

Purpose

Fix #26 Use new Animation structure for present / dismiss animations.

Scope

  • Extend Animation with default values for bottom sheet
  • Modify Appearance to use Animation instead of separate duration and curve properties
  • Modify the present and dismiss animators to use the new properties
  • Update unit tests

Discussion

One thing this allows (which wasn't possible before) is to optionally present bottom sheets using spring animations. We also have the flexibility (should we need it) to have not only different curves but different durations for the present and dismiss animations. The default behavior though is unchanged: animations are 0.3 seconds and .easeIn on present / .easeOut on dismiss.

🎬 Video

(These animations are slowed down by 2x to help them appear better as GIFs)

Regular animation Spring animation
bs_26_regular bs_26_spring

📈 Coverage

Code

100%

image

Documentation

100%

image

@sjapps
Copy link
Collaborator

sjapps commented May 4, 2023

@mpospese Should we update the readme to provide an example of this new functionality?

@sjapps
Copy link
Collaborator

sjapps commented May 4, 2023

@mpospese Also I'm not sure if its just the animated gif but in the spring animation, the background fade seems to be delayed or out of place. It's not smooth as the regular animation. I can put in a jira ticket if we want to keep this improvement in the backlog.

@mpospese
Copy link
Contributor Author

mpospese commented May 4, 2023

@mpospese Should we update the readme to provide an example of this new functionality?

added. I also remove the source code that had been reproduced in the README (as we had discussed).

@mpospese
Copy link
Contributor Author

mpospese commented May 4, 2023

@mpospese Also I'm not sure if its just the animated gif but in the spring animation, the background fade seems to be delayed or out of place. It's not smooth as the regular animation. I can put in a jira ticket if we want to keep this improvement in the backlog.

I think it's just the gif. The dimmer animation is on its own curve and unchanged by this change (identical between the two gif's apart from a slightly longer duration in the second one). We could add a ticket if we wanted to add the ability to customize the dimmer animation.

@mpospese mpospese merged commit 2b0f317 into main May 5, 2023
@mpospese mpospese deleted the issue/26-use-animation branch May 5, 2023 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

Use new Animation structure to define sheet present / dismiss animations
4 participants