File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
components/Snackbar/src/private Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -580,12 +580,18 @@ - (void)slideMessageView:(MDCSnackbarMessageView *)snackbarView
580
580
duration: duration
581
581
timingFunction: timingFunction];
582
582
} else {
583
- NSMutableArray *animations =
584
- [NSMutableArray arrayWithObject: [snackbarView animateSnackbarOpacityFrom: fromContentOpacity
585
- to: toContentOpacity]];
583
+ NSMutableArray *animations = [[NSMutableArray alloc ] init ];
584
+ CABasicAnimation *opacityAnimation = [snackbarView animateSnackbarOpacityFrom: fromContentOpacity
585
+ to: toContentOpacity];
586
+ if (opacityAnimation) {
587
+ [animations addObject: opacityAnimation];
588
+ }
586
589
if (onscreen) {
587
- [animations addObject: [snackbarView animateSnackbarScaleFrom: MDCSnackbarEnterStartingScale
588
- toScale: 1 ]];
590
+ CABasicAnimation *scaleAnimation =
591
+ [snackbarView animateSnackbarScaleFrom: MDCSnackbarEnterStartingScale toScale: 1 ];
592
+ if (scaleAnimation) {
593
+ [animations addObject: scaleAnimation];
594
+ }
589
595
}
590
596
animationsGroup.animations = animations;
591
597
[snackbarView.layer addAnimation: animationsGroup forKey: @" snackbarAnimation" ];
You can’t perform that action at this time.
0 commit comments