-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added speed limit provider & updated testing
- Loading branch information
Showing
21 changed files
with
148 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
apple/Sources/FerrostarSwiftUI/Library/SpeedLimitStyleProvider.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import Foundation | ||
|
||
/// Build a data provider that tells the UI whether to prefer a US style (MUTCD) or Vienna style speed limit sign. | ||
protocol SpeedLimitStyleProvider { | ||
func useUSStyle() -> Bool | ||
} | ||
|
||
// TODO: Create a location based Provider using: | ||
// MUTCD Signage Regions: https://en.wikipedia.org/wiki/Manual_on_Uniform_Traffic_Control_Devices | ||
// US, Canada, Mexico, Belize, Argentina, Bolivia, Brazil, Colombia, Equador, Guyana | ||
// Paraguay, Peru, Venezuela, Austrialia, Thailand. | ||
// Region Codes: https://en.wikipedia.org/wiki/IETF_language_tag | ||
|
||
/// Always prefer US Style (MUTCD) | ||
class SpeedLimitFixedToUSStyle: SpeedLimitStyleProvider { | ||
func useUSStyle() -> Bool { | ||
true | ||
} | ||
} | ||
|
||
/// Always prefer Vienna Style | ||
class SpeedLimitFixedToViennaConventionStyle: SpeedLimitStyleProvider { | ||
func useUSStyle() -> Bool { | ||
false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
30 changes: 27 additions & 3 deletions
30
apple/Sources/FerrostarSwiftUI/Views/SpeedLimit/SpeedLimitView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+13 Bytes
(100%)
...FerrostarSwiftUITests/Views/__Snapshots__/InnerGridViewTests/testFullView.1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+129 KB
...pshots__/NavigatingInnerGridViewTests/testViennaStyleSpeedLimitInGridView.1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+91.7 KB
...ews/__Snapshots__/SpeedLimitViewTests/testUSStyleSpeedLimitViews_darkMode.1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+91.4 KB
...ews/__Snapshots__/SpeedLimitViewTests/testUSStyleSpeedLimitViews_darkMode.2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+90.9 KB
...ews/__Snapshots__/SpeedLimitViewTests/testUSStyleSpeedLimitViews_darkMode.3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+92.2 KB
...ews/__Snapshots__/SpeedLimitViewTests/testUSStyleSpeedLimitViews_darkMode.4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+86.4 KB
...s__/SpeedLimitViewTests/testViennaConventionStyleSpeedLimitViews_darkMode.1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+85.8 KB
...s__/SpeedLimitViewTests/testViennaConventionStyleSpeedLimitViews_darkMode.2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+85.5 KB
...s__/SpeedLimitViewTests/testViennaConventionStyleSpeedLimitViews_darkMode.3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+86.1 KB
...s__/SpeedLimitViewTests/testViennaConventionStyleSpeedLimitViews_darkMode.4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.