@@ -15,8 +15,6 @@ import {
15
15
ComponentPortal ,
16
16
TemplatePortal ,
17
17
PortalHostDirective ,
18
- AnimationCurves ,
19
- AnimationDurations ,
20
18
} from '../core' ;
21
19
import { MdSnackBarConfig } from './snack-bar-config' ;
22
20
import { MdSnackBarContentAlreadyAttached } from './snack-bar-errors' ;
@@ -27,6 +25,11 @@ import {Subject} from 'rxjs/Subject';
27
25
28
26
export type SnackBarState = 'initial' | 'visible' | 'complete' | 'void' ;
29
27
28
+ // TODO(jelbourn): we can't use constants from animation.ts here because you can't use
29
+ // a text interpolation in anything that is analyzed statically with ngc (for AoT compile).
30
+ export const SHOW_ANIMATION = '225ms cubic-bezier(0.4,0.0,1,1)' ;
31
+ export const HIDE_ANIMATION = '195ms cubic-bezier(0.0,0.0,0.2,1)' ;
32
+
30
33
/**
31
34
* Internal component that wraps user-provided snack bar content.
32
35
*/
@@ -45,10 +48,8 @@ export type SnackBarState = 'initial' | 'visible' | 'complete' | 'void';
45
48
state ( 'initial' , style ( { transform : 'translateY(100%)' } ) ) ,
46
49
state ( 'visible' , style ( { transform : 'translateY(0%)' } ) ) ,
47
50
state ( 'complete' , style ( { transform : 'translateY(100%)' } ) ) ,
48
- transition ( 'visible => complete' ,
49
- animate ( `${ AnimationDurations . EXITING } ${ AnimationCurves . DECELERATION_CURVE } ` ) ) ,
50
- transition ( 'initial => visible, void => visible' ,
51
- animate ( `${ AnimationDurations . ENTERING } ${ AnimationCurves . ACCELERATION_CURVE } ` ) ) ,
51
+ transition ( 'visible => complete' , animate ( HIDE_ANIMATION ) ) ,
52
+ transition ( 'initial => visible, void => visible' , animate ( SHOW_ANIMATION ) ) ,
52
53
] )
53
54
] ,
54
55
} )
0 commit comments