71 lines
2.2 KiB
Swift
71 lines
2.2 KiB
Swift
//
|
|
// WatchControlView.swift
|
|
// Werkout_watch Watch App
|
|
//
|
|
// Created by Trey Tartt on 7/8/23.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct WatchControlView: View {
|
|
@StateObject var vm = WatchMainViewModel.shared
|
|
|
|
var body: some View {
|
|
HStack {
|
|
VStack {
|
|
Button(action: {
|
|
vm.completeWorkout()
|
|
}, label: {
|
|
Image(systemName: "stop.circle")
|
|
.font(.title)
|
|
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
|
})
|
|
.buttonStyle(BorderedButtonStyle(tint: .red))
|
|
|
|
Button(action: {
|
|
vm.restartExercise()
|
|
}, label: {
|
|
Image(systemName: "arrow.counterclockwise.circle")
|
|
.font(.title)
|
|
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
|
})
|
|
.buttonStyle(BorderedButtonStyle(tint: .yellow))
|
|
|
|
Button(action: {
|
|
vm.previousExercise()
|
|
}, label: {
|
|
Image(systemName: "arrow.backward")
|
|
.font(.title)
|
|
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
|
})
|
|
.buttonStyle(BorderedButtonStyle(tint: .blue))
|
|
}
|
|
VStack {
|
|
Button(action: {
|
|
vm.pauseWorkout()
|
|
}, label: {
|
|
Image(systemName: "pause")
|
|
.font(.title)
|
|
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
|
})
|
|
.buttonStyle(BorderedButtonStyle(tint: .blue))
|
|
|
|
Button(action: {
|
|
vm.nextExercise()
|
|
}, label: {
|
|
Image(systemName: "arrow.forward")
|
|
.font(.title)
|
|
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
|
})
|
|
.buttonStyle(BorderedButtonStyle(tint: .green))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
struct WatchControlView_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
WatchControlView(vm: WatchMainViewModel())
|
|
}
|
|
}
|