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

Support for visual sub-maneuvers #303

Merged
merged 13 commits into from
Oct 22, 2024
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if useLocalFramework {
path: "./common/target/ios/libferrostar-rs.xcframework"
)
} else {
let releaseTag = "0.18.0"
let releaseTag = "0.19.0"
let releaseChecksum = "c23dd4145abb11c97b8e26166999aa6b3b42b8f4b49ccf322764cf4a10cfc916"
binaryTarget = .binaryTarget(
name: "FerrostarCoreRS",
Expand Down
7 changes: 6 additions & 1 deletion _typos.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
[default]
extend-ignore-re = [
"VALHALLA_EXTENDED_OSRM_RESPONSE.*",
ianthetechie marked this conversation as resolved.
Show resolved Hide resolved
]

[default.extend-words]
rememberable = "rememberable"

[files]
extend-exclude = ["**/build/*", "*.pbxproj", "**/dist/*", "guide/**/*.js"]
extend-exclude = ["**/build/*", "*.pbxproj", "**/dist/*", "guide/**/*.js"]
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ plugins {

allprojects {
group = "com.stadiamaps.ferrostar"
version = "0.18.0"
version = "0.19.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ fun PreviewInstructionsView() {
text = "Hyde Street",
maneuverType = ManeuverType.TURN,
maneuverModifier = ManeuverModifier.LEFT,
roundaboutExitDegrees = null),
roundaboutExitDegrees = null,
laneInfo = null),
secondaryContent = null,
subContent = null,
triggerDistanceBeforeManeuver = 42.0)

InstructionsView(instructions = instructions, distanceToNextManeuver = 42.0)
Expand All @@ -85,8 +87,10 @@ fun PreviewRTLInstructionsView() {
text = "ادمج يسارًا",
maneuverType = ManeuverType.TURN,
maneuverModifier = ManeuverModifier.LEFT,
roundaboutExitDegrees = null),
roundaboutExitDegrees = null,
laneInfo = null),
secondaryContent = null,
subContent = null,
triggerDistanceBeforeManeuver = 42.0)

InstructionsView(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,6 @@ fun ManeuverImagePreview() {
text = "",
maneuverType = ManeuverType.TURN,
maneuverModifier = ManeuverModifier.LEFT,
roundaboutExitDegrees = null))
roundaboutExitDegrees = null,
laneInfo = null))
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ class InstructionViewTest {
text = "Hyde Street",
maneuverType = ManeuverType.TURN,
maneuverModifier = ManeuverModifier.LEFT,
roundaboutExitDegrees = null),
roundaboutExitDegrees = null,
laneInfo = null),
secondaryContent = null,
subContent = null,
triggerDistanceBeforeManeuver = 42.0)

paparazzi.snapshot {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ class ManeuverImageTest {
text = "",
maneuverType = ManeuverType.TURN,
maneuverModifier = ManeuverModifier.RIGHT,
roundaboutExitDegrees = null))
roundaboutExitDegrees = null,
laneInfo = null))
}
}

Expand All @@ -39,7 +40,8 @@ class ManeuverImageTest {
text = "",
maneuverType = ManeuverType.FORK,
maneuverModifier = ManeuverModifier.LEFT,
roundaboutExitDegrees = null))
roundaboutExitDegrees = null,
laneInfo = null))
}
}

Expand All @@ -51,7 +53,8 @@ class ManeuverImageTest {
text = "",
maneuverType = ManeuverType.FORK,
maneuverModifier = ManeuverModifier.LEFT,
roundaboutExitDegrees = null),
roundaboutExitDegrees = null,
laneInfo = null),
tint = Color.Magenta)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ class RTLInstructionViewTests {
text = "ادمج يسارًا",
maneuverType = ManeuverType.TURN,
maneuverModifier = ManeuverModifier.LEFT,
roundaboutExitDegrees = null),
roundaboutExitDegrees = null,
laneInfo = null),
secondaryContent = null,
subContent = null,
triggerDistanceBeforeManeuver = 42.0)

paparazzi.snapshot {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ class FerrostarCoreTest {
text = "Sail straight",
maneuverType = ManeuverType.DEPART,
maneuverModifier = ManeuverModifier.STRAIGHT,
roundaboutExitDegrees = null)
roundaboutExitDegrees = null,
laneInfo = null)
private val mockRoute =
Route(
geometry = mockGeom,
Expand All @@ -117,6 +118,7 @@ class FerrostarCoreTest {
VisualInstruction(
primaryContent = instructionContent,
secondaryContent = null,
subContent = null,
triggerDistanceBeforeManeuver = 42.0)),
spokenInstructions = listOf(),
duration = 0.0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ fun NavigationState.Companion.pedestrianExample(): NavigationState {
text = "Head east",
maneuverType = ManeuverType.TURN,
maneuverModifier = ManeuverModifier.RIGHT,
roundaboutExitDegrees = null),
roundaboutExitDegrees = null,
laneInfo = null),
secondaryContent = null,
subContent = null,
triggerDistanceBeforeManeuver = 0.0,
),
spokenInstruction = null,
Expand Down
7 changes: 5 additions & 2 deletions apple/Sources/FerrostarCore/Mock/MockNavigationState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,12 @@ public extension NavigationState {
text: "Hyde Street",
maneuverType: .turn,
maneuverModifier: .left,
roundaboutExitDegrees: nil
roundaboutExitDegrees: nil,
laneInfo: nil
),
secondaryContent: nil, triggerDistanceBeforeManeuver: 42.0
secondaryContent: nil,
subContent: nil,
triggerDistanceBeforeManeuver: 42.0
),
],
spokenInstructions: [],
Expand Down
4 changes: 3 additions & 1 deletion apple/Sources/FerrostarSwiftUI/TestFixtureFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ struct VisualInstructionContentFactory: TestFixtureFactory {
text: textBuilder(n),
maneuverType: .turn,
maneuverModifier: .left,
roundaboutExitDegrees: nil
roundaboutExitDegrees: nil,
laneInfo: nil
)
}
}
Expand All @@ -53,6 +54,7 @@ struct VisualInstructionFactory: TestFixtureFactory {
VisualInstruction(
primaryContent: primaryContentBuilder(n),
secondaryContent: secondaryContentBuilder(n),
subContent: nil,
triggerDistanceBeforeManeuver: 42.0
)
}
Expand Down
22 changes: 16 additions & 6 deletions apple/Sources/FerrostarSwiftUI/Views/InstructionsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,17 @@ public struct InstructionsView: View {
text: "Turn right on Something Dr.",
maneuverType: .turn,
maneuverModifier: .right,
roundaboutExitDegrees: nil
roundaboutExitDegrees: nil,
laneInfo: nil
),
secondaryContent: VisualInstructionContent(
text: "Merge onto Hwy 123",
maneuverType: .merge,
maneuverModifier: .right,
roundaboutExitDegrees: nil
roundaboutExitDegrees: nil,
laneInfo: nil
),
subContent: nil,
triggerDistanceBeforeManeuver: 123
)
)
Expand All @@ -174,9 +177,11 @@ public struct InstructionsView: View {
text: "Use the second exit to leave the roundabout.",
maneuverType: .rotary,
maneuverModifier: .slightRight,
roundaboutExitDegrees: nil
roundaboutExitDegrees: nil,
laneInfo: nil
),
secondaryContent: nil,
subContent: nil,
triggerDistanceBeforeManeuver: 123
)
)
Expand All @@ -187,9 +192,11 @@ public struct InstructionsView: View {
text: "Links einfädeln.",
maneuverType: .merge,
maneuverModifier: .slightLeft,
roundaboutExitDegrees: nil
roundaboutExitDegrees: nil,
laneInfo: nil
),
secondaryContent: nil,
subContent: nil,
triggerDistanceBeforeManeuver: 123
),
distanceFormatter: germanFormatter,
Expand All @@ -202,14 +209,17 @@ public struct InstructionsView: View {
text: "Turn right on Something Dr.",
maneuverType: .turn,
maneuverModifier: .right,
roundaboutExitDegrees: nil
roundaboutExitDegrees: nil,
laneInfo: nil
),
secondaryContent: VisualInstructionContent(
text: "Merge onto Hwy 123",
maneuverType: .merge,
maneuverModifier: .right,
roundaboutExitDegrees: nil
roundaboutExitDegrees: nil,
laneInfo: nil
),
subContent: nil,
triggerDistanceBeforeManeuver: 123
)
)
Expand Down
Loading
Loading