|
3 | 3 | #import "PestoData.h"
|
4 | 4 | #import "PestoRemoteImageService.h"
|
5 | 5 |
|
| 6 | +#import "MaterialShadowElevations.h" |
| 7 | +#import "MaterialShadowLayer.h" |
| 8 | + |
6 | 9 | static CGFloat kPestoCollectionViewControllerAnimationDuration = 0.33f;
|
7 | 10 | static CGFloat kPestoCollectionViewControllerDefaultHeaderHeight = 240.f;
|
8 | 11 | static CGFloat kPestoCollectionViewControllerInset = 5.f;
|
@@ -40,6 +43,12 @@ - (void)setFlexHeaderContainerVC:(MDCFlexibleHeaderContainerViewController *)fle
|
40 | 43 | headerView.maximumHeight = kPestoCollectionViewControllerDefaultHeaderHeight;
|
41 | 44 | headerView.minimumHeight = kPestoCollectionViewControllerSmallHeaderHeight;
|
42 | 45 | [headerView.contentView addSubview:[self pestoHeaderView]];
|
| 46 | + |
| 47 | + // Use a custom shadow under the flexible header. |
| 48 | + MDCShadowLayer *shadowLayer = [MDCShadowLayer layer]; |
| 49 | + shadowLayer.shadowMaskEnabled = NO; |
| 50 | + [shadowLayer setElevation:MDCShadowElevationNone]; |
| 51 | + headerView.shadowLayer = shadowLayer; |
43 | 52 | }
|
44 | 53 |
|
45 | 54 | - (void)viewWillAppear:(BOOL)animated {
|
@@ -158,6 +167,11 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView {
|
158 | 167 | }];
|
159 | 168 | }
|
160 | 169 | _logoView.transform = CGAffineTransformScale(CGAffineTransformIdentity, _logoScale, _logoScale);
|
| 170 | + |
| 171 | + MDCFlexibleHeaderView *headerView = _flexHeaderContainerVC.headerViewController.headerView; |
| 172 | + MDCShadowLayer *shadowLayer = (MDCShadowLayer *)headerView.shadowLayer; |
| 173 | + CGFloat elevation = MDCShadowElevationAppBar * headerView.shadowIntensity; |
| 174 | + [shadowLayer setElevation:elevation]; |
161 | 175 | }
|
162 | 176 |
|
163 | 177 | #pragma mark - Private methods
|
|
0 commit comments