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

[ios] InstructionView secondary row uses theme bg color #259

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion apple/Sources/FerrostarSwiftUI/Views/InstructionsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public struct InstructionsView: View {
// TODO: Show the pill when interactivity is enabled
pillControl(isActive: showPillControl)
}
.background(.gray.opacity(0.2))
.background(secondaryRowTheme.backgroundColor)
} else {
// TODO: Show the pill when interactivity is enabled
pillControl(isActive: showPillControl)
Expand Down Expand Up @@ -144,6 +144,25 @@ public struct InstructionsView: View {
showPillControl: true
)

InstructionsView(
visualInstruction: VisualInstruction(
primaryContent: VisualInstructionContent(
text: "Turn right on Something Dr.",
maneuverType: .turn,
maneuverModifier: .right,
roundaboutExitDegrees: nil
),
secondaryContent: VisualInstructionContent(
text: "Merge onto Hwy 123",
maneuverType: .merge,
maneuverModifier: .right,
roundaboutExitDegrees: nil
),
triggerDistanceBeforeManeuver: 123
),
showPillControl: true
)

Spacer()
}
.padding()
Expand Down
38 changes: 27 additions & 11 deletions apple/Tests/FerrostarSwiftUITests/Views/InstructionsViewTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,31 @@ final class InstructionsViewTests: XCTestCase {
),
triggerDistanceBeforeManeuver: 123
),
distanceFormatter: americanDistanceFormatter,
primaryRowTheme: TestingInstructionRowTheme(),
secondaryRowTheme: TestingInstructionRowTheme()
distanceFormatter: americanDistanceFormatter
)
.padding()
}
}

func testInstructionsView_darkMode() {
assertView(colorScheme: .dark) {
InstructionsView(
visualInstruction: VisualInstruction(
primaryContent: VisualInstructionContent(
text: "Turn right on Something Dr.",
maneuverType: .turn,
maneuverModifier: .right,
roundaboutExitDegrees: nil
),
secondaryContent: VisualInstructionContent(
text: "Merge onto Hwy 123",
maneuverType: .merge,
maneuverModifier: .right,
roundaboutExitDegrees: nil
),
triggerDistanceBeforeManeuver: 123
),
distanceFormatter: americanDistanceFormatter
)
.padding()
}
Expand All @@ -42,9 +64,7 @@ final class InstructionsViewTests: XCTestCase {
secondaryContent: nil,
triggerDistanceBeforeManeuver: 123
),
distanceFormatter: americanDistanceFormatter,
primaryRowTheme: TestingInstructionRowTheme(),
secondaryRowTheme: TestingInstructionRowTheme()
distanceFormatter: americanDistanceFormatter
)
.padding()
}
Expand All @@ -64,8 +84,6 @@ final class InstructionsViewTests: XCTestCase {
triggerDistanceBeforeManeuver: 123
),
distanceFormatter: americanDistanceFormatter,
primaryRowTheme: TestingInstructionRowTheme(),
secondaryRowTheme: TestingInstructionRowTheme(),
showPillControl: true
)
.padding()
Expand All @@ -86,9 +104,7 @@ final class InstructionsViewTests: XCTestCase {
triggerDistanceBeforeManeuver: 123
),
distanceFormatter: germanDistanceFormatter,
distanceToNextManeuver: 152.4,
primaryRowTheme: TestingInstructionRowTheme(),
secondaryRowTheme: TestingInstructionRowTheme()
distanceToNextManeuver: 152.4
)
.padding()
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading