Skip to content

Commit

Permalink
Add overlay if tracking is off
Browse files Browse the repository at this point in the history
  • Loading branch information
vishnuravi committed Jul 8, 2024
1 parent 2534672 commit 8f28b98
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 11 deletions.
6 changes: 3 additions & 3 deletions LifeSpace.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 5;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = B2Q3T3P8HP;
DEVELOPMENT_TEAM = "";
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "LifeSpace/Supporting Files/Info.plist";
Expand Down Expand Up @@ -1002,7 +1002,7 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 5;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = B2Q3T3P8HP;
DEVELOPMENT_TEAM = "";
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "LifeSpace/Supporting Files/Info.plist";
Expand Down Expand Up @@ -1049,7 +1049,7 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 5;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = B2Q3T3P8HP;
DEVELOPMENT_TEAM = "";
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "LifeSpace/Supporting Files/Info.plist";
Expand Down
14 changes: 7 additions & 7 deletions LifeSpace/Account/AccountSheet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ struct AccountSheet: View {
}
}

var optionsList: some View {
private var optionsList: some View {
List {
Section(header: Text("STUDYID_SECTION")) {
Text(studyID)
Expand All @@ -75,7 +75,7 @@ struct AccountSheet: View {
}
}

var consentDocumentButton: some View {
private var consentDocumentButton: some View {
NavigationLink(destination: {
if let url = getDocumentURL(for: "consent") {
ConsentPDFViewer(url: url)
Expand All @@ -87,7 +87,7 @@ struct AccountSheet: View {
}
}

var hipaaAuthorizationDocumentButton: some View {
private var hipaaAuthorizationDocumentButton: some View {
NavigationLink(destination: {
if let url = getDocumentURL(for: "hipaaAuthorization") {
ConsentPDFViewer(url: url)
Expand All @@ -99,7 +99,7 @@ struct AccountSheet: View {
}
}

var privacyPolicyButton: some View {
private var privacyPolicyButton: some View {
NavigationLink(destination: {
if let url = URL(string: "https://michelleodden.com/cardinal-lifespace-privacy-policy/") {
DocumentWebView(url: url)
Expand All @@ -111,7 +111,7 @@ struct AccountSheet: View {
}
}

var locationTrackingToggle: some View {
private var locationTrackingToggle: some View {
Toggle("TRACK_LOCATION_BUTTON", isOn: $trackingOn)
.onChange(of: trackingOn) {
if trackingOn {
Expand All @@ -122,7 +122,7 @@ struct AccountSheet: View {
}
}

var closeButton: some ToolbarContent {
private var closeButton: some ToolbarContent {
ToolbarItem(placement: .cancellationAction) {
Button("CLOSE") {
dismiss()
Expand All @@ -131,7 +131,7 @@ struct AccountSheet: View {
}


func getDocumentURL(for fileName: String) -> URL? {
private func getDocumentURL(for fileName: String) -> URL? {
guard let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first else {
return nil
}
Expand Down
25 changes: 24 additions & 1 deletion LifeSpace/Map/LifeSpaceMapView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,16 @@ struct LifeSpaceMapView: View {
NavigationStack {
ZStack {
MapManagerViewWrapper()

if !trackingOn {
locationTrackingOverlay
}

VStack {
Spacer()
GroupBox {
optionsPanelButton
if self.optionsPanelOpen {
if optionsPanelOpen {
OptionsPanel()
}
}
Expand Down Expand Up @@ -65,6 +70,24 @@ struct LifeSpaceMapView: View {
}
}

private var locationTrackingOverlay: some View {
VStack {
Spacer()
GroupBox {
Text("LOCATION_NOT_TRACKED")
.padding()
Button(action: {
self.trackingOn = true
self.locationModule.startTracking()
}) {
Text("TURN_TRACKING_ON")
}
.buttonStyle(.borderedProminent)
}
Spacer()
}
}

private var optionsPanelButton: some View {
Button {
withAnimation {
Expand Down
20 changes: 20 additions & 0 deletions LifeSpace/Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,16 @@
}
}
},
"LOCATION_NOT_TRACKED" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Location tracking is off."
}
}
}
},
"LOCATION_PERMISSIONS_BUTTON" : {
"localizations" : {
"en" : {
Expand Down Expand Up @@ -691,6 +701,16 @@
}
}
},
"TURN_TRACKING_ON" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Turn Tracking On"
}
}
}
},
"VIEW_CONSENT_DOCUMENT" : {
"localizations" : {
"en" : {
Expand Down

0 comments on commit 8f28b98

Please sign in to comment.