-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDataTableView.swift
144 lines (136 loc) · 5.53 KB
/
DataTableView.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
import SwiftUI
struct DataTableView: View {
var body: some View {
VStack{
Text("[PRE-PRODUCTION BUILD]")
.foregroundColor(.gray)
TabView{
VStack{
Text("Sleep Analysis")
List(publicDS.saDS) { analysis in
VStack {
Text("\(Int(analysis.Duration)) Mins | \(analysis.SleepType)")
.bold(true)
Text(analysis.SleepTime+"//"+analysis.WakeTime)
.font(.subheadline)
Text("Source: \(analysis.Device)")
.font(.subheadline)
Text("6: Asleep Unspecified 5: Asleep REM 4: Asleep Deep")
.font(.caption)
.foregroundColor(.gray)
Text("3: Asleep Core 2: Active 1: Awake 0: In Bed")
.font(.caption)
.foregroundColor(.gray)
}
}
}
VStack{
Text("Stand Time")
List(publicDS.DailyStandTime) { analysis in
VStack {
Text("\(Int(analysis.Duration)) Mins")
.bold(true)
Text(analysis.StartTime+"//"+analysis.EndTime)
.font(.subheadline)
}
}
}
VStack{
Text("Daily Steps")
List(publicDS.DailySteps) { analysis in
HStack(alignment:.center) {
VStack {
Text("\(Int(analysis.Value)) Steps")
.bold(true)
Text(analysis.StartTime+"//"+analysis.EndTime)
.font(.subheadline)
Text("Source: \(analysis.Device)")
.font(.subheadline)
}
}
}
}
VStack{
Text("Step Distance")
List(publicDS.StepDistance) { analysis in
HStack(alignment:.center) {
VStack {
Text("\(Double(analysis.Value)) m")
.bold(true)
Text(analysis.StartTime+"//"+analysis.EndTime)
.font(.subheadline)
Text("Source: \(analysis.Device)")
.font(.subheadline)
}
}
}
}
VStack{
Text("Step Speed")
List(publicDS.StepSpeed) { analysis in
HStack(alignment:.center) {
VStack {
Text("\(Double(analysis.Value)) m/min")
.bold(true)
Text(analysis.StartTime+"//"+analysis.EndTime)
.font(.subheadline)
Text("Source: \(analysis.Device)")
.font(.subheadline)
}
}
}
}
VStack{
Text("Cadence Data")
List(publicDS.CadenceDataSet) { analysis in
HStack(alignment:.center) {
VStack {
Text("\(Int(analysis.Value)) Step/min")
.bold(true)
Text("\(analysis.Date) | \(Int(analysis.TimeInterval)) Seconds")
.font(.subheadline)
}
}
}
}
VStack{
Text("Heart Rate")
List(publicDS.HRDataSet) { analysis in
HStack(alignment:.center) {
VStack(alignment: .center) {
Text("\(Int(analysis.Value)) Bpm ")
.bold(true)
Text(analysis.Date)
.font(.subheadline)
Text("Motion Context: \(analysis.MotionContext)")
.font(.subheadline)
Text("2: Active 1: Sedentary 0: Unknown")
.font(.caption)
.foregroundColor(.gray)
}
}
}
}
VStack{
Text("Resting Heart Rate")
List(publicDS.RestingHeartRate) { analysis in
VStack {
Text("\(Int(analysis.Value)) bpm")
.bold(true)
Text(analysis.StartTime+"//"+analysis.EndTime)
.font(.subheadline)
Text("Duration: \(analysis.Duration/3600) hrs")
.font(.subheadline)
}
}
}
}
.tabViewStyle(.page)
}
}
}
struct DataTableView_Previews: PreviewProvider {
static var previews: some View {
DataTableView()
}
}