From 18ac5298224c235ba0f420229818feca8f76ee3e Mon Sep 17 00:00:00 2001 From: Zoia Pribytkova Date: Mon, 22 Apr 2019 14:36:10 +0300 Subject: [PATCH] [iOS] Font and shadow fixes for the driving options --- .../Views/RoutePreview/MWMRoutePreview.mm | 31 +++++++++++++++---- .../RoutePreview/MWMiPadRoutePreview.xib | 7 +++-- .../RoutePreview/MWMiPhoneRoutePreview.xib | 11 ++++--- 3 files changed, 35 insertions(+), 14 deletions(-) diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMRoutePreview.mm b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMRoutePreview.mm index 455acf93bb..541ee4ed69 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMRoutePreview.mm +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMRoutePreview.mm @@ -42,6 +42,31 @@ static CGFloat const kDrivingOptionsHeight = 48; [self setupProgresses]; [self.backButton matchInterfaceOrientation]; self.drivingOptionHeightConstraint.constant = -kDrivingOptionsHeight; + [self applyContentViewShadow]; +} + +- (void)applyContentViewShadow { + self.contentView.layer.shadowOffset = CGSizeZero; + self.contentView.layer.shadowRadius = 2.0; + self.contentView.layer.shadowOpacity = 0.7; + self.contentView.layer.shadowColor = UIColor.blackColor.CGColor; + [self resizeShadow]; +} + +- (void)layoutSubviews { + [super layoutSubviews]; + [self.vehicle setNeedsLayout]; + [self resizeShadow]; +} + +- (void)resizeShadow { + CGFloat shadowSize = 1.0; + CGRect contentFrame = self.contentView.bounds; + CGRect shadowFrame = CGRectMake(contentFrame.origin.x - shadowSize, + contentFrame.size.height, + contentFrame.size.width + (2 * shadowSize), + shadowSize); + self.contentView.layer.shadowPath = [UIBezierPath bezierPathWithRect: shadowFrame].CGPath; } - (void)setupProgresses @@ -158,12 +183,6 @@ static CGFloat const kDrivingOptionsHeight = 48; - (void)setupConstraints {} -- (void)layoutSubviews -{ - [super layoutSubviews]; - [self.vehicle setNeedsLayout]; -} - - (void)setDrivingOptionsState:(MWMDrivingOptionsState)state { _drivingOptionsState = state; [self layoutIfNeeded]; diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMiPadRoutePreview.xib b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMiPadRoutePreview.xib index 84ecdf7808..754a012de8 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMiPadRoutePreview.xib +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMiPadRoutePreview.xib @@ -1,11 +1,11 @@ - + - + @@ -40,7 +40,8 @@