diff --git a/apple/DemoApp/Demo/DemoNavigationView.swift b/apple/DemoApp/Demo/DemoNavigationView.swift index 437d971b..fa0e62e6 100644 --- a/apple/DemoApp/Demo/DemoNavigationView.swift +++ b/apple/DemoApp/Demo/DemoNavigationView.swift @@ -128,6 +128,8 @@ struct DemoNavigationView: View { } } label: { Text("Start Nav") + .lineLimit(1) + .minimumScaleFactor(0.5) .font(.body.bold()) } .disabled(routes?.isEmpty == true) diff --git a/apple/Sources/FerrostarCore/Extensions/RouteExtensions.swift b/apple/Sources/FerrostarCore/Extensions/RouteExtensions.swift index 5ab9daf5..559c39a1 100644 --- a/apple/Sources/FerrostarCore/Extensions/RouteExtensions.swift +++ b/apple/Sources/FerrostarCore/Extensions/RouteExtensions.swift @@ -10,7 +10,7 @@ public extension Route { /// - Parameters: /// - route: The encoded JSON data for the OSRM route. /// - waypoints: The encoded JSON data for the OSRM waypoints. - /// - precision: The polyline precision. + /// - polylinePrecision: The polyline precision. static func initFromOsrm(route: Data, waypoints: Data, polylinePrecision: UInt32) throws -> Route { try createRouteFromOsrm(routeData: route, waypointData: waypoints, polylinePrecision: polylinePrecision) } diff --git a/apple/Sources/FerrostarCore/FerrostarCore.swift b/apple/Sources/FerrostarCore/FerrostarCore.swift index 766be0b5..4ccd9f69 100644 --- a/apple/Sources/FerrostarCore/FerrostarCore.swift +++ b/apple/Sources/FerrostarCore/FerrostarCore.swift @@ -57,7 +57,7 @@ public protocol FerrostarCoreDelegate: AnyObject { /// /// The usual flow is for callers to configure an instance of the core, set a ``delegate``, /// and reuse the instance for as long as it makes sense (necessarily somewhat app-specific). -/// You can first call ``getRoutes(waypoints:userLocation:)`` +/// You can first call ``getRoutes(initialLocation:waypoints:)`` /// to fetch a list of possible routes asynchronously. After selecting a suitable route (either interactively by the /// user, or programmatically), call ``startNavigation(route:config:)`` to start a session. /// diff --git a/apple/Sources/FerrostarCore/URLRequestLoading.swift b/apple/Sources/FerrostarCore/URLRequestLoading.swift index 2f468c7b..491ac767 100644 --- a/apple/Sources/FerrostarCore/URLRequestLoading.swift +++ b/apple/Sources/FerrostarCore/URLRequestLoading.swift @@ -24,7 +24,7 @@ enum MockURLSessionError: Error { /// Mocks network responses by URL. Super quick-and-dirty for testing with mocks. /// /// By default, it will return an error for all requests. Register a mock by URL with -/// ``registerMock(forURL:withData:andResponse:)`` +/// ``registerMock(forMethod:andURL:withData:andResponse:)``. public class MockURLSession: URLRequestLoading { private var urlResponseMap = [String: [URL: (Data, URLResponse)]]() diff --git a/apple/Sources/FerrostarMapLibreUI/Extensions/View.swift b/apple/Sources/FerrostarMapLibreUI/Extensions/View.swift new file mode 100644 index 00000000..6f9dc0c0 --- /dev/null +++ b/apple/Sources/FerrostarMapLibreUI/Extensions/View.swift @@ -0,0 +1,73 @@ +import SwiftUI + +extension View { + /// Given the view's `geometry`, synchronizes `childInsets`, such that + /// accumulating the child's insets with the parents insets, will be at least `minimumInset`. + /// + /// ``` + /// Given a minimumInset of 16: + /// +-------------------------------------------------------------+ + /// | `parentGeometry` | + /// | +-----------------------------------------------------+ | + /// | | `parentGeometry.safeAreaInsets` (Top: 16) | | + /// | | +---------------------------------------------+ | | + /// | | | insets added by this method (Top: 0) | | | + /// | | | +------------------------------------+ | | | + /// | | | | | | | | + /// | | 8 | 8 | child view (self) | 16 | 0 | | + /// | | | | | | | | + /// | | | +------------------------------------+ | | | + /// | | | insets added by this method (Bottom: 0) | | | + /// | | +---------------------------------------------+ | | + /// | | `parentGeometry.safeAreaInsets` (Bottom: 20) | | + /// | +-----------------------------------------------------+ | + /// | | + /// +-------------------------------------------------------------+ + /// ``` + func complementSafeAreaInsets( + parentGeometry: GeometryProxy, + minimumInset: EdgeInsets = EdgeInsets(top: 16, leading: 16, bottom: 16, trailing: 16) + ) -> some View { + ComplementingSafeAreaView(content: self, parentGeometry: parentGeometry, minimumInset: minimumInset) + } + + /// Do something reasonable-ish for clients that don't yet support + /// safeAreaPadding - in this case, fall back to regular padding. + func safeAreaPaddingPolyfill(_ insets: EdgeInsets) -> AnyView { + if #available(iOS 17.0, *) { + AnyView(self.safeAreaPadding(insets)) + } else { + AnyView(padding(insets)) + } + } +} + +struct ComplementingSafeAreaView: View { + var content: V + + var parentGeometry: GeometryProxy + var minimumInset: EdgeInsets + + @State + var childInsets: EdgeInsets = .init() + + static func complement(parentInset: EdgeInsets, minimumInset: EdgeInsets) -> EdgeInsets { + var innerInsets = parentInset + innerInsets.top = max(0, minimumInset.top - parentInset.top) + innerInsets.bottom = max(0, minimumInset.bottom - parentInset.bottom) + innerInsets.leading = max(0, minimumInset.leading - parentInset.leading) + innerInsets.trailing = max(0, minimumInset.trailing - parentInset.trailing) + return innerInsets + } + + var body: some View { + content.onAppear { + childInsets = ComplementingSafeAreaView.complement( + parentInset: parentGeometry.safeAreaInsets, + minimumInset: minimumInset + ) + }.onChange(of: parentGeometry.safeAreaInsets) { newValue in + childInsets = ComplementingSafeAreaView.complement(parentInset: newValue, minimumInset: minimumInset) + }.safeAreaPaddingPolyfill(childInsets) + } +} diff --git a/apple/Sources/FerrostarMapLibreUI/Models/NavigationMapViewContentInsetMode.swift b/apple/Sources/FerrostarMapLibreUI/Models/NavigationMapViewContentInsetMode.swift index eba6104e..b71678b7 100644 --- a/apple/Sources/FerrostarMapLibreUI/Models/NavigationMapViewContentInsetMode.swift +++ b/apple/Sources/FerrostarMapLibreUI/Models/NavigationMapViewContentInsetMode.swift @@ -2,19 +2,32 @@ import SwiftUI import UIKit public enum NavigationMapViewContentInsetMode { - /// A predefined mode for landscape navigation map views - /// where the user location should appear toward the bottom of the map. + /// Dynamically determined insets suitable for landscape orientation, + /// where the user location indicator should appear toward the bottom right of the screen. /// - /// This is used to accommodate a left InstructionView + /// This mode is used to accommodate an InstructionView in a separate column, left of the content area. + /// + /// - Parameter within : The `MapView`'s geometry + /// - Parameter verticalPct : How far "down" to inset the MapView overlay content. A higher number positions content + /// lower. + /// - Parameter horizontalPct : How far "right" to inset the MapView overlay content. A higher number positions + /// content farther right. case landscape(within: GeometryProxy, verticalPct: CGFloat = 0.75, horizontalPct: CGFloat = 0.5) - /// A predefined mode for landscape navigation map views - /// where the user location should appear toward the bottom of the map. + /// Dynamically determined insets suitable for portrait orientation, + /// where the user location indicator should appear toward the bottom of the screen. + /// + /// This mode is used to accommodate an InstructionView at the top of the MapView, in a single column with the + /// content area. /// - /// This is used to accommodate a top InstructionView - case portrait(within: GeometryProxy, verticalPct: CGFloat = 0.75) + /// - Parameter within : The `MapView`'s geometry + /// - Parameter verticalPct : How far "down" to inset the MapView overlay content. A higher number positions content + /// lower. + /// - Parameter minHeight : The minimum height (in points) of the content area. The content area could be larger + /// than this on sufficiently tall screens depending on `verticalPct`. + case portrait(within: GeometryProxy, verticalPct: CGFloat = 0.75, minHeight: CGFloat = 210) - /// Custom edge insets to manually control where the center of the map is. + /// Static edge insets to manually control where the center of the map is. case edgeInset(UIEdgeInsets) public init(orientation: UIDeviceOrientation, geometry: GeometryProxy) { @@ -33,8 +46,10 @@ public enum NavigationMapViewContentInsetMode { let leading = geometry.size.width * horizontalPct return UIEdgeInsets(top: top, left: leading, bottom: 0, right: 0) - case let .portrait(geometry, verticalPct): - let top = geometry.size.height * verticalPct + case let .portrait(geometry, verticalPct, minVertical): + let ideal = geometry.size.height * verticalPct + let max = geometry.size.height - minVertical + let top = min(max, ideal) return UIEdgeInsets(top: top, left: 0, bottom: 0, right: 0) case let .edgeInset(uIEdgeInsets): diff --git a/apple/Sources/FerrostarMapLibreUI/Views/DynamicallyOrientingNavigationView.swift b/apple/Sources/FerrostarMapLibreUI/Views/DynamicallyOrientingNavigationView.swift index 75ddf6ba..ac7c28ee 100644 --- a/apple/Sources/FerrostarMapLibreUI/Views/DynamicallyOrientingNavigationView.swift +++ b/apple/Sources/FerrostarMapLibreUI/Views/DynamicallyOrientingNavigationView.swift @@ -26,6 +26,8 @@ public struct DynamicallyOrientingNavigationView: View, CustomizableNavigatingIn var onTapExit: (() -> Void)? + public var minimumSafeAreaInsets: EdgeInsets + /// Create a dynamically orienting navigation view. This view automatically arranges child views for both portait /// and landscape orientations. /// @@ -34,7 +36,8 @@ public struct DynamicallyOrientingNavigationView: View, CustomizableNavigatingIn /// - camera: The camera binding that represents the current camera on the map. /// - navigationCamera: The default navigation camera. This sets the initial camera & is also used when the center /// on user button it tapped. - /// - navigationState: The current ferrostar navigation state provided by ferrostar core. + /// - navigationState: The current ferrostar navigation state provided by the Ferrostar core. + /// - minimumSafeAreaInsets: The minimum padding to apply from safe edges. See `complementSafeAreaInsets`. /// - onTapExit: An optional behavior to run when the ArrivalView exit button is tapped. When nil (default) the /// exit button is hidden. /// - makeMapContent: Custom maplibre symbols to display on the map view. @@ -43,11 +46,13 @@ public struct DynamicallyOrientingNavigationView: View, CustomizableNavigatingIn camera: Binding, navigationCamera: MapViewCamera = .automotiveNavigation(), navigationState: NavigationState?, + minimumSafeAreaInsets: EdgeInsets = EdgeInsets(top: 16, leading: 16, bottom: 16, trailing: 16), onTapExit: (() -> Void)? = nil, @MapViewContentBuilder makeMapContent: () -> [StyleLayerDefinition] = { [] } ) { self.styleURL = styleURL self.navigationState = navigationState + self.minimumSafeAreaInsets = minimumSafeAreaInsets self.onTapExit = onTapExit userLayers = makeMapContent() @@ -94,7 +99,7 @@ public struct DynamicallyOrientingNavigationView: View, CustomizableNavigatingIn midLeading?() } bottomTrailing: { bottomTrailing?() - } + }.complementSafeAreaInsets(parentGeometry: geometry, minimumInset: minimumSafeAreaInsets) default: PortraitNavigationOverlayView( navigationState: navigationState, @@ -114,7 +119,7 @@ public struct DynamicallyOrientingNavigationView: View, CustomizableNavigatingIn midLeading?() } bottomTrailing: { bottomTrailing?() - } + }.complementSafeAreaInsets(parentGeometry: geometry, minimumInset: minimumSafeAreaInsets) } } } diff --git a/apple/Sources/FerrostarMapLibreUI/Views/LandscapeNavigationView.swift b/apple/Sources/FerrostarMapLibreUI/Views/LandscapeNavigationView.swift index f929c1df..302c3159 100644 --- a/apple/Sources/FerrostarMapLibreUI/Views/LandscapeNavigationView.swift +++ b/apple/Sources/FerrostarMapLibreUI/Views/LandscapeNavigationView.swift @@ -8,7 +8,7 @@ import SwiftUI /// A landscape orientation navigation view that includes the InstructionsView and ArrivalView on the /// leading half of the screen. -public struct LandscapeNavigationView: View { +public struct LandscapeNavigationView: View, CustomizableNavigatingInnerGridView { @Environment(\.navigationFormatterCollection) var formatterCollection: any FormatterCollection let styleURL: URL @@ -25,6 +25,8 @@ public struct LandscapeNavigationView: View { var onTapExit: (() -> Void)? + public var minimumSafeAreaInsets: EdgeInsets + /// Create a landscape navigation view. This view is optimized for display on a landscape screen where the /// instructions are on the leading half of the screen /// and the user puck and route are on the trailing half of the screen. @@ -34,7 +36,8 @@ public struct LandscapeNavigationView: View { /// - camera: The camera binding that represents the current camera on the map. /// - navigationCamera: The default navigation camera. This sets the initial camera & is also used when the center /// on user button it tapped. - /// - navigationState: The current ferrostar navigation state provided by ferrostar core. + /// - navigationState: The current ferrostar navigation state provided by the Ferrostar core. + /// - minimumSafeAreaInsets: The minimum padding to apply from safe edges. See `complementSafeAreaInsets`. /// - onTapExit: An optional behavior to run when the ArrivalView exit button is tapped. When nil (default) the /// exit button is hidden. /// - makeMapContent: Custom maplibre symbols to display on the map view. @@ -43,11 +46,13 @@ public struct LandscapeNavigationView: View { camera: Binding, navigationCamera: MapViewCamera = .automotiveNavigation(), navigationState: NavigationState?, + minimumSafeAreaInsets: EdgeInsets = EdgeInsets(top: 16, leading: 16, bottom: 16, trailing: 16), onTapExit: (() -> Void)? = nil, @MapViewContentBuilder makeMapContent: () -> [StyleLayerDefinition] = { [] } ) { self.styleURL = styleURL self.navigationState = navigationState + self.minimumSafeAreaInsets = minimumSafeAreaInsets self.onTapExit = onTapExit userLayers = makeMapContent() @@ -88,7 +93,7 @@ public struct LandscapeNavigationView: View { midLeading?() } bottomTrailing: { bottomTrailing?() - } + }.complementSafeAreaInsets(parentGeometry: geometry, minimumInset: minimumSafeAreaInsets) } } } diff --git a/apple/Sources/FerrostarMapLibreUI/Views/NavigationMapViewModifiers.swift b/apple/Sources/FerrostarMapLibreUI/Views/NavigationMapViewModifiers.swift index 0a92f51a..75acb64e 100644 --- a/apple/Sources/FerrostarMapLibreUI/Views/NavigationMapViewModifiers.swift +++ b/apple/Sources/FerrostarMapLibreUI/Views/NavigationMapViewModifiers.swift @@ -2,9 +2,9 @@ import Foundation import SwiftUI public extension NavigationMapView { - /// Set the MapView's content inset to a dynamically controlled navigation setting. + /// Set the MapView's content inset. See ``NavigationMapViewContentInsetMode`` for static and dynamic options. /// - /// This functionality is used to appropriate space the navigation puck/user location in the map view. + /// This functionality is used to position the navigation puck/user location in the map view /// /// - Parameter inset: The inset mode for the navigation map view /// - Returns: The modified NavigationMapView diff --git a/apple/Sources/FerrostarMapLibreUI/Views/Overylays/LandscapeNavigationOverlayView.swift b/apple/Sources/FerrostarMapLibreUI/Views/Overylays/LandscapeNavigationOverlayView.swift index e85e41fc..6db87460 100644 --- a/apple/Sources/FerrostarMapLibreUI/Views/Overylays/LandscapeNavigationOverlayView.swift +++ b/apple/Sources/FerrostarMapLibreUI/Views/Overylays/LandscapeNavigationOverlayView.swift @@ -56,7 +56,6 @@ struct LandscapeNavigationOverlayView: View, CustomizableNavigatingInnerGridView distanceFormatter: formatterCollection.distanceFormatter, distanceToNextManeuver: progress.distanceToNextManeuver ) - .padding(.top, 16) } Spacer() diff --git a/apple/Sources/FerrostarMapLibreUI/Views/Overylays/PortraitNavigationOverlayView.swift b/apple/Sources/FerrostarMapLibreUI/Views/Overylays/PortraitNavigationOverlayView.swift index cfecd6f3..d4c69920 100644 --- a/apple/Sources/FerrostarMapLibreUI/Views/Overylays/PortraitNavigationOverlayView.swift +++ b/apple/Sources/FerrostarMapLibreUI/Views/Overylays/PortraitNavigationOverlayView.swift @@ -55,7 +55,6 @@ struct PortraitNavigationOverlayView: View, CustomizableNavigatingInnerGridView distanceFormatter: formatterCollection.distanceFormatter, distanceToNextManeuver: progress.distanceToNextManeuver ) - .padding(.horizontal, 16) } // The inner content is displayed vertically full screen @@ -79,14 +78,12 @@ struct PortraitNavigationOverlayView: View, CustomizableNavigatingInnerGridView } bottomTrailing: { bottomTrailing?() } - .padding(.horizontal, 16) if case let .navigating(_, _, _, _, progress: progress, _, _, _) = navigationState?.tripState { ArrivalView( progress: progress, onTapExit: onTapExit ) - .padding(.horizontal, 16) } } } diff --git a/apple/Sources/FerrostarMapLibreUI/Views/PortraitNavigationView.swift b/apple/Sources/FerrostarMapLibreUI/Views/PortraitNavigationView.swift index 1b6a29af..a74dbdf6 100644 --- a/apple/Sources/FerrostarMapLibreUI/Views/PortraitNavigationView.swift +++ b/apple/Sources/FerrostarMapLibreUI/Views/PortraitNavigationView.swift @@ -21,6 +21,8 @@ public struct PortraitNavigationView: View, CustomizableNavigatingInnerGridView public var midLeading: (() -> AnyView)? public var bottomTrailing: (() -> AnyView)? + public var minimumSafeAreaInsets: EdgeInsets + @Binding var camera: MapViewCamera let navigationCamera: MapViewCamera @@ -35,7 +37,8 @@ public struct PortraitNavigationView: View, CustomizableNavigatingInnerGridView /// - camera: The camera binding that represents the current camera on the map. /// - navigationCamera: The default navigation camera. This sets the initial camera & is also used when the center /// on user button it tapped. - /// - navigationState: The current ferrostar navigation state provided by ferrostar core. + /// - navigationState: The current ferrostar navigation state provided by the Ferrostar core. + /// - minimumSafeAreaInsets: The minimum padding to apply from safe edges. See `complementSafeAreaInsets`. /// - onTapExit: An optional behavior to run when the ArrivalView exit button is tapped. When nil (default) the /// exit button is hidden. /// - makeMapContent: Custom maplibre symbols to display on the map view. @@ -44,11 +47,13 @@ public struct PortraitNavigationView: View, CustomizableNavigatingInnerGridView camera: Binding, navigationCamera: MapViewCamera = .automotiveNavigation(), navigationState: NavigationState?, + minimumSafeAreaInsets: EdgeInsets = EdgeInsets(top: 16, leading: 16, bottom: 16, trailing: 16), onTapExit: (() -> Void)? = nil, @MapViewContentBuilder makeMapContent: () -> [StyleLayerDefinition] = { [] } ) { self.styleURL = styleURL self.navigationState = navigationState + self.minimumSafeAreaInsets = minimumSafeAreaInsets self.onTapExit = onTapExit userLayers = makeMapContent() @@ -90,7 +95,7 @@ public struct PortraitNavigationView: View, CustomizableNavigatingInnerGridView midLeading?() } bottomTrailing: { bottomTrailing?() - } + }.complementSafeAreaInsets(parentGeometry: geometry, minimumInset: minimumSafeAreaInsets) } } } diff --git a/apple/Sources/FerrostarSwiftUI/Views/ArrivalView.swift b/apple/Sources/FerrostarSwiftUI/Views/ArrivalView.swift index 4ae28df5..009f3990 100644 --- a/apple/Sources/FerrostarSwiftUI/Views/ArrivalView.swift +++ b/apple/Sources/FerrostarSwiftUI/Views/ArrivalView.swift @@ -108,7 +108,7 @@ public struct ArrivalView: View { } .padding(.leading, 32) .padding(.trailing, 12) - .padding(.vertical, 16) + .padding(.vertical, 8) .background(theme.backgroundColor) .clipShape(.rect(cornerRadius: 48)) .shadow(radius: 12) diff --git a/apple/Sources/FerrostarSwiftUI/Views/Controls/NavigationUIBanner.swift b/apple/Sources/FerrostarSwiftUI/Views/Controls/NavigationUIBanner.swift index ee5e91b2..b10f100d 100644 --- a/apple/Sources/FerrostarSwiftUI/Views/Controls/NavigationUIBanner.swift +++ b/apple/Sources/FerrostarSwiftUI/Views/Controls/NavigationUIBanner.swift @@ -12,7 +12,7 @@ public struct NavigationUIBanner: View { /// The basic Ferrostar SwiftUI button style. /// /// - Parameters: - /// - action: The action the button performs on tap. + /// - severity: The severity of the banner. /// - backgroundColor: The capsule's background color. /// - label: The label subview. public init( diff --git a/apple/Sources/FerrostarSwiftUI/Views/GridViews/NavigatingInnerGridView.swift b/apple/Sources/FerrostarSwiftUI/Views/GridViews/NavigatingInnerGridView.swift index 48200dcc..0712db7e 100644 --- a/apple/Sources/FerrostarSwiftUI/Views/GridViews/NavigatingInnerGridView.swift +++ b/apple/Sources/FerrostarSwiftUI/Views/GridViews/NavigatingInnerGridView.swift @@ -29,17 +29,14 @@ public struct NavigatingInnerGridView: View, CustomizableNavigatingInnerGridView /// On landscape mode it is the trailing half of the screen. /// /// - Parameters: - /// - theme: The ferrostar theme is used to control the default styling and formatters /// - speedLimit: The speed limit provided by the navigation state (or nil) - /// - showZoom: Whether to show the zoom control or not. This is typically yes. + /// - showZoom: Whether to show the provided zoom control or not. /// - onZoomIn: The on zoom in tapped action. This should be used to zoom the user in one increment. /// - onZoomOut: The on zoom out tapped action. This should be used to zoom the user out one increment. /// - showCentering: Whether to show the centering control. This is typically determined by the Map's centering /// state. - /// - onTapCenter: The action that occurs when the user taps the centering control. Typically re-centering the - /// user. - /// - topCenter: The customizable top center view. This is recommended for navigation alerts (e.g. toast style - /// notices). + /// - onCenter: The action that occurs when the user taps the centering control (to re-center the + /// map on the user). public init( speedLimit: Measurement? = nil, showZoom: Bool = false, diff --git a/apple/Sources/FerrostarSwiftUI/Views/InstructionsView.swift b/apple/Sources/FerrostarSwiftUI/Views/InstructionsView.swift index 54002f1e..ec66b809 100644 --- a/apple/Sources/FerrostarSwiftUI/Views/InstructionsView.swift +++ b/apple/Sources/FerrostarSwiftUI/Views/InstructionsView.swift @@ -22,9 +22,11 @@ public struct InstructionsView: View { /// /// - Parameters: /// - visualInstruction: The visual instruction to display. + /// - distanceFormatter: The formatter which controls distance localization. /// - distanceToNextManeuver: The distance remaining for the step. /// - primaryRowTheme: The theme for the primary instruction. /// - secondaryRowTheme: The theme for the secondary instruction. + /// - showPillControl: If true, shows a pill control (to indicate an action/expansion). public init( visualInstruction: VisualInstruction, distanceFormatter: Formatter = DefaultFormatters.distanceFormatter, diff --git a/apple/Sources/FerrostarSwiftUI/Views/Maneuver/DefaultIconographyManeuverInstructionView.swift b/apple/Sources/FerrostarSwiftUI/Views/Maneuver/DefaultIconographyManeuverInstructionView.swift index fa322aa6..6593743d 100644 --- a/apple/Sources/FerrostarSwiftUI/Views/Maneuver/DefaultIconographyManeuverInstructionView.swift +++ b/apple/Sources/FerrostarSwiftUI/Views/Maneuver/DefaultIconographyManeuverInstructionView.swift @@ -22,6 +22,7 @@ public struct DefaultIconographyManeuverInstructionView: View { /// - text: The maneuver instruction. /// - maneuverType: The maneuver type defines the behavior. /// - maneuverModifier: The maneuver modifier defines the direction. + /// - distanceFormatter: The formatter which controls distance localization. /// - distanceToNextManeuver: A string that should represent the localized distance remaining. /// - theme: The instruction row theme specifies attributes like colors and fonts for the row. public init( diff --git a/apple/Sources/FerrostarSwiftUI/Views/Maneuver/ManeuverInstructionView.swift b/apple/Sources/FerrostarSwiftUI/Views/Maneuver/ManeuverInstructionView.swift index 4c268583..69c541cf 100644 --- a/apple/Sources/FerrostarSwiftUI/Views/Maneuver/ManeuverInstructionView.swift +++ b/apple/Sources/FerrostarSwiftUI/Views/Maneuver/ManeuverInstructionView.swift @@ -24,6 +24,7 @@ public struct ManeuverInstructionView: View { /// - text: The maneuver instruction. /// - distanceToNextManeuver: The distance to the next step. /// - maneuverView: The custom view representing the maneuver. + /// - distanceFormatter: The formatter which controls distance localization. /// - theme: The instruction row theme specifies attributes like colors and fonts for the row. public init( text: String, diff --git a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewCompactTheme.1.png b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewCompactTheme.1.png index d7501fe4..a4777ce8 100644 Binary files a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewCompactTheme.1.png and b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewCompactTheme.1.png differ diff --git a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewCompactTheme_darkMode.1.png b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewCompactTheme_darkMode.1.png index 158da02e..43b3ad3f 100644 Binary files a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewCompactTheme_darkMode.1.png and b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewCompactTheme_darkMode.1.png differ diff --git a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewDefaultTheme.1.png b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewDefaultTheme.1.png index 8eda4a9b..d6b73f01 100644 Binary files a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewDefaultTheme.1.png and b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewDefaultTheme.1.png differ diff --git a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewDefaultTheme.2.png b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewDefaultTheme.2.png index 065961b0..ee64bc04 100644 Binary files a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewDefaultTheme.2.png and b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewDefaultTheme.2.png differ diff --git a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewDefaultTheme_darkMode.1.png b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewDefaultTheme_darkMode.1.png index 7ea57474..1e1f68bd 100644 Binary files a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewDefaultTheme_darkMode.1.png and b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewDefaultTheme_darkMode.1.png differ diff --git a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewDefaultTheme_darkMode.2.png b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewDefaultTheme_darkMode.2.png index 258a1325..f0bd93fa 100644 Binary files a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewDefaultTheme_darkMode.2.png and b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewDefaultTheme_darkMode.2.png differ diff --git a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewFormatters.1.png b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewFormatters.1.png index c105e8cb..c90c9808 100644 Binary files a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewFormatters.1.png and b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewFormatters.1.png differ diff --git a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewFormatters_darkMode.1.png b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewFormatters_darkMode.1.png index f3ad97db..c04de7be 100644 Binary files a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewFormatters_darkMode.1.png and b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewFormatters_darkMode.1.png differ diff --git a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewFormatters_de_DE.1.png b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewFormatters_de_DE.1.png index a67ea024..5792ab05 100644 Binary files a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewFormatters_de_DE.1.png and b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewFormatters_de_DE.1.png differ diff --git a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewFormatters_de_DE.2.png b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewFormatters_de_DE.2.png index e3d5dc37..6a467443 100644 Binary files a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewFormatters_de_DE.2.png and b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewFormatters_de_DE.2.png differ diff --git a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewFormatters_de_DE_darkMode.1.png b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewFormatters_de_DE_darkMode.1.png index 1d578828..79f874d7 100644 Binary files a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewFormatters_de_DE_darkMode.1.png and b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewFormatters_de_DE_darkMode.1.png differ diff --git a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewFormatters_de_DE_darkMode.2.png b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewFormatters_de_DE_darkMode.2.png index 9c153122..78c5daaf 100644 Binary files a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewFormatters_de_DE_darkMode.2.png and b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewFormatters_de_DE_darkMode.2.png differ diff --git a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewCompactTheme.1.png b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewCompactTheme.1.png index ceba34c4..40828204 100644 Binary files a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewCompactTheme.1.png and b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewCompactTheme.1.png differ diff --git a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewCompactTheme_darkMode.1.png b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewCompactTheme_darkMode.1.png index f729e419..18a8c889 100644 Binary files a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewCompactTheme_darkMode.1.png and b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewCompactTheme_darkMode.1.png differ diff --git a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewDefaultTheme.1.png b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewDefaultTheme.1.png index f93b21f1..fe741353 100644 Binary files a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewDefaultTheme.1.png and b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewDefaultTheme.1.png differ diff --git a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewDefaultTheme.2.png b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewDefaultTheme.2.png index f820a2fc..14d3ef1d 100644 Binary files a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewDefaultTheme.2.png and b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewDefaultTheme.2.png differ diff --git a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewDefaultTheme_darkMode.1.png b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewDefaultTheme_darkMode.1.png index 2fc24cb4..c7fadac2 100644 Binary files a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewDefaultTheme_darkMode.1.png and b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewDefaultTheme_darkMode.1.png differ diff --git a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewDefaultTheme_darkMode.2.png b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewDefaultTheme_darkMode.2.png index adffb87c..ca29158f 100644 Binary files a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewDefaultTheme_darkMode.2.png and b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewDefaultTheme_darkMode.2.png differ diff --git a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewFormatters.1.png b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewFormatters.1.png index 66d4eadd..4f1867f3 100644 Binary files a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewFormatters.1.png and b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewFormatters.1.png differ diff --git a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewFormatters_darkMode.1.png b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewFormatters_darkMode.1.png index fd63df7d..840d4bf4 100644 Binary files a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewFormatters_darkMode.1.png and b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewFormatters_darkMode.1.png differ diff --git a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewFormatters_de_DE.1.png b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewFormatters_de_DE.1.png index 52efdfca..895eefc9 100644 Binary files a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewFormatters_de_DE.1.png and b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewFormatters_de_DE.1.png differ diff --git a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewFormatters_de_DE.2.png b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewFormatters_de_DE.2.png index f9de75b2..3a13b472 100644 Binary files a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewFormatters_de_DE.2.png and b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewFormatters_de_DE.2.png differ diff --git a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewFormatters_de_DE_darkMode.1.png b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewFormatters_de_DE_darkMode.1.png index 7a916874..932f27ef 100644 Binary files a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewFormatters_de_DE_darkMode.1.png and b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewFormatters_de_DE_darkMode.1.png differ diff --git a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewFormatters_de_DE_darkMode.2.png b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewFormatters_de_DE_darkMode.2.png index b65ad7f9..8eabd4e2 100644 Binary files a/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewFormatters_de_DE_darkMode.2.png and b/apple/Tests/FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewWithButtonTests/testArrivalViewFormatters_de_DE_darkMode.2.png differ