try to fix watch stuff
This commit is contained in:
@@ -8,18 +8,20 @@
|
||||
import SwiftUI
|
||||
|
||||
struct MainWatchView: View {
|
||||
@StateObject var vm = WatchMainViewModel.shared
|
||||
@ObservedObject var vm = WatchMainViewModel.shared
|
||||
@ObservedObject var watchWorkout = WatchWorkout.shared
|
||||
|
||||
var body: some View {
|
||||
VStack {
|
||||
HStack {
|
||||
if vm.isInWorkout {
|
||||
if watchWorkout.isInWorkout {
|
||||
HStack {
|
||||
|
||||
Text(vm.watchPackageModel.currentExerciseName)
|
||||
.font(.body)
|
||||
.foregroundColor(.white)
|
||||
.lineLimit(10)
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
Divider()
|
||||
Text("\(vm.watchPackageModel.currentTimeLeft )")
|
||||
.font(.title)
|
||||
@@ -27,28 +29,27 @@ struct MainWatchView: View {
|
||||
.lineLimit(10)
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
}
|
||||
}
|
||||
|
||||
HStack {
|
||||
if let heartValue = vm.heartValue {
|
||||
VStack {
|
||||
Image(systemName: "heart.fill")
|
||||
.font(Font.system(size: 22))
|
||||
.scaledToFit()
|
||||
.minimumScaleFactor(0.01)
|
||||
.lineLimit(1)
|
||||
.foregroundColor(.red)
|
||||
Text("\(heartValue)")
|
||||
.font(Font.system(size: 55))
|
||||
.scaledToFit()
|
||||
.minimumScaleFactor(0.01)
|
||||
.lineLimit(1)
|
||||
.foregroundColor(.red)
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
}
|
||||
|
||||
if vm.isInWorkout {
|
||||
|
||||
HStack {
|
||||
if let heartValue = watchWorkout.heartValue {
|
||||
VStack {
|
||||
Image(systemName: "heart.fill")
|
||||
.font(Font.system(size: 22))
|
||||
.scaledToFit()
|
||||
.minimumScaleFactor(0.01)
|
||||
.lineLimit(1)
|
||||
.foregroundColor(.red)
|
||||
Text("\(heartValue)")
|
||||
.font(Font.system(size: 55))
|
||||
.scaledToFit()
|
||||
.minimumScaleFactor(0.01)
|
||||
.lineLimit(1)
|
||||
.foregroundColor(.red)
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
}
|
||||
|
||||
Button(action: {
|
||||
vm.nextExercise()
|
||||
}, label: {
|
||||
@@ -57,12 +58,10 @@ struct MainWatchView: View {
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
})
|
||||
.buttonStyle(BorderedButtonStyle(tint: .green))
|
||||
} else {
|
||||
VStack {
|
||||
Text("No Werkout")
|
||||
Text("🍑")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Text("No Werkout")
|
||||
Text("🍑")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user