Skip to content

Commit 11b3c0e

Browse files
Design updates on Camera screen
1 parent 83d13a8 commit 11b3c0e

File tree

3 files changed

+144
-156
lines changed

3 files changed

+144
-156
lines changed

Sources/SprenUI/UI/Screens/Flows/BodyComp/CameraScreen/CameraScreen.swift

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -184,22 +184,10 @@ struct CameraScreen: View {
184184
isTimerOpen = !isTimerOpen
185185
} label: {
186186
ZStack(alignment: .top) {
187-
HStack {
188-
if let isTimerOn = model.isTimerOn {
189-
Text(String(isTimerOn) + "s")
190-
.font(.sprenParagraph)
191-
.foregroundColor(.white)
192-
.padding(.top, Autoscale.convert(10))
193-
}else{
194-
Text(" ").padding(.top, Autoscale.convert(45))
195-
}
196-
Spacer()
197-
}
198-
199187
VStack {
200-
Spacer().frame(height: Autoscale.convert(25))
201-
Image("Timer", bundle: .module).colorMultiply(isTimerOpen ? .sprenUISecondaryColor : .white)
202-
Spacer().frame(height: Autoscale.convert(10))
188+
Spacer().frame(height: Autoscale.convert(21))
189+
Image("Timer", bundle: .module).colorMultiply(isTimerOpen || (model.isTimerOn != nil) ? .sprenUISecondaryColor : .white)
190+
Spacer().frame(height: Autoscale.convert(21))
203191
}
204192
}
205193
}
@@ -227,9 +215,9 @@ struct CameraScreen: View {
227215
model.flipCamera()
228216
} label: {
229217
VStack {
230-
Spacer().frame(height: Autoscale.convert(10))
218+
Spacer().frame(height: Autoscale.convert(16))
231219
Image("Switch", bundle: .module).colorMultiply(model.isCameraFlipped ? .sprenUISecondaryColor : .white)
232-
Spacer().frame(height: Autoscale.convert(25))
220+
Spacer().frame(height: Autoscale.convert(21))
233221
}
234222
}
235223
}

Sources/SprenUI/UI/Screens/Flows/BodyComp/CameraScreen/CameraScreenTimerSelectionContainer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct CameraScreenTimerSelectionContainer: View {
2121
model.setTimer(nil)
2222
buttonCallBack()
2323
} label: {
24-
Text("timer off")
24+
Text("timer\noff")
2525
.font(.sprenParagraph)
2626
.foregroundColor(model.isTimerOn == nil ? Color.sprenUISecondaryColor : .white)
2727
.padding(.bottom, Autoscale.convert(10))

Sources/SprenUI/UI/Screens/Flows/BodyComp/CameraScreen/CanvasBoxes.swift

Lines changed: 138 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -19,45 +19,45 @@ struct CanvasBoxes: View {
1919
let leftWidth = UIScreen.main.bounds.width / 2
2020
let rightWidth = UIScreen.main.bounds.width / 2 + 75
2121

22-
func isLeftWristIn() -> Bool {
23-
guard let leftWrist = leftWrist else {
24-
return false
25-
}
26-
27-
var topPadding = 0.0
28-
29-
if #available(iOS 13.0, *) {
30-
if let window = UIApplication.shared.windows.first {
31-
topPadding = window.safeAreaInsets.top
32-
}
33-
}
34-
35-
if(leftWrist.x > 15 && leftWrist.x < 90 && leftWrist.y > armsHeight + topPadding && leftWrist.y < armsHeight + topPadding + 89){
36-
return true
37-
}
38-
39-
return false
40-
}
22+
// func isLeftWristIn() -> Bool {
23+
// guard let leftWrist = leftWrist else {
24+
// return false
25+
// }
26+
//
27+
// var topPadding = 0.0
28+
//
29+
// if #available(iOS 13.0, *) {
30+
// if let window = UIApplication.shared.windows.first {
31+
// topPadding = window.safeAreaInsets.top
32+
// }
33+
// }
34+
//
35+
// if(leftWrist.x > 15 && leftWrist.x < 90 && leftWrist.y > armsHeight + topPadding && leftWrist.y < armsHeight + topPadding + 89){
36+
// return true
37+
// }
38+
//
39+
// return false
40+
// }
4141

42-
func isRightWristIn() -> Bool {
43-
guard let rightWrist = rightWrist else {
44-
return false
45-
}
46-
47-
var topPadding = 0.0
48-
49-
if #available(iOS 13.0, *) {
50-
if let window = UIApplication.shared.windows.first {
51-
topPadding = window.safeAreaInsets.top
52-
}
53-
}
54-
55-
if(rightWrist.x > armsRightWidth - 90 && rightWrist.x < armsRightWidth - 16 && rightWrist.y > armsHeight + topPadding && rightWrist.y < armsHeight + topPadding + 89){
56-
return true
57-
}
58-
59-
return false
60-
}
42+
// func isRightWristIn() -> Bool {
43+
// guard let rightWrist = rightWrist else {
44+
// return false
45+
// }
46+
//
47+
// var topPadding = 0.0
48+
//
49+
// if #available(iOS 13.0, *) {
50+
// if let window = UIApplication.shared.windows.first {
51+
// topPadding = window.safeAreaInsets.top
52+
// }
53+
// }
54+
//
55+
// if(rightWrist.x > armsRightWidth - 90 && rightWrist.x < armsRightWidth - 16 && rightWrist.y > armsHeight + topPadding && rightWrist.y < armsHeight + topPadding + 89){
56+
// return true
57+
// }
58+
//
59+
// return false
60+
// }
6161

6262
func isLeftAnkleIn() -> Bool {
6363
guard let leftAnkle = leftAnkle else {
@@ -116,111 +116,111 @@ struct CanvasBoxes: View {
116116
GeometryReader { geometry in
117117
ZStack {
118118
// Color(.black)
119-
ZStack {
120-
//Top left
121-
Path { path in
122-
let p1 = CGPoint(x: 40, y: armsHeight)
123-
let p2 = CGPoint(x: 16, y: armsHeight + 24)
124-
let p3 = CGPoint(x: 24, y: armsHeight + 8)
125-
let p4 = CGPoint(x: 40, y: armsHeight)
126-
127-
path.move(to: p1)
128-
path.addLine(to: p4)
129-
path.addArc(center: p3, radius: 8, startAngle: .degrees(270), endAngle: .degrees(180), clockwise: true)
130-
path.addLine(to: p2)
131-
}.stroke(isLeftWristIn() ? Color.sprenUISecondaryColor : .white, style: StrokeStyle(lineWidth: 4, lineCap: .round, lineJoin: .round))
132-
133-
Path { path in
134-
let p1 = CGPoint(x: 66, y: armsHeight)
135-
let p2 = CGPoint(x: 90, y: armsHeight + 24)
136-
let p3 = CGPoint(x: 82, y: armsHeight + 8)
137-
let p4 = CGPoint(x: 82, y: armsHeight)
138-
139-
path.move(to: p1)
140-
path.addLine(to: p4)
141-
path.addArc(center: p3, radius: 8, startAngle: .degrees(270), endAngle: .degrees(0), clockwise: false)
142-
path.addLine(to: p2)
143-
}.stroke(isLeftWristIn() ? Color.sprenUISecondaryColor : .white, style: StrokeStyle(lineWidth: 4, lineCap: .round, lineJoin: .round))
119+
// ZStack {
120+
// //Top left
121+
// Path { path in
122+
// let p1 = CGPoint(x: 40, y: armsHeight)
123+
// let p2 = CGPoint(x: 16, y: armsHeight + 24)
124+
// let p3 = CGPoint(x: 24, y: armsHeight + 8)
125+
// let p4 = CGPoint(x: 40, y: armsHeight)
126+
//
127+
// path.move(to: p1)
128+
// path.addLine(to: p4)
129+
// path.addArc(center: p3, radius: 8, startAngle: .degrees(270), endAngle: .degrees(180), clockwise: true)
130+
// path.addLine(to: p2)
131+
// }.stroke(isLeftWristIn() ? Color.sprenUISecondaryColor : .white, style: StrokeStyle(lineWidth: 4, lineCap: .round, lineJoin: .round))
144132

145-
Path { path in
146-
let p1 = CGPoint(x: 16, y: armsHeight + 65)
147-
let p2 = CGPoint(x: 16, y: armsHeight + 80)
148-
let p3 = CGPoint(x: 24, y: armsHeight + 80)
149-
let p4 = CGPoint(x: 40, y: armsHeight + 88)
150-
151-
path.move(to: p1)
152-
path.addLine(to: p2)
153-
path.addArc(center: p3, radius: 8, startAngle: .degrees(180), endAngle: .degrees(90), clockwise: true)
154-
path.addLine(to: p4)
155-
}.stroke(isLeftWristIn() ? Color.sprenUISecondaryColor : .white, style: StrokeStyle(lineWidth: 4, lineCap: .round, lineJoin: .round))
133+
// Path { path in
134+
// let p1 = CGPoint(x: 66, y: armsHeight)
135+
// let p2 = CGPoint(x: 90, y: armsHeight + 24)
136+
// let p3 = CGPoint(x: 82, y: armsHeight + 8)
137+
// let p4 = CGPoint(x: 82, y: armsHeight)
138+
//
139+
// path.move(to: p1)
140+
// path.addLine(to: p4)
141+
// path.addArc(center: p3, radius: 8, startAngle: .degrees(270), endAngle: .degrees(0), clockwise: false)
142+
// path.addLine(to: p2)
143+
// }.stroke(isLeftWristIn() ? Color.sprenUISecondaryColor : .white, style: StrokeStyle(lineWidth: 4, lineCap: .round, lineJoin: .round))
156144

157-
Path { path in
158-
let p1 = CGPoint(x: 90, y: armsHeight + 65)
159-
let p2 = CGPoint(x: 90, y: armsHeight + 80)
160-
let p3 = CGPoint(x: 82, y: armsHeight + 80)
161-
let p4 = CGPoint(x: 66, y: armsHeight + 88)
162-
163-
path.move(to: p1)
164-
path.addLine(to: p2)
165-
path.addArc(center: p3, radius: 8, startAngle: .degrees(0), endAngle: .degrees(90), clockwise: false)
166-
path.addLine(to: p4)
167-
}.stroke(isLeftWristIn() ? Color.sprenUISecondaryColor : .white, style: StrokeStyle(lineWidth: 4, lineCap: .round, lineJoin: .round))
145+
// Path { path in
146+
// let p1 = CGPoint(x: 16, y: armsHeight + 65)
147+
// let p2 = CGPoint(x: 16, y: armsHeight + 80)
148+
// let p3 = CGPoint(x: 24, y: armsHeight + 80)
149+
// let p4 = CGPoint(x: 40, y: armsHeight + 88)
150+
//
151+
// path.move(to: p1)
152+
// path.addLine(to: p2)
153+
// path.addArc(center: p3, radius: 8, startAngle: .degrees(180), endAngle: .degrees(90), clockwise: true)
154+
// path.addLine(to: p4)
155+
// }.stroke(isLeftWristIn() ? Color.sprenUISecondaryColor : .white, style: StrokeStyle(lineWidth: 4, lineCap: .round, lineJoin: .round))
168156

169-
CanvasCircles(x: 53, y: armsHeight + 44, size1: 50, size2: 32, size3: 10, action: isLeftWristIn)
170-
}
157+
// Path { path in
158+
// let p1 = CGPoint(x: 90, y: armsHeight + 65)
159+
// let p2 = CGPoint(x: 90, y: armsHeight + 80)
160+
// let p3 = CGPoint(x: 82, y: armsHeight + 80)
161+
// let p4 = CGPoint(x: 66, y: armsHeight + 88)
162+
//
163+
// path.move(to: p1)
164+
// path.addLine(to: p2)
165+
// path.addArc(center: p3, radius: 8, startAngle: .degrees(0), endAngle: .degrees(90), clockwise: false)
166+
// path.addLine(to: p4)
167+
// }.stroke(isLeftWristIn() ? Color.sprenUISecondaryColor : .white, style: StrokeStyle(lineWidth: 4, lineCap: .round, lineJoin: .round))
168+
//
169+
// CanvasCircles(x: 53, y: armsHeight + 44, size1: 50, size2: 32, size3: 10, action: isLeftWristIn)
170+
// }
171171

172-
ZStack {
173-
//Top right
174-
Path { path in
175-
let p1 = CGPoint(x: armsRightWidth - 66, y: armsHeight)
176-
let p2 = CGPoint(x: armsRightWidth - 90, y: armsHeight + 24)
177-
let p3 = CGPoint(x: armsRightWidth - 82, y: armsHeight + 8)
178-
let p4 = CGPoint(x: armsRightWidth - 66, y: armsHeight)
179-
180-
path.move(to: p1)
181-
path.addLine(to: p4)
182-
path.addArc(center: p3, radius: 8, startAngle: .degrees(270), endAngle: .degrees(180), clockwise: true)
183-
path.addLine(to: p2)
184-
}.stroke(isRightWristIn() ? Color.sprenUISecondaryColor : .white, style: StrokeStyle(lineWidth: 4, lineCap: .round, lineJoin: .round))
185-
186-
Path { path in
187-
let p1 = CGPoint(x: armsRightWidth - 40, y: armsHeight)
188-
let p2 = CGPoint(x: armsRightWidth - 16, y: armsHeight + 24)
189-
let p3 = CGPoint(x: armsRightWidth - 24, y: armsHeight + 8)
190-
let p4 = CGPoint(x: armsRightWidth - 24, y: armsHeight)
191-
192-
path.move(to: p1)
193-
path.addLine(to: p4)
194-
path.addArc(center: p3, radius: 8, startAngle: .degrees(270), endAngle: .degrees(0), clockwise: false)
195-
path.addLine(to: p2)
196-
}.stroke(isRightWristIn() ? Color.sprenUISecondaryColor : .white, style: StrokeStyle(lineWidth: 4, lineCap: .round, lineJoin: .round))
197-
198-
Path { path in
199-
let p1 = CGPoint(x: armsRightWidth - 90, y: armsHeight + 65)
200-
let p2 = CGPoint(x: armsRightWidth - 90, y: armsHeight + 80)
201-
let p3 = CGPoint(x: armsRightWidth - 82, y: armsHeight + 80)
202-
let p4 = CGPoint(x: armsRightWidth - 66, y: armsHeight + 88)
203-
204-
path.move(to: p1)
205-
path.addLine(to: p2)
206-
path.addArc(center: p3, radius: 8, startAngle: .degrees(180), endAngle: .degrees(90), clockwise: true)
207-
path.addLine(to: p4)
208-
}.stroke(isRightWristIn() ? Color.sprenUISecondaryColor : .white, style: StrokeStyle(lineWidth: 4, lineCap: .round, lineJoin: .round))
209-
210-
Path { path in
211-
let p1 = CGPoint(x: armsRightWidth - 16, y: armsHeight + 65)
212-
let p2 = CGPoint(x: armsRightWidth - 16, y: armsHeight + 80)
213-
let p3 = CGPoint(x: armsRightWidth - 24, y: armsHeight + 80)
214-
let p4 = CGPoint(x: armsRightWidth - 40, y: armsHeight + 88)
172+
// ZStack {
173+
// //Top right
174+
// Path { path in
175+
// let p1 = CGPoint(x: armsRightWidth - 66, y: armsHeight)
176+
// let p2 = CGPoint(x: armsRightWidth - 90, y: armsHeight + 24)
177+
// let p3 = CGPoint(x: armsRightWidth - 82, y: armsHeight + 8)
178+
// let p4 = CGPoint(x: armsRightWidth - 66, y: armsHeight)
179+
//
180+
// path.move(to: p1)
181+
// path.addLine(to: p4)
182+
// path.addArc(center: p3, radius: 8, startAngle: .degrees(270), endAngle: .degrees(180), clockwise: true)
183+
// path.addLine(to: p2)
184+
// }.stroke(isRightWristIn() ? Color.sprenUISecondaryColor : .white, style: StrokeStyle(lineWidth: 4, lineCap: .round, lineJoin: .round))
185+
//
186+
// Path { path in
187+
// let p1 = CGPoint(x: armsRightWidth - 40, y: armsHeight)
188+
// let p2 = CGPoint(x: armsRightWidth - 16, y: armsHeight + 24)
189+
// let p3 = CGPoint(x: armsRightWidth - 24, y: armsHeight + 8)
190+
// let p4 = CGPoint(x: armsRightWidth - 24, y: armsHeight)
191+
//
192+
// path.move(to: p1)
193+
// path.addLine(to: p4)
194+
// path.addArc(center: p3, radius: 8, startAngle: .degrees(270), endAngle: .degrees(0), clockwise: false)
195+
// path.addLine(to: p2)
196+
// }.stroke(isRightWristIn() ? Color.sprenUISecondaryColor : .white, style: StrokeStyle(lineWidth: 4, lineCap: .round, lineJoin: .round))
215197

216-
path.move(to: p1)
217-
path.addLine(to: p2)
218-
path.addArc(center: p3, radius: 8, startAngle: .degrees(0), endAngle: .degrees(90), clockwise: false)
219-
path.addLine(to: p4)
220-
}.stroke(isRightWristIn() ? Color.sprenUISecondaryColor : .white, style: StrokeStyle(lineWidth: 4, lineCap: .round, lineJoin: .round))
221-
222-
CanvasCircles(x: armsRightWidth - 53, y: armsHeight + 44, size1: 50, size2: 32, size3: 10, action: isRightWristIn)
223-
}
198+
// Path { path in
199+
// let p1 = CGPoint(x: armsRightWidth - 90, y: armsHeight + 65)
200+
// let p2 = CGPoint(x: armsRightWidth - 90, y: armsHeight + 80)
201+
// let p3 = CGPoint(x: armsRightWidth - 82, y: armsHeight + 80)
202+
// let p4 = CGPoint(x: armsRightWidth - 66, y: armsHeight + 88)
203+
//
204+
// path.move(to: p1)
205+
// path.addLine(to: p2)
206+
// path.addArc(center: p3, radius: 8, startAngle: .degrees(180), endAngle: .degrees(90), clockwise: true)
207+
// path.addLine(to: p4)
208+
// }.stroke(isRightWristIn() ? Color.sprenUISecondaryColor : .white, style: StrokeStyle(lineWidth: 4, lineCap: .round, lineJoin: .round))
209+
//
210+
// Path { path in
211+
// let p1 = CGPoint(x: armsRightWidth - 16, y: armsHeight + 65)
212+
// let p2 = CGPoint(x: armsRightWidth - 16, y: armsHeight + 80)
213+
// let p3 = CGPoint(x: armsRightWidth - 24, y: armsHeight + 80)
214+
// let p4 = CGPoint(x: armsRightWidth - 40, y: armsHeight + 88)
215+
//
216+
// path.move(to: p1)
217+
// path.addLine(to: p2)
218+
// path.addArc(center: p3, radius: 8, startAngle: .degrees(0), endAngle: .degrees(90), clockwise: false)
219+
// path.addLine(to: p4)
220+
// }.stroke(isRightWristIn() ? Color.sprenUISecondaryColor : .white, style: StrokeStyle(lineWidth: 4, lineCap: .round, lineJoin: .round))
221+
//
222+
// CanvasCircles(x: armsRightWidth - 53, y: armsHeight + 44, size1: 50, size2: 32, size3: 10, action: isRightWristIn)
223+
// }
224224

225225
ZStack {
226226
//Bottom

0 commit comments

Comments
 (0)