From 4f571b1d938dd09dc0ede8ddc3039ed52ef191e6 Mon Sep 17 00:00:00 2001 From: Will Howell Date: Thu, 12 Oct 2017 15:38:37 -0400 Subject: [PATCH] fix(snackbar): swap enter and exit animation curves (#6791) - Use animation constants for maintainability --- src/lib/snack-bar/snack-bar-container.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lib/snack-bar/snack-bar-container.ts b/src/lib/snack-bar/snack-bar-container.ts index 64ad981d71e..0e355b3887e 100644 --- a/src/lib/snack-bar/snack-bar-container.ts +++ b/src/lib/snack-bar/snack-bar-container.ts @@ -33,15 +33,16 @@ import { PortalHostDirective, } from '@angular/cdk/portal'; import {first} from '@angular/cdk/rxjs'; +import {AnimationCurves, AnimationDurations} from '@angular/material/core'; import {Observable} from 'rxjs/Observable'; import {Subject} from 'rxjs/Subject'; import {MatSnackBarConfig} from './snack-bar-config'; -// 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 = + `${AnimationDurations.ENTERING} ${AnimationCurves.DECELERATION_CURVE}`; +export const HIDE_ANIMATION = + `${AnimationDurations.EXITING} ${AnimationCurves.ACCELERATION_CURVE}`; /** * Internal component that wraps user-provided snack bar content.