diff --git a/Sources/MapboxNavigation/DayStyle.swift b/Sources/MapboxNavigation/DayStyle.swift index 7c35b6d8ea..acd4010f77 100644 --- a/Sources/MapboxNavigation/DayStyle.swift +++ b/Sources/MapboxNavigation/DayStyle.swift @@ -258,14 +258,10 @@ open class DayStyle: Style { NextInstructionLabel.appearance(for: phoneTraitCollection, whenContainedInInstancesOf: [NextBannerView.self]).textColorHighlighted = #colorLiteral(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0) NextInstructionLabel.appearance(for: phoneTraitCollection, whenContainedInInstancesOf: [NextBannerView.self]).normalFont = UIFont.systemFont(ofSize: 14.0).adjustedFont - LaneView.appearance(for: phoneTraitCollection).primaryColor = .defaultLaneArrowPrimaryCarPlay - LaneView.appearance(for: phoneTraitCollection).secondaryColor = .defaultLaneArrowSecondaryCarPlay + LaneView.appearance(for: phoneTraitCollection).primaryColor = .defaultLaneArrowPrimary + LaneView.appearance(for: phoneTraitCollection).secondaryColor = .defaultLaneArrowSecondary LaneView.appearance(for: phoneTraitCollection).primaryColorHighlighted = .defaultLaneArrowPrimaryHighlighted LaneView.appearance(for: phoneTraitCollection).secondaryColorHighlighted = .defaultLaneArrowSecondaryHighlighted - LaneView.appearance(for: phoneTraitCollection, whenContainedInInstancesOf: [LanesView.self]).primaryColor = .defaultLaneArrowPrimary - LaneView.appearance(for: phoneTraitCollection, whenContainedInInstancesOf: [LanesView.self]).secondaryColor = .defaultLaneArrowSecondary - LaneView.appearance(for: phoneTraitCollection, whenContainedInInstancesOf: [LanesView.self]).primaryColorHighlighted = .defaultLaneArrowPrimaryHighlighted - LaneView.appearance(for: phoneTraitCollection, whenContainedInInstancesOf: [LanesView.self]).secondaryColorHighlighted = .defaultLaneArrowSecondaryHighlighted LanesView.appearance(for: phoneTraitCollection).backgroundColor = #colorLiteral(red: 0.968627451, green: 0.968627451, blue: 0.968627451, alpha: 1) @@ -355,12 +351,6 @@ open class DayStyle: Style { SpeedLimitView.appearance(for: carPlayTraitCollection).textColor = #colorLiteral(red: 0, green: 0, blue: 0, alpha: 1) SpeedLimitView.appearance(for: carPlayTraitCollection).regulatoryBorderColor = #colorLiteral(red: 0.800, green: 0, blue: 0, alpha: 1) - LaneView.appearance(for: carPlayTraitCollection).primaryColor = .defaultLaneArrowPrimaryCarPlay - LaneView.appearance(for: carPlayTraitCollection).secondaryColor = .defaultLaneArrowSecondaryCarPlay - - LaneView.appearance(for: carPlayTraitCollection).primaryColorHighlighted = .defaultLaneArrowPrimaryHighlighted - LaneView.appearance(for: carPlayTraitCollection).secondaryColorHighlighted = .defaultLaneArrowSecondaryHighlighted - ManeuverView.appearance(for: carPlayTraitCollection).backgroundColor = .clear ManeuverView.appearance(for: carPlayTraitCollection).primaryColorHighlighted = .defaultTurnArrowPrimaryHighlighted ManeuverView.appearance(for: carPlayTraitCollection).secondaryColorHighlighted = .defaultTurnArrowSecondaryHighlighted @@ -369,21 +359,19 @@ open class DayStyle: Style { // `UITraitCollection`, which contains both `UIUserInterfaceIdiom` and `UIUserInterfaceStyle`. // If not, `UITraitCollection` will only contain `UIUserInterfaceIdiom`. if #available(iOS 12.0, *) { - let carPlayTraitCollection = UITraitCollection(userInterfaceIdiom: .carPlay) - let carPlayLightTraitCollection = UITraitCollection(traitsFrom: [ carPlayTraitCollection, UITraitCollection(userInterfaceStyle: .light) ]) - setCarPlayInstructionsStyling(for: carPlayLightTraitCollection) + applyCarPlayStyling(for: carPlayLightTraitCollection) let carPlayDarkTraitCollection = UITraitCollection(traitsFrom: [ carPlayTraitCollection, UITraitCollection(userInterfaceStyle: .dark) ]) - setCarPlayInstructionsStyling(for: carPlayDarkTraitCollection) + applyCarPlayStyling(for: carPlayDarkTraitCollection) } else { - setDefaultCarPlayInstructionsStyling() + applyDefaultCarPlayStyling() } default: break @@ -391,12 +379,7 @@ open class DayStyle: Style { } @available(iOS 12.0, *) - func setCarPlayInstructionsStyling(for traitCollection: UITraitCollection?) { - guard let traitCollection = traitCollection, - traitCollection.userInterfaceIdiom == .carPlay else { return } - - let carPlayTraitCollection = UITraitCollection(userInterfaceIdiom: .carPlay) - + func applyCarPlayStyling(for traitCollection: UITraitCollection) { // On CarPlay, `ExitView` and `GenericRouteShield` styling depends on `UIUserInterfaceStyle`, // which was set on CarPlay external screen. // In case if it was set to `UIUserInterfaceStyle.light` white color will be used, otherwise @@ -405,51 +388,55 @@ open class DayStyle: Style { // property of which returns incorrect value), this property has to be taken from callbacks // similar to: `UITraitEnvironment.traitCollectionDidChange(_:)`, or by creating `UITraitCollection` // directly. + let defaultInstructionColor: UIColor + + let defaultLaneViewPrimaryColor: UIColor + let defaultLaneViewSecondaryColor: UIColor + + let defaultLaneArrowPrimaryHighlightedColor: UIColor + let defaultLaneArrowSecondaryHighlightedColor: UIColor + switch traitCollection.userInterfaceStyle { - case .dark: - let defaultColor = UIColor.white + case .light, .unspecified: + defaultInstructionColor = UIColor.black - let carPlayDarkTraitCollection = UITraitCollection(traitsFrom: [ - carPlayTraitCollection, - UITraitCollection(userInterfaceStyle: .dark) - ]) + defaultLaneViewPrimaryColor = .defaultLaneArrowPrimary + defaultLaneViewSecondaryColor = .defaultLaneArrowSecondary - ExitView.appearance(for: carPlayDarkTraitCollection).backgroundColor = .clear - ExitView.appearance(for: carPlayDarkTraitCollection).borderWidth = 1.0 - ExitView.appearance(for: carPlayDarkTraitCollection).cornerRadius = 5.0 - ExitView.appearance(for: carPlayDarkTraitCollection).foregroundColor = defaultColor - ExitView.appearance(for: carPlayDarkTraitCollection).borderColor = defaultColor - - GenericRouteShield.appearance(for: carPlayDarkTraitCollection).backgroundColor = .clear - GenericRouteShield.appearance(for: carPlayDarkTraitCollection).borderWidth = 1.0 - GenericRouteShield.appearance(for: carPlayDarkTraitCollection).cornerRadius = 5.0 - GenericRouteShield.appearance(for: carPlayDarkTraitCollection).foregroundColor = defaultColor - GenericRouteShield.appearance(for: carPlayDarkTraitCollection).borderColor = defaultColor - case .light, .unspecified: - let defaultColor = UIColor.black + defaultLaneArrowPrimaryHighlightedColor = .defaultLaneArrowPrimaryHighlighted + defaultLaneArrowSecondaryHighlightedColor = .defaultLaneArrowSecondaryHighlighted + case .dark: + defaultInstructionColor = UIColor.white - let carPlayLightTraitCollection = UITraitCollection(traitsFrom: [ - carPlayTraitCollection, - UITraitCollection(userInterfaceStyle: .light) - ]) + defaultLaneViewPrimaryColor = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1) + defaultLaneViewSecondaryColor = #colorLiteral(red: 0.4198532104, green: 0.4398920536, blue: 0.4437610507, alpha: 1) - ExitView.appearance(for: carPlayLightTraitCollection).backgroundColor = .clear - ExitView.appearance(for: carPlayLightTraitCollection).borderWidth = 1.0 - ExitView.appearance(for: carPlayLightTraitCollection).cornerRadius = 5.0 - ExitView.appearance(for: carPlayLightTraitCollection).foregroundColor = defaultColor - ExitView.appearance(for: carPlayLightTraitCollection).borderColor = defaultColor - - GenericRouteShield.appearance(for: carPlayLightTraitCollection).backgroundColor = .clear - GenericRouteShield.appearance(for: carPlayLightTraitCollection).borderWidth = 1.0 - GenericRouteShield.appearance(for: carPlayLightTraitCollection).cornerRadius = 5.0 - GenericRouteShield.appearance(for: carPlayLightTraitCollection).foregroundColor = defaultColor - GenericRouteShield.appearance(for: carPlayLightTraitCollection).borderColor = defaultColor + defaultLaneArrowPrimaryHighlightedColor = .defaultLaneArrowPrimaryHighlighted + defaultLaneArrowSecondaryHighlightedColor = .defaultLaneArrowSecondaryHighlighted @unknown default: fatalError("Unknown userInterfaceStyle.") } + + ExitView.appearance(for: traitCollection).backgroundColor = .clear + ExitView.appearance(for: traitCollection).borderWidth = 1.0 + ExitView.appearance(for: traitCollection).cornerRadius = 5.0 + ExitView.appearance(for: traitCollection).foregroundColor = defaultInstructionColor + ExitView.appearance(for: traitCollection).borderColor = defaultInstructionColor + + GenericRouteShield.appearance(for: traitCollection).backgroundColor = .clear + GenericRouteShield.appearance(for: traitCollection).borderWidth = 1.0 + GenericRouteShield.appearance(for: traitCollection).cornerRadius = 5.0 + GenericRouteShield.appearance(for: traitCollection).foregroundColor = defaultInstructionColor + GenericRouteShield.appearance(for: traitCollection).borderColor = defaultInstructionColor + + LaneView.appearance(for: traitCollection).primaryColor = defaultLaneViewPrimaryColor + LaneView.appearance(for: traitCollection).secondaryColor = defaultLaneViewSecondaryColor + + LaneView.appearance(for: traitCollection).primaryColorHighlighted = defaultLaneArrowPrimaryHighlightedColor + LaneView.appearance(for: traitCollection).secondaryColorHighlighted = defaultLaneArrowSecondaryHighlightedColor } - func setDefaultCarPlayInstructionsStyling() { + func applyDefaultCarPlayStyling() { let defaultColor = UIColor.black let carPlayTraitCollection = UITraitCollection(userInterfaceIdiom: .carPlay) @@ -458,5 +445,11 @@ open class DayStyle: Style { GenericRouteShield.appearance(for: carPlayTraitCollection).foregroundColor = defaultColor GenericRouteShield.appearance(for: carPlayTraitCollection).borderColor = defaultColor + + LaneView.appearance(for: carPlayTraitCollection).primaryColor = .defaultLaneArrowPrimary + LaneView.appearance(for: carPlayTraitCollection).secondaryColor = .defaultLaneArrowSecondary + + LaneView.appearance(for: carPlayTraitCollection).primaryColorHighlighted = .defaultLaneArrowPrimaryHighlighted + LaneView.appearance(for: carPlayTraitCollection).secondaryColorHighlighted = .defaultLaneArrowSecondaryHighlighted } } diff --git a/Sources/MapboxNavigation/LaneView.swift b/Sources/MapboxNavigation/LaneView.swift index e59a613c71..45f467dfe7 100644 --- a/Sources/MapboxNavigation/LaneView.swift +++ b/Sources/MapboxNavigation/LaneView.swift @@ -336,24 +336,37 @@ extension ManeuverDirection { /// :nodoc: open class LaneView: UIView { + + /** + The direction or directions of travel that the lane is reserved for. + */ var indications: LaneIndication { didSet { setNeedsDisplay() } } + /** + Denotes which of the `indications` is applicable to the current route when there is more than one. + */ var maneuverDirection: ManeuverDirection? { didSet { setNeedsDisplay() } } - var isValid: Bool = false { + /** + Denotes whether or not the user can use this lane to continue along the current route. + */ + var isUsable: Bool = false { didSet { setNeedsDisplay() } } + /** + Indicates which side of the road cars and traffic flow. + */ var drivingSide: DrivingSide = .right { didSet { setNeedsDisplay() @@ -364,30 +377,52 @@ open class LaneView: UIView { return bounds.size } + /** + Color of the maneuver direction (applied only when `LaneView.isUsable` is set to `true`). In case if + `LaneView.showHighlightedColors` is set to `true` this value is not used, `LaneView.primaryColorHighlighted` + is used instead. + */ @objc public dynamic var primaryColor: UIColor = .defaultLaneArrowPrimary { didSet { setNeedsDisplay() } } + /** + Color of the directions that the lane is reserved for (except the one that is applicable to the + current route). In case if `LaneView.showHighlightedColors` is set to `true` this value is not used, + `LaneView.secondaryColorHighlighted` is used instead. + */ @objc public dynamic var secondaryColor: UIColor = .defaultLaneArrowSecondary { didSet { setNeedsDisplay() } } - + + /** + Highlighted color of the directions that the lane is reserved for (except the one that is + applicable to the current route). + */ @objc public dynamic var primaryColorHighlighted: UIColor = .defaultLaneArrowPrimaryHighlighted { didSet { setNeedsDisplay() } } - + + /** + Highlighted color of the directions that the lane is reserved for (except the one that is applicable + to the current route). + */ @objc public dynamic var secondaryColorHighlighted: UIColor = .defaultLaneArrowSecondaryHighlighted { didSet { setNeedsDisplay() } } - + + /** + Controls whether highighted colors (either `LaneView.primaryColorHighlighted` or + `LaneView.secondaryColorHighlighted`) should be used. + */ public var showHighlightedColors: Bool = false { didSet { setNeedsDisplay() @@ -395,7 +430,7 @@ open class LaneView: UIView { } var appropriatePrimaryColor: UIColor { - if isValid { + if isUsable { return showHighlightedColors ? primaryColorHighlighted : primaryColor } else { return showHighlightedColors ? secondaryColorHighlighted : secondaryColor @@ -408,12 +443,16 @@ open class LaneView: UIView { static let defaultFrame: CGRect = CGRect(origin: .zero, size: 30.0) - convenience init(indications: LaneIndication, isUsable: Bool, direction: ManeuverDirection?) { + convenience init(indications: LaneIndication, + isUsable: Bool, + direction: ManeuverDirection?, + showHighlightedColors: Bool = false) { self.init(frame: LaneView.defaultFrame) backgroundColor = .clear self.indications = indications maneuverDirection = direction ?? ManeuverDirection(rawValue: indications.description) - isValid = isUsable + self.isUsable = isUsable + self.showHighlightedColors = showHighlightedColors } override init(frame: CGRect) { @@ -422,9 +461,9 @@ open class LaneView: UIView { commonInit() } - @objc public required init?(coder aDecoder: NSCoder) { + @objc public required init?(coder decoder: NSCoder) { indications = [] - super.init(coder: aDecoder) + super.init(coder: decoder) commonInit() } @@ -444,7 +483,7 @@ open class LaneView: UIView { #endif let resizing = LanesStyleKit.ResizingBehavior.aspectFit - let appropriateColor = isValid ? appropriatePrimaryColor : appropriateSecondaryColor + let appropriateColor = isUsable ? appropriatePrimaryColor : appropriateSecondaryColor let size = CGSize(width: 32, height: 32) let isFlipped = indications.dominantSide(maneuverDirection: maneuverDirection, drivingSide: drivingSide) == .left diff --git a/Sources/MapboxNavigation/LanesView.swift b/Sources/MapboxNavigation/LanesView.swift index ff302e65e9..8ca19ed1fd 100644 --- a/Sources/MapboxNavigation/LanesView.swift +++ b/Sources/MapboxNavigation/LanesView.swift @@ -59,7 +59,7 @@ open class LanesView: UIView, NavigationComponent { } } - guard !subviews.isEmpty && subviews.contains(where: { $0.isValid }) else { + guard !subviews.isEmpty && subviews.contains(where: { $0.isUsable }) else { hide(animated: animated, duration: duration) { completed in completion?(completed) diff --git a/Sources/MapboxNavigation/NavigationViewController.swift b/Sources/MapboxNavigation/NavigationViewController.swift index 349a74fe71..721894e9a5 100644 --- a/Sources/MapboxNavigation/NavigationViewController.swift +++ b/Sources/MapboxNavigation/NavigationViewController.swift @@ -880,7 +880,9 @@ extension NavigationViewController: NavigationServiceDelegate { imageColor = .black } - if let image = instruction.primaryInstruction.maneuverImage(side: instruction.drivingSide, color: imageColor, size: CGSize(width: 72, height: 72)) { + if let image = instruction.primaryInstruction.maneuverImage(drivingSide: instruction.drivingSide, + color: imageColor, + size: CGSize(width: 72, height: 72)) { // Bake in any transform required for left turn arrows etc. let imageData = UIGraphicsImageRenderer(size: image.size).pngData { (context) in image.draw(at: .zero) @@ -888,7 +890,9 @@ extension NavigationViewController: NavigationServiceDelegate { let temporaryURL = FileManager.default.temporaryDirectory.appendingPathComponent("com.mapbox.navigation.notification-icon.png") do { try imageData.write(to: temporaryURL) - let iconAttachment = try UNNotificationAttachment(identifier: "maneuver", url: temporaryURL, options: [UNNotificationAttachmentOptionsTypeHintKey: kUTTypePNG]) + let iconAttachment = try UNNotificationAttachment(identifier: "maneuver", + url: temporaryURL, + options: [UNNotificationAttachmentOptionsTypeHintKey: kUTTypePNG]) content.attachments = [iconAttachment] } catch { Log.error("Failed to create UNNotificationAttachment with error: \(error.localizedDescription).", diff --git a/Sources/MapboxNavigation/NightStyle.swift b/Sources/MapboxNavigation/NightStyle.swift index 7b6477ceac..fee89e73da 100644 --- a/Sources/MapboxNavigation/NightStyle.swift +++ b/Sources/MapboxNavigation/NightStyle.swift @@ -52,9 +52,8 @@ open class NightStyle: DayStyle { DismissButton.appearance(for: phoneTraitCollection).textColor = #colorLiteral(red: 0.9842069745, green: 0.9843751788, blue: 0.9841964841, alpha: 1) LaneView.appearance(for: phoneTraitCollection).primaryColor = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1) - LaneView.appearance(for: phoneTraitCollection).secondaryColor = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 0.3) - LaneView.appearance(for: phoneTraitCollection, whenContainedInInstancesOf: [LanesView.self]).primaryColor = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1) - LaneView.appearance(for: phoneTraitCollection, whenContainedInInstancesOf: [LanesView.self]).secondaryColor = #colorLiteral(red: 0.4198532104, green: 0.4398920536, blue: 0.4437610507, alpha: 1) + LaneView.appearance(for: phoneTraitCollection).secondaryColor = #colorLiteral(red: 0.4198532104, green: 0.4398920536, blue: 0.4437610507, alpha: 1) + LanesView.appearance(for: phoneTraitCollection).backgroundColor = backgroundColor StepsBackgroundView.appearance(for: phoneTraitCollection).backgroundColor = backgroundColor @@ -169,9 +168,6 @@ open class NightStyle: DayStyle { // `StylableLabel` is used in `CarPlayCompassView` to show compass direction. StylableLabel.appearance(for: carPlayTraitCollection, whenContainedInInstancesOf: [CarPlayCompassView.self]).normalTextColor = #colorLiteral(red: 0.9842069745, green: 0.9843751788, blue: 0.9841964841, alpha: 1) - LaneView.appearance(for: carPlayTraitCollection).primaryColor = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1) - LaneView.appearance(for: carPlayTraitCollection).secondaryColor = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 0.3) - WayNameView.appearance(for: carPlayTraitCollection).borderColor = #colorLiteral(red: 0.2802129388, green: 0.3988235593, blue: 0.5260632038, alpha: 1) WayNameLabel.appearance(for: carPlayTraitCollection).roadShieldBlackColor = #colorLiteral(red: 0.08, green: 0.09, blue: 0.12, alpha: 1) WayNameLabel.appearance(for: carPlayTraitCollection).roadShieldBlueColor = #colorLiteral(red: 0.18, green: 0.26, blue: 0.66, alpha: 1) diff --git a/Sources/MapboxNavigation/UIColor.swift b/Sources/MapboxNavigation/UIColor.swift index 27995ffbe0..035dd6a348 100644 --- a/Sources/MapboxNavigation/UIColor.swift +++ b/Sources/MapboxNavigation/UIColor.swift @@ -16,17 +16,16 @@ extension UIColor { class var defaultManeuverArrow: UIColor { #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1) } class var defaultTurnArrowPrimary: UIColor { #colorLiteral(red: 0, green: 0, blue: 0, alpha: 1) } - class var defaultTurnArrowPrimaryHighlighted: UIColor { #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1) } class var defaultTurnArrowSecondary: UIColor { #colorLiteral(red: 0.6196078431, green: 0.6196078431, blue: 0.6196078431, alpha: 1) } + + class var defaultTurnArrowPrimaryHighlighted: UIColor { #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1) } class var defaultTurnArrowSecondaryHighlighted: UIColor { UIColor.white.withAlphaComponent(0.4) } - + class var defaultLaneArrowPrimary: UIColor { #colorLiteral(red: 0, green: 0, blue: 0, alpha: 1) } class var defaultLaneArrowSecondary: UIColor { #colorLiteral(red: 0.6196078431, green: 0.6196078431, blue: 0.6196078431, alpha: 1) } + class var defaultLaneArrowPrimaryHighlighted: UIColor { #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1) } class var defaultLaneArrowSecondaryHighlighted: UIColor { UIColor(white: 0.7, alpha: 1.0) } - - class var defaultLaneArrowPrimaryCarPlay: UIColor { #colorLiteral(red: 0.7649999857, green: 0.7649999857, blue: 0.7570000291, alpha: 1) } - class var defaultLaneArrowSecondaryCarPlay: UIColor { #colorLiteral(red: 0.4198532104, green: 0.4398920536, blue: 0.4437610507, alpha: 1) } class var trafficUnknown: UIColor { defaultRouteLayer } class var trafficLow: UIColor { defaultRouteLayer } @@ -83,4 +82,18 @@ extension UIColor { blue: CGFloat(styleColor.blue / 255.0), alpha: CGFloat(styleColor.alpha)) } + + /** + Returns hex representation of a `UIColor`. + */ + var hexString: String { + var r: CGFloat = 0 + var g: CGFloat = 0 + var b: CGFloat = 0 + var a: CGFloat = 0 + getRed(&r, green: &g, blue: &b, alpha: &a) + + let rgb: Int = (Int)(r * 255) << 16 | (Int)(g * 255) << 8 | (Int)(b * 255) << 0 + return String(format:"#%06x", rgb) + } } diff --git a/Sources/MapboxNavigation/VisualInstruction.swift b/Sources/MapboxNavigation/VisualInstruction.swift index f7ab4fbd56..4a8306a9d2 100644 --- a/Sources/MapboxNavigation/VisualInstruction.swift +++ b/Sources/MapboxNavigation/VisualInstruction.swift @@ -17,42 +17,55 @@ extension VisualInstruction { return laneComponents.count > 0 } - func maneuverImage(side: DrivingSide, color: UIColor, size: CGSize) -> UIImage? { - let mv = ManeuverView() - mv.frame = CGRect(origin: .zero, size: size) - mv.primaryColor = color - mv.backgroundColor = .clear - mv.scale = UIScreen.main.scale - mv.visualInstruction = self - mv.drivingSide = side - let image = mv.imageRepresentation - return image + func maneuverImage(drivingSide: DrivingSide, + color: UIColor, + size: CGSize) -> UIImage? { + let maneuverView = ManeuverView() + maneuverView.frame = CGRect(origin: .zero, size: size) + maneuverView.primaryColor = color + maneuverView.backgroundColor = .clear + maneuverView.scale = UIScreen.main.scale + maneuverView.visualInstruction = self + maneuverView.drivingSide = drivingSide + + return maneuverView.imageRepresentation } - func laneImage(side: DrivingSide, indication: LaneIndication, maneuverDirection: ManeuverDirection?, isUsable: Bool, useableColor: UIColor, unuseableColor: UIColor, size: CGSize) -> UIImage? { + func laneViewImage(drivingSide: DrivingSide, + indication: LaneIndication, + maneuverDirection: ManeuverDirection?, + isUsable: Bool, + useableColor: UIColor, + unuseableColor: UIColor, + size: CGSize) -> UIImage? { let laneView = LaneView() laneView.frame = CGRect(origin: .zero, size: size) - if isUsable { - laneView.primaryColor = useableColor - laneView.secondaryColor = unuseableColor - } else { - laneView.primaryColor = unuseableColor - laneView.secondaryColor = unuseableColor - } + laneView.primaryColor = useableColor + laneView.secondaryColor = unuseableColor laneView.backgroundColor = .clear laneView.maneuverDirection = maneuverDirection laneView.indications = indication - laneView.isValid = isUsable - laneView.drivingSide = side - let image = laneView.imageRepresentation - - return image + laneView.isUsable = isUsable + laneView.drivingSide = drivingSide + + return laneView.imageRepresentation } - func lanesImage(side: DrivingSide, direction: ManeuverDirection?, useableColor: UIColor, unuseableColor: UIColor, size: CGSize, scale: CGFloat) -> UIImage? { + func lanesViewImage(drivingSide: DrivingSide, + direction: ManeuverDirection?, + useableColor: UIColor, + unuseableColor: UIColor, + size: CGSize, + scale: CGFloat) -> UIImage? { let subimages = components.compactMap { (component) -> UIImage? in if case let .lane(indications: indications, isUsable: isUsable, preferredDirection: preferredDirection) = component { - return laneImage(side: side, indication: indications, maneuverDirection: preferredDirection ?? direction, isUsable: isUsable, useableColor: useableColor, unuseableColor: unuseableColor, size: CGSize(width: size.height, height: size.height)) + return laneViewImage(drivingSide: drivingSide, + indication: indications, + maneuverDirection: preferredDirection ?? direction, + isUsable: isUsable, + useableColor: useableColor, + unuseableColor: unuseableColor, + size: CGSize(width: size.height, height: size.height)) } else { return nil } @@ -73,15 +86,26 @@ extension VisualInstruction { return newImage } - /// Returns a `CPImageSet` representing the maneuver. + /** + Returns a `CPImageSet` representing the maneuver. + + - parameter side: Driving side of the road cars and traffic flow. + + - returns: An image set with light and dark versions of an image. + */ @available(iOS 12.0, *) public func maneuverImageSet(side: DrivingSide) -> CPImageSet? { let colors: [UIColor] = [.black, .white] - let blackAndWhiteManeuverIcons: [UIImage] = colors.compactMap { (color) in - return maneuverImage(side: side, color: color, size: CGSize(width: 30, height: 30)) + let maneuverIcons: [UIImage] = colors.compactMap { (color) in + return maneuverImage(drivingSide: side, + color: color, + size: CGSize(width: 30, height: 30)) } - guard blackAndWhiteManeuverIcons.count == 2 else { return nil } - return CPImageSet(lightContentImage: blackAndWhiteManeuverIcons[1], darkContentImage: blackAndWhiteManeuverIcons[0]) + guard maneuverIcons.count == 2 else { return nil } + + // `CPImageSet` applies `lightContentImage` for dark appearance and `darkContentImage` + // for light appearance, because of this white color is set for `lightContentImage` parameter. + return CPImageSet(lightContentImage: maneuverIcons[1], darkContentImage: maneuverIcons[0]) } /// Returns whether the `VisualInstruction`’s maneuver image should be flipped according to the driving side. @@ -135,50 +159,62 @@ extension VisualInstruction { return instructionLabel.attributedText } - /// Returns a `CPImageSet` representing the maneuver lane configuration. + /** + Returns a `CPImageSet` representing the maneuver lane configuration. + + - parameter side: Indicates which side of the road cars and traffic flow. + - parameter direction: `ManeuverType` that contains directional information. + - parameter scale: The natural scale factor associated with the CarPlay screen. + + - returns: Light and dark representations of an image that contains maneuver lane configuration. + */ @available(iOS 12.0, *) - public func lanesImageSet(side: DrivingSide, direction: ManeuverDirection?, scale: CGFloat) -> CPImageSet? { - // create lanes visual banner - // The `lanesImageMaxSize` size is an estimate of the CarPlay Lane Configuration View - // The dimensions are specified in the CarPlay App Programming Guide - https://developer.apple.com/carplay/documentation/CarPlay-App-Programming-Guide.pdf#page=38 + public func lanesImageSet(side: DrivingSide, + direction: ManeuverDirection?, + scale: CGFloat) -> CPImageSet? { + // The `lanesImageMaxSize` size is an estimate of the CarPlay Lane Configuration View. + // The dimensions are specified in the CarPlay App Programming Guide: + // https://developer.apple.com/carplay/documentation/CarPlay-App-Programming-Guide.pdf#page=38 let lanesImageMaxSize = CGSize(width: 120, height: 18) - - let lightUsableColor: UIColor - let lightUnuseableColor: UIColor - let darkUsableColor: UIColor - let darkUnuseableColor: UIColor - - if #available(iOS 13.0, *) { - let lightTraitCollection = UITraitCollection(userInterfaceStyle: .light) - let darkTraitCollection = UITraitCollection(userInterfaceStyle: .dark) - - lightUsableColor = LaneView.appearance(for: UITraitCollection(userInterfaceIdiom: .carPlay)).primaryColor.resolvedColor(with: lightTraitCollection) - lightUnuseableColor = LaneView.appearance(for: UITraitCollection(userInterfaceIdiom: .carPlay)).secondaryColor.resolvedColor(with: lightTraitCollection) - - darkUsableColor = LaneView.appearance(for: UITraitCollection(userInterfaceIdiom: .carPlay)).primaryColor.resolvedColor(with: darkTraitCollection) - darkUnuseableColor = LaneView.appearance(for: UITraitCollection(userInterfaceIdiom: .carPlay)).secondaryColor.resolvedColor(with: darkTraitCollection) - } else { - // No light/dark traits are supported - lightUsableColor = LaneView.appearance().primaryColor - lightUnuseableColor = LaneView.appearance().secondaryColor - - darkUsableColor = LaneView.appearance().primaryColor - darkUnuseableColor = LaneView.appearance().secondaryColor - } - - var lightLanesImage = lanesImage(side: side, direction: direction, useableColor: lightUsableColor, unuseableColor: lightUnuseableColor, size: CGSize(width: CGFloat(laneComponents.count) * lanesImageMaxSize.height, height: lanesImageMaxSize.height), scale: scale) - - var darkLanesImage = lanesImage(side: side, direction: direction, useableColor: darkUsableColor, unuseableColor: darkUnuseableColor, size: CGSize(width: CGFloat(laneComponents.count) * lanesImageMaxSize.height, height: lanesImageMaxSize.height), scale: scale) - - if let image = lightLanesImage, let darkImage = darkLanesImage, image.size.width > lanesImageMaxSize.width { - let aspectRatio = lanesImageMaxSize.width / image.size.width + + let lightTraitCollection = UITraitCollection(traitsFrom: [ + UITraitCollection(userInterfaceIdiom: .carPlay), + UITraitCollection(userInterfaceStyle: .light) + ]) + var lightLanesImage = lanesViewImage(drivingSide: side, + direction: direction, + useableColor: LaneView.appearance(for: lightTraitCollection).primaryColor, + unuseableColor: LaneView.appearance(for: lightTraitCollection).secondaryColor, + size: CGSize(width: CGFloat(laneComponents.count) * lanesImageMaxSize.height, height: lanesImageMaxSize.height), + scale: scale) + + let darkTraitCollection = UITraitCollection(traitsFrom: [ + UITraitCollection(userInterfaceIdiom: .carPlay), + UITraitCollection(userInterfaceStyle: .dark) + ]) + var darkLanesImage = lanesViewImage(drivingSide: side, + direction: direction, + useableColor: LaneView.appearance(for: darkTraitCollection).primaryColor, + unuseableColor: LaneView.appearance(for: darkTraitCollection).secondaryColor, + size: CGSize(width: CGFloat(laneComponents.count) * lanesImageMaxSize.height, height: lanesImageMaxSize.height), + scale: scale) + + if let lightImage = lightLanesImage, + let darkImage = darkLanesImage, + lightImage.size.width > lanesImageMaxSize.width { + let aspectRatio = lanesImageMaxSize.width / lightImage.size.width let scaledSize = CGSize(width: lanesImageMaxSize.width, height: lanesImageMaxSize.height * aspectRatio) - lightLanesImage = image.scaled(to: scaledSize) + lightLanesImage = lightImage.scaled(to: scaledSize) darkLanesImage = darkImage.scaled(to: scaledSize) } - if let image = lightLanesImage, let darkImage = darkLanesImage { - return CPImageSet(lightContentImage: image, darkContentImage: darkImage) + + if let lightImage = lightLanesImage, + let darkImage = darkLanesImage { + // `CPImageSet` applies `lightContentImage` for dark appearance and `d`arkContentImage` + // for light appearance, because of this `darkImage` is set for `lightContentImage` parameter. + return CPImageSet(lightContentImage: darkImage, darkContentImage: lightImage) } + return nil } } diff --git a/Tests/MapboxNavigationTests/LaneSnapshotTests.swift b/Tests/MapboxNavigationTests/LaneSnapshotTests.swift deleted file mode 100644 index 782b111e20..0000000000 --- a/Tests/MapboxNavigationTests/LaneSnapshotTests.swift +++ /dev/null @@ -1,105 +0,0 @@ -import XCTest -import SnapshotTesting -import MapboxDirections -@testable import TestHelper -@testable import MapboxNavigation -@testable import MapboxCoreNavigation - -class LaneSnapshotTests: TestCase { - override func setUp() { - super.setUp() - isRecording = false - DayStyle().apply() - - // Apply correct appearance for test case envirounment. - LaneView.appearance().primaryColor = LaneView.appearance(whenContainedInInstancesOf: [LanesView.self]).primaryColor - LaneView.appearance().secondaryColor = LaneView.appearance(whenContainedInInstancesOf: [LanesView.self]).secondaryColor - LaneView.appearance().primaryColorHighlighted = LaneView.appearance(whenContainedInInstancesOf: [LanesView.self]).primaryColorHighlighted - LaneView.appearance().secondaryColorHighlighted = LaneView.appearance(whenContainedInInstancesOf: [LanesView.self]).secondaryColorHighlighted - LanesView.appearance().backgroundColor = #colorLiteral(red: 0.968627451, green: 0.968627451, blue: 0.968627451, alpha: 1) - } - - func testAllLanes30x30() { - verifyAllLanes(size: CGSize(size: 30)) - } - - func testAllLanes90x90() { - verifyAllLanes(size: CGSize(size: 90)) - } - - func verifyAllLanes(size: CGSize) { - let leftHandLanes = TestableLane.testableLanes(drivingSide: .left) - let rightHandLanes = TestableLane.testableLanes(drivingSide: .right) - - func addLanes(lanes: [TestableLane], stackView: UIStackView) { - let containerView = UIStackView(orientation: .vertical, spacing: 5, autoLayout: true) - - for lane in lanes { - let groupView = UIStackView(orientation: .vertical, autoLayout: true) - groupView.alignment = .center - - let laneView = LaneView(indications: lane.indications, isUsable: true, direction: lane.maneuverDirection) - laneView.drivingSide = lane.drivingSide - - laneView.backgroundColor = .white - laneView.bounds = CGRect(origin: .zero, size: size) - - let label = UILabel(frame: .zero) - label.textColor = .white - label.text = "\(lane.description) (\(lane.drivingSide == .left ? "L" : "R"))" - - groupView.addArrangedSubview(label) - groupView.addArrangedSubview(laneView) - - containerView.addArrangedSubview(groupView) - } - - stackView.addArrangedSubview(containerView) - } - - let view = UIStackView(orientation: .vertical, spacing: 5, autoLayout: true) - view.setBackgroundColor(.black) - - addLanes(lanes: rightHandLanes, stackView: view) - addLanes(lanes: leftHandLanes, stackView: view) - - assertImageSnapshot(matching: view, as: .image(precision: 0.95)) - } -} - -struct TestableLane { - var description: String - var indications: LaneIndication - var drivingSide: DrivingSide - var maneuverDirection: ManeuverDirection - - static func testableLanes(drivingSide: DrivingSide) -> [TestableLane] { - let namedIndications: [(String, LaneIndication, ManeuverDirection)] - - namedIndications = [ - ("Sharp Left, Straight Ahead", [.sharpLeft, .straightAhead], .sharpLeft), - ("Straight Ahead, Sharp Left", [.straightAhead, .sharpLeft], .sharpLeft), - ("Left", [.left], .left), - ("Slight Left", [.slightLeft], .slightLeft), - ("Sharp Left", [.sharpLeft], .sharpLeft), - ("Straight Ahead", [.straightAhead], .straightAhead), - ("u-Turn", [.uTurn], .uTurn), - ("Sharp Right", [.sharpRight], .sharpRight), - ("Slight Right", [.slightRight], .slightRight), - ("Right", [.right], .right), - ("Sharp Right, Straight Ahead", [.sharpRight, .straightAhead], .sharpRight), - ("Straight Ahead, Sharp Right", [.straightAhead, .sharpRight], .sharpRight), - ] - - return namedIndications.map { TestableLane(description: $0.0, indications: $0.1, drivingSide: drivingSide, maneuverDirection: $0.2) } - } -} - -extension UIStackView { - func setBackgroundColor(_ color: UIColor) { - let subview = UIView(frame: bounds) - subview.backgroundColor = color - subview.autoresizingMask = [.flexibleWidth, .flexibleHeight] - insertSubview(subview, at: 0) - } -} diff --git a/Tests/MapboxNavigationTests/LaneViewSnapshotTests.swift b/Tests/MapboxNavigationTests/LaneViewSnapshotTests.swift new file mode 100644 index 0000000000..eaa84c74e7 --- /dev/null +++ b/Tests/MapboxNavigationTests/LaneViewSnapshotTests.swift @@ -0,0 +1,257 @@ +import XCTest +import SnapshotTesting +import MapboxDirections +@testable import TestHelper +@testable import MapboxNavigation +@testable import MapboxCoreNavigation + +@available(iOS 12.0, *) +let lightUserInterfaceStylePhoneTraitCollection = UITraitCollection(traitsFrom: [ + UITraitCollection(userInterfaceIdiom: .phone), + UITraitCollection(userInterfaceStyle: .light) +]) + +@available(iOS 12.0, *) +let lightUserInterfaceStyleCarPlayTraitCollection = UITraitCollection(traitsFrom: [ + UITraitCollection(userInterfaceIdiom: .carPlay), + UITraitCollection(userInterfaceStyle: .light) +]) + +@available(iOS 12.0, *) +let darkUserInterfaceStyleCarPlayTraitCollection = UITraitCollection(traitsFrom: [ + UITraitCollection(userInterfaceIdiom: .carPlay), + UITraitCollection(userInterfaceStyle: .dark) +]) + +class LaneViewSnapshotTests: TestCase { + + let styles = [DayStyle(), NightStyle()] + + @available(iOS 12.0, *) + func laneViews(for traitCollection: UITraitCollection) -> [LaneViewMock] { + let indications: LaneIndication = [ + .left, + .straightAhead + ] + + let direction: ManeuverDirection = .left + + let laneViews = [ + LaneViewMock(for: traitCollection, + indications: indications, + isUsable: true, + direction: direction, + showHighlightedColors: true), + LaneViewMock(for: traitCollection, + indications: indications, + isUsable: true, + direction: direction, + showHighlightedColors: false), + LaneViewMock(for: traitCollection, + indications: indications, + isUsable: false, + direction: direction, + showHighlightedColors: true), + LaneViewMock(for: traitCollection, + indications: indications, + isUsable: false, + direction: direction, + showHighlightedColors: false) + ] + + return laneViews + } + + override func setUp() { + super.setUp() + isRecording = false + DayStyle().apply() + } + + func testAllLanes30x30() { + verifyAllLanes(size: CGSize(size: 30)) + } + + func testAllLanes90x90() { + verifyAllLanes(size: CGSize(size: 90)) + } + + func verifyAllLanes(size: CGSize) { + let leftHandLanes = TestableLane.testableLanes(drivingSide: .left) + let rightHandLanes = TestableLane.testableLanes(drivingSide: .right) + + func addLanes(lanes: [TestableLane], stackView: UIStackView) { + let containerView = UIStackView(orientation: .vertical, spacing: 5, autoLayout: true) + + for lane in lanes { + let groupView = UIStackView(orientation: .vertical, autoLayout: true) + groupView.alignment = .center + + let laneView = LaneView(indications: lane.indications, isUsable: true, direction: lane.maneuverDirection) + laneView.drivingSide = lane.drivingSide + + laneView.backgroundColor = .white + laneView.bounds = CGRect(origin: .zero, size: size) + + let label = UILabel(frame: .zero) + label.textColor = .white + label.text = "\(lane.description) (\(lane.drivingSide == .left ? "L" : "R"))" + + groupView.addArrangedSubview(label) + groupView.addArrangedSubview(laneView) + + containerView.addArrangedSubview(groupView) + } + + stackView.addArrangedSubview(containerView) + } + + let view = UIStackView(orientation: .vertical, spacing: 5, autoLayout: true) + view.setBackgroundColor(.black) + + addLanes(lanes: rightHandLanes, stackView: view) + addLanes(lanes: leftHandLanes, stackView: view) + + assertImageSnapshot(matching: view, as: .image(precision: 0.95)) + } + + @available(iOS 12.0, *) + func testLaneViewLightUserInterfaceStylePhone() { + for style in styles { + let stackView = UIStackView(orientation: .vertical, spacing: 5, autoLayout: true) + stackView.backgroundColor = .white + style.traitCollection = UITraitCollection(userInterfaceIdiom: .phone) + style.apply() + + let horizontalStackView = UIStackView(orientation: .horizontal, + spacing: 2, + autoLayout: true) + + for laneView in laneViews(for: lightUserInterfaceStylePhoneTraitCollection) { + horizontalStackView.addArrangedSubview(laneView) + } + + stackView.addArrangedSubview(horizontalStackView) + + assertImageSnapshot(matching: stackView, as: .image(precision: 0.95)) + } + } + + @available(iOS 12.0, *) + func testLaneViewLightUserInterfaceStyleCarPlay() { + for style in styles { + let stackView = UIStackView(orientation: .vertical, spacing: 5, autoLayout: true) + stackView.backgroundColor = .white + style.traitCollection = UITraitCollection(userInterfaceIdiom: .carPlay) + style.apply() + + let horizontalStackView = UIStackView(orientation: .horizontal, + spacing: 2, + autoLayout: true) + + for laneView in laneViews(for: lightUserInterfaceStyleCarPlayTraitCollection) { + horizontalStackView.addArrangedSubview(laneView) + } + + stackView.addArrangedSubview(horizontalStackView) + + assertImageSnapshot(matching: stackView, as: .image(precision: 0.95)) + } + } + + @available(iOS 12.0, *) + func testLaneViewDarkUserInterfaceStyleCarPlay() { + for style in styles { + let stackView = UIStackView(orientation: .vertical, spacing: 5, autoLayout: true) + stackView.backgroundColor = .black + style.traitCollection = UITraitCollection(userInterfaceIdiom: .carPlay) + style.apply() + + let horizontalStackView = UIStackView(orientation: .horizontal, + spacing: 2, + autoLayout: true) + + for laneView in laneViews(for: darkUserInterfaceStyleCarPlayTraitCollection) { + horizontalStackView.addArrangedSubview(laneView) + } + + stackView.addArrangedSubview(horizontalStackView) + + assertImageSnapshot(matching: stackView, as: .image(precision: 0.95)) + } + } +} + +struct TestableLane { + var description: String + var indications: LaneIndication + var drivingSide: DrivingSide + var maneuverDirection: ManeuverDirection + + static func testableLanes(drivingSide: DrivingSide) -> [TestableLane] { + let namedIndications: [(String, LaneIndication, ManeuverDirection)] + + namedIndications = [ + ("Sharp Left, Straight Ahead", [.sharpLeft, .straightAhead], .sharpLeft), + ("Straight Ahead, Sharp Left", [.straightAhead, .sharpLeft], .sharpLeft), + ("Left", [.left], .left), + ("Slight Left", [.slightLeft], .slightLeft), + ("Sharp Left", [.sharpLeft], .sharpLeft), + ("Straight Ahead", [.straightAhead], .straightAhead), + ("u-Turn", [.uTurn], .uTurn), + ("Sharp Right", [.sharpRight], .sharpRight), + ("Slight Right", [.slightRight], .slightRight), + ("Right", [.right], .right), + ("Sharp Right, Straight Ahead", [.sharpRight, .straightAhead], .sharpRight), + ("Straight Ahead, Sharp Right", [.straightAhead, .sharpRight], .sharpRight), + ] + + return namedIndications.map { TestableLane(description: $0.0, indications: $0.1, drivingSide: drivingSide, maneuverDirection: $0.2) } + } +} + +extension UIStackView { + func setBackgroundColor(_ color: UIColor) { + let subview = UIView(frame: bounds) + subview.backgroundColor = color + subview.autoresizingMask = [.flexibleWidth, .flexibleHeight] + insertSubview(subview, at: 0) + } +} + +@available(iOS 12.0, *) +class LaneViewMock: LaneView { + + var customTraitCollection: UITraitCollection! + + override init(frame: CGRect) { + customTraitCollection = UITraitCollection(traitsFrom: [ + UITraitCollection(userInterfaceIdiom: .phone), + UITraitCollection(userInterfaceStyle: .light) + ]) + + super.init(frame: frame) + } + + required init?(coder decoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + convenience init(for traitCollection: UITraitCollection, + indications: LaneIndication, + isUsable: Bool, + direction: ManeuverDirection?, + showHighlightedColors: Bool = false) { + self.init(frame: LaneView.defaultFrame) + customTraitCollection = traitCollection + backgroundColor = .clear + self.indications = indications + maneuverDirection = direction ?? ManeuverDirection(rawValue: indications.description) + self.isUsable = isUsable + self.showHighlightedColors = showHighlightedColors + } + + override var traitCollection: UITraitCollection { + customTraitCollection + } +} diff --git a/Tests/MapboxNavigationTests/__Snapshots__/iPhone12_5/13.7/LaneSnapshotTests/verifyAllLanes-size.1.png b/Tests/MapboxNavigationTests/__Snapshots__/iPhone12_5/13.7/LaneViewSnapshotTests/verifyAllLanes-size.1.png similarity index 100% rename from Tests/MapboxNavigationTests/__Snapshots__/iPhone12_5/13.7/LaneSnapshotTests/verifyAllLanes-size.1.png rename to Tests/MapboxNavigationTests/__Snapshots__/iPhone12_5/13.7/LaneViewSnapshotTests/verifyAllLanes-size.1.png diff --git a/Tests/MapboxNavigationTests/__Snapshots__/iPhone12_5/13.7/LaneSnapshotTests/verifyAllLanes-size.2.png b/Tests/MapboxNavigationTests/__Snapshots__/iPhone12_5/13.7/LaneViewSnapshotTests/verifyAllLanes-size.2.png similarity index 100% rename from Tests/MapboxNavigationTests/__Snapshots__/iPhone12_5/13.7/LaneSnapshotTests/verifyAllLanes-size.2.png rename to Tests/MapboxNavigationTests/__Snapshots__/iPhone12_5/13.7/LaneViewSnapshotTests/verifyAllLanes-size.2.png diff --git a/Tests/MapboxNavigationTests/__Snapshots__/iPhone13_4/14.5/LaneSnapshotTests/verifyAllLanes-size.1.png b/Tests/MapboxNavigationTests/__Snapshots__/iPhone13_4/14.5/LaneViewSnapshotTests/verifyAllLanes-size.1.png similarity index 100% rename from Tests/MapboxNavigationTests/__Snapshots__/iPhone13_4/14.5/LaneSnapshotTests/verifyAllLanes-size.1.png rename to Tests/MapboxNavigationTests/__Snapshots__/iPhone13_4/14.5/LaneViewSnapshotTests/verifyAllLanes-size.1.png diff --git a/Tests/MapboxNavigationTests/__Snapshots__/iPhone13_4/14.5/LaneSnapshotTests/verifyAllLanes-size.2.png b/Tests/MapboxNavigationTests/__Snapshots__/iPhone13_4/14.5/LaneViewSnapshotTests/verifyAllLanes-size.2.png similarity index 100% rename from Tests/MapboxNavigationTests/__Snapshots__/iPhone13_4/14.5/LaneSnapshotTests/verifyAllLanes-size.2.png rename to Tests/MapboxNavigationTests/__Snapshots__/iPhone13_4/14.5/LaneViewSnapshotTests/verifyAllLanes-size.2.png diff --git a/Tests/MapboxNavigationTests/__Snapshots__/iPhone14_3/15.2/LaneSnapshotTests/verifyAllLanes-size.1.png b/Tests/MapboxNavigationTests/__Snapshots__/iPhone14_3/15.2/LaneViewSnapshotTests/verifyAllLanes-size.1.png similarity index 100% rename from Tests/MapboxNavigationTests/__Snapshots__/iPhone14_3/15.2/LaneSnapshotTests/verifyAllLanes-size.1.png rename to Tests/MapboxNavigationTests/__Snapshots__/iPhone14_3/15.2/LaneViewSnapshotTests/verifyAllLanes-size.1.png diff --git a/Tests/MapboxNavigationTests/__Snapshots__/iPhone14_3/15.2/LaneSnapshotTests/verifyAllLanes-size.2.png b/Tests/MapboxNavigationTests/__Snapshots__/iPhone14_3/15.2/LaneViewSnapshotTests/verifyAllLanes-size.2.png similarity index 100% rename from Tests/MapboxNavigationTests/__Snapshots__/iPhone14_3/15.2/LaneSnapshotTests/verifyAllLanes-size.2.png rename to Tests/MapboxNavigationTests/__Snapshots__/iPhone14_3/15.2/LaneViewSnapshotTests/verifyAllLanes-size.2.png