diff options
author | Zoia Pribytkova <niakris90@gmail.com> | 2019-04-22 14:36:10 +0300 |
---|---|---|
committer | Aleksey Belousov <beloal@users.noreply.github.com> | 2019-04-23 14:16:36 +0300 |
commit | 18ac5298224c235ba0f420229818feca8f76ee3e (patch) | |
tree | 6f71f5f9768db7f15efdf6d8f018a06b558b2d62 /iphone | |
parent | c4898c8f9e390d4e8c0f42dc68de219762c9b678 (diff) |
[iOS] Font and shadow fixes for the driving options
Diffstat (limited to 'iphone')
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 @@ <?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <device id="retina4_7" orientation="portrait"> <adaptation id="fullscreen"/> </device> <dependencies> <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> @@ -40,7 +40,8 @@ <rect key="frame" x="0.0" y="68" width="320" height="48"/> <subviews> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Opi-yT-xIZ"> - <rect key="frame" x="54.5" y="7" width="211" height="34"/> + <rect key="frame" x="84.5" y="10.5" width="151" height="27"/> + <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="12"/> <state key="normal" title="DEFINE ROADS TO AVOID"/> <connections> <action selector="onDrivingOptions:" destination="u2u-Vb-2eH" eventType="touchUpInside" id="x2p-AW-91V"/> diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMiPhoneRoutePreview.xib b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMiPhoneRoutePreview.xib index 5277673c05..febfed51d2 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMiPhoneRoutePreview.xib +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMiPhoneRoutePreview.xib @@ -1,11 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <device id="retina4_7" orientation="portrait"> <adaptation id="fullscreen"/> </device> <dependencies> <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> @@ -39,7 +39,8 @@ <rect key="frame" x="0.0" y="48" width="320" height="48"/> <subviews> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ZXA-Og-q2I"> - <rect key="frame" x="54.5" y="7" width="211" height="34"/> + <rect key="frame" x="84.5" y="10.5" width="151" height="27"/> + <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="12"/> <state key="normal" title="DEFINE ROADS TO AVOID"/> <connections> <action selector="onDrivingOptions:" destination="aNH-vh-DPz" eventType="touchUpInside" id="jR1-dk-nNj"/> @@ -58,7 +59,7 @@ <userDefinedRuntimeAttribute type="string" keyPath="backgroundColorName" value="secondary"/> </userDefinedRuntimeAttributes> </view> - <view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="WqK-Yb-PmP" customClass="SolidTouchView"> + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="WqK-Yb-PmP" customClass="SolidTouchView"> <rect key="frame" x="0.0" y="0.0" width="320" height="48"/> <subviews> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="wpf-tw-Coz" userLabel="Back"> @@ -196,7 +197,7 @@ <outlet property="taxi" destination="15Q-ZN-NzE" id="RaD-7N-ZE2"/> <outlet property="vehicle" destination="cZF-Ha-2tB" id="QP3-tU-nfO"/> </connections> - <point key="canvasLocation" x="448" y="364.7676161919041"/> + <point key="canvasLocation" x="448" y="364.31784107946032"/> </view> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hIE-BJ-nFm" customClass="MWMBaseRoutePreviewStatus"> <rect key="frame" x="0.0" y="0.0" width="320" height="152"/> |