-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(snackbar): swap enter and exit animation curves #6791
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
fix(snackbar): swap enter and exit animation curves #6791
Conversation
@@ -42,8 +42,8 @@ export type SnackBarState = 'initial' | 'visible' | 'complete' | 'void'; | |||
|
|||
// TODO(jelbourn): we can't use constants from animation.ts here because you can't use | |||
// a text interpolation in anything that is analyzed statically with ngc (for AoT compile). | |||
export const SHOW_ANIMATION = '225ms cubic-bezier(0.4,0.0,1,1)'; | |||
export const HIDE_ANIMATION = '195ms cubic-bezier(0.0,0.0,0.2,1)'; | |||
export const SHOW_ANIMATION = '375ms cubic-bezier(0.4,0.0,0.2,1)'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you noted, we are not using the correct easing curves for our animations. However it appears we just have the curves reversed.
From looking at the spec once again:
Entering the screen should use the deceleration curve - cubic-bezier(0.0, 0.0, 0.2, 1)
Permanently leaving the screen should use the acceleration curve - cubic-bezier(0.4, 0.0, 1, 1)
The durations appear to be correct as they are non-complex transitions. These are also guided by the spec found here.
CurveWhile some of these points are open for interpretation, here's why I think the standard curve is most appropriate:
DurationI tried durations of 275ms and 195ms and neither looked like the spec's animations. If you open this animation in VLC, you can see the snackbar is moving for ~12-14 frames, and the video is 30fps. While I agree that the snackbar motion shouldn't be classified as a complex transition, 375ms seemed to best match what I saw in the spec. Further, point 2 above mentions that relative movement should have longer durations. |
Hey @josephperrott, as you can see in my last comment, I feel pretty strongly about this 😁. Would it be possible to send a message to the UX team specifically about snackbar curves and durations? |
@willshowell sorry for the delay, I actually did as the UX team to get an answer on this one. Ultimately they instructed to use the curves as I outlined in my previous comment:
With regards to curves: Though I will point out that for #4:
Any snackbar that comes back into the screen is actually a newly composed snackbar, even if the content is the same content. With regards to the timings: |
@josephperrott Thanks for reaching out to them! I'll update it based on your original comment. |
efac170
to
3aa1c27
Compare
@josephperrott change made |
3aa1c27
to
18e40f4
Compare
18e40f4
to
d83f72c
Compare
@josephperrott I've updated this to use the animation constants. Can you take another look? |
- Use animation constants for maintainability
d83f72c
to
503677d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Uses the standard curve for both enter and exit animations
Use long animation duration as spec shows