Skip to content

Commit 6372b7a

Browse files
committed
Adjustment:
- removed responsive frame from Data, Feedback, allgraphs, bpm and last session. - there are some comments marked in graphs and last session
1 parent 6ee862a commit 6372b7a

File tree

7 files changed

+59
-48
lines changed

7 files changed

+59
-48
lines changed

CanShaker.xcodeproj/project.pbxproj

+6-6
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@
712712
CODE_SIGN_STYLE = Automatic;
713713
CURRENT_PROJECT_VERSION = 1;
714714
DEVELOPMENT_ASSET_PATHS = "\"CanShaker Watch App/Preview Content\"";
715-
DEVELOPMENT_TEAM = 3FRYF657J2;
715+
DEVELOPMENT_TEAM = WLW428B75Y;
716716
ENABLE_PREVIEWS = YES;
717717
GENERATE_INFOPLIST_FILE = YES;
718718
INFOPLIST_FILE = "CanShaker-Watch-App-Info.plist";
@@ -721,13 +721,13 @@
721721
INFOPLIST_KEY_NSHealthUpdateUsageDescription = "This app requires permission to write to properly track and give you statistics about your heart rate and energy spent during the session.";
722722
INFOPLIST_KEY_NSMotionUsageDescription = "This app tracks your wrist movements during sessions";
723723
INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
724-
INFOPLIST_KEY_WKCompanionAppBundleIdentifier = com.snesnopic.CanShaker;
724+
INFOPLIST_KEY_WKCompanionAppBundleIdentifier = com.Dave.CanShaker;
725725
LD_RUNPATH_SEARCH_PATHS = (
726726
"$(inherited)",
727727
"@executable_path/Frameworks",
728728
);
729729
MARKETING_VERSION = 1.0;
730-
PRODUCT_BUNDLE_IDENTIFIER = com.snesnopic.CanShaker.watchkitapp;
730+
PRODUCT_BUNDLE_IDENTIFIER = com.Dave.CanShaker.watchkitapp;
731731
PRODUCT_NAME = "$(TARGET_NAME)";
732732
SDKROOT = watchos;
733733
SKIP_INSTALL = YES;
@@ -756,7 +756,7 @@
756756
INFOPLIST_KEY_NSHealthUpdateUsageDescription = "This app requires permission to write to properly track and give you statistics about your heart rate and energy spent during the session.";
757757
INFOPLIST_KEY_NSMotionUsageDescription = "This app tracks your wrist movements during sessions";
758758
INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
759-
INFOPLIST_KEY_WKCompanionAppBundleIdentifier = com.snesnopic.CanShaker;
759+
INFOPLIST_KEY_WKCompanionAppBundleIdentifier = com.Dave.CanShaker;
760760
LD_RUNPATH_SEARCH_PATHS = (
761761
"$(inherited)",
762762
"@executable_path/Frameworks",
@@ -784,7 +784,7 @@
784784
CODE_SIGN_STYLE = Automatic;
785785
CURRENT_PROJECT_VERSION = 1;
786786
DEVELOPMENT_ASSET_PATHS = "\"CanShaker/Preview Content\"";
787-
DEVELOPMENT_TEAM = 3FRYF657J2;
787+
DEVELOPMENT_TEAM = WLW428B75Y;
788788
ENABLE_PREVIEWS = YES;
789789
GENERATE_INFOPLIST_FILE = YES;
790790
INFOPLIST_FILE = CanShaker/Info.plist;
@@ -803,7 +803,7 @@
803803
"@executable_path/Frameworks",
804804
);
805805
MARKETING_VERSION = 1.0;
806-
PRODUCT_BUNDLE_IDENTIFIER = com.snesnopic.CanShaker;
806+
PRODUCT_BUNDLE_IDENTIFIER = com.Dave.CanShaker;
807807
PRODUCT_NAME = "$(TARGET_NAME)";
808808
SDKROOT = iphoneos;
809809
SWIFT_EMIT_LOC_STRINGS = YES;

CanShaker/View/Dashboard/Components/DataView.swift

+8-4
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,23 @@ struct DataView: View {
1313
@State var sessionToShow: Session?
1414

1515
var body: some View {
16-
HStack{
16+
HStack {
1717
VStack (alignment: .leading){
1818
Text("**Avg. BPM:** \(String(format: "%.1f", (sessionToShow?.heartRateData.getAverage()) ?? ""))")
19-
Spacer()
19+
2020
Text("**Avg. speed:** \(String(format: "%.1f", (sessionToShow?.accelData.getAverage()) ?? "")) m/s²")
21+
2122
}
23+
.padding()
24+
2225
Spacer()
26+
2327
VStack (alignment: .leading){
2428
Text("**Energy:** \(Int(sessionToShow?.calories ?? 0)) kcal")
25-
Spacer()
29+
2630
Text("**Time:** ") + Text(sessionToShow?.duration.doubleToTime() ?? "0s")
2731
}
28-
Spacer()
32+
.padding()
2933
}
3034
.font(.subheadline)
3135
}

CanShaker/View/Dashboard/Components/FeedbackView.swift

+7-7
Original file line numberDiff line numberDiff line change
@@ -21,37 +21,37 @@ struct FeedbackView: View {
2121
Image(systemName: "face.smiling")
2222
.imageScale(.large)
2323
.offset(x:-10)
24-
.responsiveFrame(widthPercentage: 10)
2524
Text("Hey there newcomer, start a session from the watch app to gain data!")
25+
2626

2727
} else {
28-
if sessionToShow!.associatedFeedback.imageName == "♋️" {
28+
if sessionToShow!.associatedFeedback.imageName == "♋️" {
2929
Text("♋️")
3030
.font(.title)
3131
.scaleEffect(1.2)
3232
.padding(.horizontal, 5)
3333
} else {
3434
Image(systemName: "\(sessionToShow!.associatedFeedback.imageName)")
3535
.imageScale(.large)
36-
.responsiveFrame(widthPercentage: 10)
3736
}
3837

3938
Text("\(sessionToShow!.associatedFeedback.sentence)")
4039
.offset(x: 5)
4140
Spacer()
4241
}
42+
4343
}
4444
.font(.title3)
4545
.multilineTextAlignment(.leading)
4646
.fontWeight(.semibold)
47+
.padding()
4748
}
48-
.responsiveFrame(widthPercentage: 90, heightPercentage: 10)
4949

5050
Line()
5151
.stroke(style: StrokeStyle(lineWidth: 1, dash: [6]))
5252
.frame(height: 1)
5353
.foregroundStyle(Color.unselectedTabBar)
54-
.responsiveFrame(widthPercentage: 90, heightPercentage: 1)
54+
Spacer()
5555
}
5656
}
5757

@@ -67,11 +67,11 @@ struct FeedbackView: View {
6767
accelD[Double(i)*0.3] = Double.random(in: 1...4)
6868
heartRate[Double(i)*0.3] = Double.random(in: 60...150)
6969
}
70-
let session = Session(date: Date(), accelData: accelD, duration: 69, heartRateData: heartRate, calories: calories)
70+
let session = Session(date: Date(), accelData: accelD, duration: duration, heartRateData: heartRate, calories: calories)
7171
container.mainContext.insert(session)
7272

7373

74-
return FeedbackView(sessionToShow: session)
74+
return FeedbackView(sessionToShow: nil)
7575
.modelContainer(container)
7676
}
7777

CanShaker/View/Dashboard/Components/Graphs/AllGraphsView.swift

+9-4
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,19 @@ struct AllGraphsView: View {
1616

1717
var body: some View {
1818

19-
HStack{
19+
HStack(alignment: .center){
2020
Picker("", selection: $statToShow){
2121
Text("BPM")
2222
.tag(0)
2323
Text("Speed")
2424
.tag(1)
2525
}
26-
.responsiveFrame(widthPercentage: 35)
2726
.pickerStyle(.segmented)
27+
Spacer()
2828
}
29-
.padding(.vertical, 10)
29+
.padding(.vertical, 15)
30+
31+
//TODO: adjust
3032

3133
HStack{
3234
if sessionToShow == nil {
@@ -37,12 +39,13 @@ struct AllGraphsView: View {
3739
AreaMark (x: .value("Time", Date()),
3840
y: .value("BPM", 140))
3941
}
42+
.padding()
43+
4044
.chartYAxis {
4145
AxisMarks(position: .leading) { _ in
4246
AxisValueLabel()
4347
}
4448
}
45-
.responsiveFrame(widthPercentage: 80, aspectRatio: (2,1))
4649
.padding(.vertical)
4750
.overlay {
4851
Text("No data yet!").bold()
@@ -51,8 +54,10 @@ struct AllGraphsView: View {
5154
else {
5255
if(statToShow == 1) {
5356
SpeedGraphView(session: sessionToShow!)
57+
.padding()
5458
} else {
5559
BpmGraphView(session: sessionToShow!)
60+
.padding()
5661
}
5762
}
5863
Spacer()

CanShaker/View/Dashboard/Components/Graphs/BpmGraphView.swift

+24-21
Original file line numberDiff line numberDiff line change
@@ -21,31 +21,34 @@ struct BpmGraphView: View {
2121
startPoint: .top, endPoint: .bottom)
2222

2323
var body: some View {
24-
Chart{
25-
ForEach(session.heartRateData.keys.sorted(),id: \.self){ time in
26-
27-
AreaMark (x: .value("Time", Date(timeIntervalSince1970: time)),
28-
y: .value("BPM", (session.heartRateData[time]!)))
29-
30-
.interpolationMethod(.catmullRom)
31-
.foregroundStyle(heartGradient)
32-
24+
VStack(alignment: .center){
25+
Chart{
26+
ForEach(session.heartRateData.keys.sorted(),id: \.self){ time in
27+
28+
AreaMark (x: .value("Time", Date(timeIntervalSince1970: time)),
29+
y: .value("BPM", (session.heartRateData[time]!)))
30+
31+
.interpolationMethod(.catmullRom)
32+
.foregroundStyle(heartGradient)
33+
34+
}
35+
//TODO: adjust
3336
}
34-
35-
}
36-
.chartXAxis{
37-
AxisMarks(values: .automatic(desiredCount: 4)) {
38-
AxisValueLabel(format: Date.FormatStyle().minute(.defaultDigits).second(.defaultDigits))
37+
.padding()
38+
.chartXAxis{
39+
AxisMarks(values: .automatic(desiredCount: 5)) {
40+
AxisValueLabel(format: Date.FormatStyle().minute(.defaultDigits).second(.defaultDigits))
41+
}
3942
}
40-
}
41-
.chartYAxis {
42-
AxisMarks(position: .leading) { _ in
43-
AxisValueLabel()
43+
.chartYAxis {
44+
AxisMarks(position: .leading) { _ in
45+
AxisValueLabel()
46+
}
4447
}
48+
.padding()
49+
Spacer()
4550
}
46-
.responsiveFrame(widthPercentage: 80, aspectRatio: (2,1))
47-
.padding(.vertical)
48-
51+
.preferredColorScheme(.dark)
4952
}
5053

5154
}

CanShaker/View/Dashboard/Components/Graphs/SpeedGraphView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct SpeedGraphView: View {
3232
.foregroundStyle(speedGradient)
3333

3434
}
35-
35+
//TODO: adjust
3636
}
3737
.chartXAxis{
3838
AxisMarks(values: .automatic(desiredCount: 6)) {

CanShaker/View/Dashboard/Components/LastSessionView.swift

+4-5
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,26 @@ struct LastSessionView: View {
2020
}
2121

2222
var body: some View {
23-
ZStack{
23+
ZStack {
2424
RoundedRectangle(cornerRadius: 15.0)
25-
.responsiveFrame(widthPercentage: 95, heightPercentage: 49)
2625
.foregroundStyle(.box)
2726

2827
VStack(alignment: .center){
2928

3029
//Feedback
3130
FeedbackView(sessionToShow: sessionToShow)
31+
Spacer()
3232
//Graphs
3333
AllGraphsView(sessionToShow: sessionToShow)
3434
//Data showed on graphs
3535
DataView(sessionToShow: sessionToShow)
3636
Spacer()
37-
3837
}
39-
.responsiveFrame(widthPercentage: 85, heightPercentage: 35)
38+
//MARK: Don't worry if it looks like this, check on DashboardView (that has to be adjusted aswell)
4039
}
4140
.preferredColorScheme(.dark)
4241
}
43-
42+
4443
}
4544

4645
#Preview {

0 commit comments

Comments
 (0)