Skip to content

Commit

Permalink
Merge pull request #2343 from mapbox/ac-ExposeAdditionalSecondaryHigh…
Browse files Browse the repository at this point in the history
…lightColors

Expose secondary highlight colors used in guidance cards
  • Loading branch information
avi-c authored Feb 28, 2020
2 parents e039129 + 36ea9fc commit 9d78861
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
8 changes: 8 additions & 0 deletions MapboxNavigation/DayInstructionsCardStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ public class DayInstructionsCardStyle: InstructionsCardStyle {
public var maneuverViewHighlightedColor: UIColor {
return .cardLight
}

public var maneuverViewSecondaryHighlightedColor: UIColor {
return UIColor.cardLight.withAlphaComponent(0.4)
}

public var nextBannerViewPrimaryColor: UIColor {
return .cardBlue
Expand All @@ -85,6 +89,10 @@ public class DayInstructionsCardStyle: InstructionsCardStyle {
public var nextBannerInstructionHighlightedColor: UIColor {
return .cardLight
}

public var nextBannerInstructionSecondaryHighlightedColor: UIColor {
return UIColor.cardLight.withAlphaComponent(0.4)
}

public var lanesViewDefaultColor: UIColor {
return .cardBlue
Expand Down
4 changes: 2 additions & 2 deletions MapboxNavigation/InstructionsCardContainerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ public class InstructionsCardContainerView: UIView {
fileprivate func hightlightNextBannerView(_ gradientLayer: CAGradientLayer, colors: [CGColor]) {
gradientLayer.colors = colors
nextBannerView.maneuverView.primaryColor = style.nextBannerInstructionHighlightedColor
nextBannerView.maneuverView.secondaryColor = style.nextBannerInstructionHighlightedColor
nextBannerView.maneuverView.secondaryColor = style.nextBannerInstructionSecondaryHighlightedColor
nextBannerView.instructionLabel.normalTextColor = style.nextBannerInstructionHighlightedColor
}

Expand All @@ -290,7 +290,7 @@ public class InstructionsCardContainerView: UIView {
instructionsCardView.distanceLabel.valueTextColor = style.distanceLabelHighlightedTextColor
// maneuver view
instructionsCardView.maneuverView.primaryColor = style.maneuverViewHighlightedColor
instructionsCardView.maneuverView.secondaryColor = style.maneuverViewHighlightedColor
instructionsCardView.maneuverView.secondaryColor = style.maneuverViewSecondaryHighlightedColor
}
}

Expand Down
2 changes: 2 additions & 0 deletions MapboxNavigation/InstructionsCardStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ public protocol InstructionsCardStyle: class {
var maneuverViewPrimaryColor: UIColor { get }
var maneuverViewSecondaryColor: UIColor { get }
var maneuverViewHighlightedColor: UIColor { get }
var maneuverViewSecondaryHighlightedColor: UIColor { get }

// MARK: Next Banner Instruction custom formats
var nextBannerViewPrimaryColor: UIColor { get }
var nextBannerViewSecondaryColor: UIColor { get }
var nextBannerInstructionLabelTextColor: UIColor { get }
var nextBannerInstructionLabelNormalFont: UIFont { get }
var nextBannerInstructionHighlightedColor: UIColor { get }
var nextBannerInstructionSecondaryHighlightedColor: UIColor { get }

// MARK: Lanes View custom formats
var lanesViewDefaultColor: UIColor { get }
Expand Down
2 changes: 2 additions & 0 deletions MapboxNavigationTests/InstructionsCardCollectionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,13 @@ class TestInstructionsCardStyle: InstructionsCardStyle {
var maneuverViewPrimaryColor: UIColor = .blue
var maneuverViewSecondaryColor: UIColor = .clear
var maneuverViewHighlightedColor: UIColor = .brown
var maneuverViewSecondaryHighlightedColor: UIColor = .orange

var nextBannerViewPrimaryColor: UIColor = .cardBlue
var nextBannerViewSecondaryColor: UIColor = .cardLight
var nextBannerInstructionLabelTextColor: UIColor = .cardDark
var nextBannerInstructionHighlightedColor: UIColor = .cardLight
var nextBannerInstructionSecondaryHighlightedColor: UIColor = .orange
var lanesViewDefaultColor: UIColor = .cardBlue
var lanesViewHighlightedColor: UIColor = .cardLight
lazy var nextBannerInstructionLabelNormalFont: UIFont = {
Expand Down

0 comments on commit 9d78861

Please sign in to comment.