Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New car play change colors logic #4620

Merged
merged 5 commits into from
Apr 3, 2024

Conversation

chizhavko
Copy link
Contributor

@chizhavko chizhavko commented Apr 2, 2024

This PR introduce new logic related to configuration to set custom colors to CPMapTemplate.guidanceBackgroundColor using new delegate method:
CarPlayNavigationViewControllerDelegate.carPlayNavigationViewController(_:guidanceBackgroundColor:)

@chizhavko chizhavko requested a review from a team as a code owner April 2, 2024 14:50
@mapbox-github-ci-issues-public-1

API compatibility report for MapboxNavigation: 🔴

Protocol Requirement Change

  • Func CarPlayManagerDelegate.carPlayNavigationViewController(_:guidanceBackgroundColor:) has been added as a protocol requirement
  • Func CarPlayNavigationViewControllerDelegate.carPlayNavigationViewController(_:guidanceBackgroundColor:) has been added as a protocol requirement

@chizhavko chizhavko force-pushed the new-carplay-change-background-color-logic branch from d1d8fae to 677ceff Compare April 2, 2024 15:04
Copy link
Contributor

@azarovalex azarovalex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please also add a changelog

Sources/MapboxNavigation/CarPlayManagerDelegate.swift Outdated Show resolved Hide resolved
Sources/MapboxNavigation/CarPlayManagerDelegate.swift Outdated Show resolved Hide resolved
Copy link

codecov bot commented Apr 2, 2024

Codecov Report

Attention: Patch coverage is 0% with 21 lines in your changes are missing coverage. Please review.

Project coverage is 60.51%. Comparing base (f565d8f) to head (5cf9bfb).

Impacted file tree graph

@@                Coverage Diff                @@
##           release-v2.18    #4620      +/-   ##
=================================================
- Coverage          60.54%   60.51%   -0.03%     
=================================================
  Files                189      189              
  Lines              21297    21307      +10     
=================================================
  Hits               12894    12894              
- Misses              8403     8413      +10     
Files Coverage Δ
Sources/MapboxNavigation/CarPlayManager.swift 44.21% <0.00%> (-0.14%) ⬇️
...tion/CarPlayNavigationViewControllerDelegate.swift 0.00% <0.00%> (ø)
...rces/MapboxNavigation/CarPlayManagerDelegate.swift 2.91% <0.00%> (-0.16%) ⬇️
...oxNavigation/CarPlayNavigationViewController.swift 14.40% <0.00%> (+0.05%) ⬆️

primaryManeuver.symbolSet = visualInstruction.primaryInstruction.maneuverImageSet(side: visualInstruction.drivingSide)
}

primaryManeuver.symbolSet = visualInstruction.primaryInstruction.maneuverImageSet(side: visualInstruction.drivingSide)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for history, some info on why we made this change.

From Apple CarPlay development guide:

If the maneuver has an associated symbol, such as a turn right arrow, provide an image
using symbolSet. [...] You must provide two image variants using CPImageSet—one is used for rendering
the symbol on light backgrounds, the other is used for rendering the symbol on dark backgrounds.

Since we don't know which custom background color a developer might provide, we always use symbolSet to pass both white and dark symbols for maneuvers, CarPlay will choose a better version on its own.

@mapbox-github-ci-issues-public-1

API compatibility report for MapboxNavigation: 🔴

Protocol Requirement Change

  • Func CarPlayManagerDelegate.carPlayNavigationViewController(_:guidanceBackgroundColorFor:) has been added as a protocol requirement
  • Func CarPlayNavigationViewControllerDelegate.carPlayNavigationViewController(_:guidanceBackgroundColorFor:) has been added as a protocol requirement

@chizhavko chizhavko merged commit ae3ef18 into release-v2.18 Apr 3, 2024
19 checks passed
@chizhavko chizhavko deleted the new-carplay-change-background-color-logic branch April 3, 2024 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants