Add mock samples tab

This commit is contained in:
Christoph Hagen 2024-03-19 14:44:49 +01:00
parent a2228d63b2
commit 21d57ecab1
5 changed files with 46 additions and 1 deletions

View File

@ -58,6 +58,7 @@
E2E552B52BA9A5D200BF5E9B /* WorkoutListRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2E552B42BA9A5D200BF5E9B /* WorkoutListRow.swift */; }; E2E552B52BA9A5D200BF5E9B /* WorkoutListRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2E552B42BA9A5D200BF5E9B /* WorkoutListRow.swift */; };
E2E552B72BA9A69400BF5E9B /* Color+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2E552B62BA9A69400BF5E9B /* Color+Extensions.swift */; }; E2E552B72BA9A69400BF5E9B /* Color+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2E552B62BA9A69400BF5E9B /* Color+Extensions.swift */; };
E2E552B92BA9A77D00BF5E9B /* HKWorkoutActivityType+Icon.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2E552B82BA9A77D00BF5E9B /* HKWorkoutActivityType+Icon.swift */; }; E2E552B92BA9A77D00BF5E9B /* HKWorkoutActivityType+Icon.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2E552B82BA9A77D00BF5E9B /* HKWorkoutActivityType+Icon.swift */; };
E2E552BB2BA9CAAE00BF5E9B /* SamplesTab.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2E552BA2BA9CAAE00BF5E9B /* SamplesTab.swift */; };
E2FDFF202B6BE34C0080A7B3 /* SwiftProtobuf in Frameworks */ = {isa = PBXBuildFile; productRef = E2FDFF1F2B6BE34C0080A7B3 /* SwiftProtobuf */; }; E2FDFF202B6BE34C0080A7B3 /* SwiftProtobuf in Frameworks */ = {isa = PBXBuildFile; productRef = E2FDFF1F2B6BE34C0080A7B3 /* SwiftProtobuf */; };
E2FDFF292B6D10D60080A7B3 /* String+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2FDFF282B6D10D60080A7B3 /* String+Extensions.swift */; }; E2FDFF292B6D10D60080A7B3 /* String+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2FDFF282B6D10D60080A7B3 /* String+Extensions.swift */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
@ -109,6 +110,7 @@
E2E552B42BA9A5D200BF5E9B /* WorkoutListRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WorkoutListRow.swift; sourceTree = "<group>"; }; E2E552B42BA9A5D200BF5E9B /* WorkoutListRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WorkoutListRow.swift; sourceTree = "<group>"; };
E2E552B62BA9A69400BF5E9B /* Color+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Color+Extensions.swift"; sourceTree = "<group>"; }; E2E552B62BA9A69400BF5E9B /* Color+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Color+Extensions.swift"; sourceTree = "<group>"; };
E2E552B82BA9A77D00BF5E9B /* HKWorkoutActivityType+Icon.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "HKWorkoutActivityType+Icon.swift"; sourceTree = "<group>"; }; E2E552B82BA9A77D00BF5E9B /* HKWorkoutActivityType+Icon.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "HKWorkoutActivityType+Icon.swift"; sourceTree = "<group>"; };
E2E552BA2BA9CAAE00BF5E9B /* SamplesTab.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SamplesTab.swift; sourceTree = "<group>"; };
E2FDFF282B6D10D60080A7B3 /* String+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Extensions.swift"; sourceTree = "<group>"; }; E2FDFF282B6D10D60080A7B3 /* String+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Extensions.swift"; sourceTree = "<group>"; };
E2FDFF342B6E59030080A7B3 /* HealthImport.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = HealthImport.entitlements; sourceTree = "<group>"; }; E2FDFF342B6E59030080A7B3 /* HealthImport.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = HealthImport.entitlements; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
@ -223,6 +225,7 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
E2E552882BA2194400BF5E9B /* DatabasesTab.swift */, E2E552882BA2194400BF5E9B /* DatabasesTab.swift */,
E2E552BA2BA9CAAE00BF5E9B /* SamplesTab.swift */,
8850025C2B5C273C00E7D4DB /* WorkoutTab.swift */, 8850025C2B5C273C00E7D4DB /* WorkoutTab.swift */,
); );
path = Tabs; path = Tabs;
@ -364,6 +367,7 @@
885002932B5D129300E7D4DB /* ActivityDetailView.swift in Sources */, 885002932B5D129300E7D4DB /* ActivityDetailView.swift in Sources */,
E2E552A32BA4B58F00BF5E9B /* HeartRateGraph.swift in Sources */, E2E552A32BA4B58F00BF5E9B /* HeartRateGraph.swift in Sources */,
E2E552AF2BA98BCF00BF5E9B /* WorkoutMapView.swift in Sources */, E2E552AF2BA98BCF00BF5E9B /* WorkoutMapView.swift in Sources */,
E2E552BB2BA9CAAE00BF5E9B /* SamplesTab.swift in Sources */,
E27BC6962B5FD61D003A8873 /* WorkoutEvent+Mock.swift in Sources */, E27BC6962B5FD61D003A8873 /* WorkoutEvent+Mock.swift in Sources */,
E2E5529B2BA3935600BF5E9B /* HKWorkout+Extensions.swift in Sources */, E2E5529B2BA3935600BF5E9B /* HKWorkout+Extensions.swift in Sources */,
E27BC6802B5E74D7003A8873 /* LocationSampleListView.swift in Sources */, E27BC6802B5E74D7003A8873 /* LocationSampleListView.swift in Sources */,
@ -537,6 +541,7 @@
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportsDocumentBrowser = YES; INFOPLIST_KEY_UISupportsDocumentBrowser = YES;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
@ -573,6 +578,7 @@
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportsDocumentBrowser = YES; INFOPLIST_KEY_UISupportsDocumentBrowser = YES;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",

View File

@ -56,6 +56,9 @@ struct HealthImportApp: App {
.environmentObject(database) .environmentObject(database)
.tabItem { Label("Workouts", systemSymbol: .figureRun) } .tabItem { Label("Workouts", systemSymbol: .figureRun) }
.tag(TabSelection.workouts) .tag(TabSelection.workouts)
SamplesTab(database: database)
.tabItem { Label("Health", systemSymbol: .heartFill) }
.tag(TabSelection.samples)
DatabasesTab(database: database, databases: databaseList) DatabasesTab(database: database, databases: databaseList)
.tabItem {Label("Databases", systemSymbol: .archivebox) } .tabItem {Label("Databases", systemSymbol: .archivebox) }
.tag(TabSelection.databases) .tag(TabSelection.databases)

View File

@ -67,7 +67,7 @@ extension HKWorkoutActivityType {
case .mixedMetabolicCardioTraining: case .mixedMetabolicCardioTraining:
return .figureMixedCardio return .figureMixedCardio
case .paddleSports: case .paddleSports:
return .heart return .oar2Crossed
case .play: case .play:
return .figurePlay return .figurePlay
case .preparationAndRecovery: case .preparationAndRecovery:

View File

@ -0,0 +1,35 @@
import SwiftUI
struct SamplesTab: View {
@ObservedObject
var database: Database
var body: some View {
NavigationStack {
List {
Label("Activity", systemSymbol: .flame)
Label("Body Measurements", systemSymbol: .figure)
Label("Cycle Tracking", systemSymbol: .circleHexagonpath)
Label("Hearing", systemSymbol: .ear)
Label("Heart", systemSymbol: .heartFill)
Label("Medications", systemSymbol: .pills)
Label("Mental Wellbeing", systemSymbol: .brainHeadProfile)
Label("Mobility", systemSymbol: .arrowLeftAndRight)
Label("Nutrition", systemSymbol: .carrot)
Label("Respiratory", systemSymbol: .lungs)
Label("Sleep", systemSymbol: .bedDouble)
Label("Symptoms", systemSymbol: .listBulletClipboard)
Label("Vitals", systemSymbol: .waveformPathEcgRectangle)
Label("Other Data", systemSymbol: .cross)
}
.navigationTitle("Health")
}
}
}
#Preview {
SamplesTab(database: Database())
.preferredColorScheme(.dark)
}

View File

@ -67,6 +67,7 @@ struct WorkoutDetailView: View {
if isProcessingWorkout { if isProcessingWorkout {
ProgressView() ProgressView()
.progressViewStyle(.circular) .progressViewStyle(.circular)
.padding(.trailing, 10)
Text("Adding workout to health...") Text("Adding workout to health...")
.foregroundStyle(.accent) .foregroundStyle(.accent)
} else { } else {