Skip to content

Commit f3d9472

Browse files
authored
Merge pull request #79 from TaskarCenterAtUW/feature-sidewalk-width-changes
2 parents 2ba3467 + 7620ce2 commit f3d9472

File tree

6 files changed

+37
-17
lines changed

6 files changed

+37
-17
lines changed

GoInfoGame/GoInfoGame/UI/CustomComponents/WidthView.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ struct WidthView: View {
2323
if unit == .feetInch {
2424
VStack {
2525
HStack {
26-
TextField("Feet", text: Binding(
26+
TextField("Feet",text: Binding(
2727
get: { "\(self.feet)" },
2828
set: {
2929
if let value = NumberFormatter().number(from: $0) {
@@ -34,6 +34,8 @@ struct WidthView: View {
3434
validateInput()
3535
}
3636
))
37+
.accessibilityLabel(Text("Enter in Feet"))
38+
.accessibilityHint(Text("Tap to input measurements in feet in the text field."))
3739
.frame(width: 20)
3840
.padding(.horizontal)
3941
.overlay(Rectangle().frame(height: 1).padding(.top, 25).foregroundColor(.orange), alignment: .bottom)
@@ -53,6 +55,8 @@ struct WidthView: View {
5355
validateInput()
5456
}
5557
))
58+
.accessibilityLabel(Text("Enter in Inches"))
59+
.accessibilityHint(Text("Tap to input measurements in inches in the text field."))
5660
.frame(width: 20)
5761
.padding(.horizontal)
5862
.overlay(Rectangle().frame(height: 1).padding(.top, 25).foregroundColor(.orange), alignment: .bottom)

GoInfoGame/GoInfoGame/UI/Map/CustomMap.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,18 @@ struct CustomMap: UIViewRepresentable {
8181
if let selectedQuest = annotation as? DisplayUnitAnnotation {
8282
parent.selectedQuest = selectedQuest.displayUnit
8383
parent.isPresented = true
84-
85-
let distance = parent.calculateDistance(selectedAnnotation: selectedQuest.coordinate)
84+
var contextualString = ""
85+
let distance = Int(parent.calculateDistance(selectedAnnotation: selectedQuest.coordinate))
8686
let direction = parent.inferDirection(selectedAnnotation: selectedQuest.coordinate)
8787

8888
let annotationLocation = CLLocation(latitude: selectedQuest.coordinate.latitude, longitude: selectedQuest.coordinate.longitude)
8989
parent.inferStreetName(location: annotationLocation) { streetName in
9090
if let streetName = streetName {
91-
let contextualString = "The \(selectedQuest.title!) is on \(streetName) at \(distance) meters \(direction) of you"
91+
if let sidewalk = self.parent.selectedQuest?.parent as? SideWalkWidth {
92+
contextualString = "The Sidewalk is along \(streetName == "" ? "the street" : streetName) at \(distance) meters \(direction) of you"
93+
} else {
94+
contextualString = "The \(selectedQuest.title!) is on \(streetName == "" ? "the street" : streetName) at \(distance) meters \(direction) of you"
95+
}
9296
self.contextualInfo?(contextualString)
9397
}
9498
}

GoInfoGame/GoInfoGame/en.lproj/Localizable.strings

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66

77
*/
88
"quest_width_most_narrow_path" = "What is the width of the most narrow usable path along this footpath? (measure with your phone please)";
9-
"quest_determine_sidewalk_widths" = "Determine sidewalk widths";
10-
"quest_road_width_explanation" = "The roadway width from curb to curb: This includes anything on the street surface, including on-street parking or bicycle lanes but excluding anything beyond the curb like sidewalks, off-street parking or adjacent bicycle paths.";
9+
"quest_determine_sidewalk_widths" = "Determine Sidewalk Width";
10+
"quest_road_width_explanation" = "Roadway width from curb to curb includes on-street parking and bicycle lanes but excludes sidewalks, off-street parking, or adjacent bicycle paths.";
1111
"other_answers" = "OTHER ANSWERS...";
1212
"questions_list" = "Questions List";
1313
"quest_generic_confirmation_title" = "Are you sure?";
14-
"quest_road_width_unusualInput_confirmation_description" = "This width looks implausible. Remember, this should be the width from curb to curb, including on-street parking, bicycle lanes etc.";
14+
"quest_road_width_unusualInput_confirmation_description" = "This width seems unlikely. Just remember, it should account for everything from one side of the road to the other, like parking spaces and bike lanes.";
1515
"quest_generic_confirmation_no" = "I WILL CHECK";
1616
"quest_specify_handrails" = "Specify whether steps have handrails";
1717
"quest_handrail_title" = "Do these steps have a handrail?";

GoInfoGame/GoInfoGame/quests/SidewalkWidth/SideWalkWidth.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class SideWalkWidth : QuestBase, Quest {
1414
typealias AnswerClass = WidthAnswer
1515
var _internalExpression: ElementFilterExpression?
1616
var relationData: Element? = nil
17-
var title: String = "Side Walk Width"
17+
var title: String = " Quest is Side Walk Width"
1818
var filter: String = """
1919
ways with
2020
( highway = footway

GoInfoGame/GoInfoGame/quests/SidewalkWidth/SideWalkWidthForm.swift

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,26 @@ struct SideWalkWidthForm: View, QuestForm {
5454
}.padding()
5555
.frame(maxWidth: .infinity, maxHeight: .infinity)
5656
.alert(isPresented: $isConfirmAlert) {
57-
Alert(
58-
title: Text(LocalizedStrings.questGenericConfirmationTitle.localized),
59-
message: Text(LocalizedStrings.questRoadWidthUnusualInputConfirmation.localized),
60-
primaryButton: .default(Text(LocalizedStrings.questGenericConfirmationYes.localized)) {
61-
processAnswer()
62-
},
63-
secondaryButton: .default(Text(LocalizedStrings.questGenericConfirmationNo.localized))
64-
)
57+
if !(feet >= 1 && feet <= 12) {
58+
return Alert(
59+
title: Text(LocalizedStrings.questGenericConfirmationTitle.localized),
60+
message: Text(LocalizedStrings.questRoadWidthUnusualInputConfirmation.localized),
61+
primaryButton: .default(Text(LocalizedStrings.questGenericConfirmationYes.localized)) {
62+
processAnswer()
63+
},
64+
secondaryButton: .default(Text(LocalizedStrings.questGenericConfirmationNo.localized))
65+
)
66+
} else {
67+
return Alert(
68+
title: Text(LocalizedStrings.questSourceDialogTitle.localized),
69+
message: Text(LocalizedStrings.questSourceDialogNote.localized),
70+
primaryButton: .default(Text(LocalizedStrings.questGenericConfirmationYes.localized)) {
71+
processAnswer()
72+
},
73+
secondaryButton: .default(Text(LocalizedStrings.undoConfirmNegative.localized))
74+
)
75+
}
76+
6577
}
6678
}
6779

GoInfoGame/GoInfoGame/quests/WayLit/WayLit.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class WayLit: QuestBase, Quest {
1717
var icon: UIImage = #imageLiteral(resourceName: "add_way_lit")
1818
var wikiLink: String = ""
1919
var changesetComment: String = ""
20-
var title: String = "Way Lit"
20+
var title: String = "Quest is Way Lit"
2121
private static let litResidentialRoads = ["residential", "living_street", "pedestrian"]
2222
private static let litWays = ["footway", "cycleway", "steps"]
2323
private static let litNonResidentialRoads = [

0 commit comments

Comments
 (0)