WIP
This commit is contained in:
@@ -30,10 +30,15 @@ class BridgeModule: NSObject, ObservableObject {
|
|||||||
public private(set) var workoutStartDate: Date?
|
public private(set) var workoutStartDate: Date?
|
||||||
|
|
||||||
private var currentExerciseTimer: Timer?
|
private var currentExerciseTimer: Timer?
|
||||||
public private(set) var currentExerciseIdx: Int = -1
|
public private(set) var currentExerciseIdx: Int = -1 {
|
||||||
|
didSet {
|
||||||
|
self.currentExercisePositionString = "\(self.currentExerciseIdx+1)/\(self.currentWorkout?.exercises.count ?? 0)"
|
||||||
|
}
|
||||||
|
}
|
||||||
@Published var currentExerciseTimeLeft: Int = 0
|
@Published var currentExerciseTimeLeft: Int = 0
|
||||||
@Published var currentExercise: ExerciseElement?
|
@Published var currentExercise: ExerciseElement?
|
||||||
|
var currentExercisePositionString: String?
|
||||||
|
|
||||||
private var isWatchConnected = false
|
private var isWatchConnected = false
|
||||||
// workoutEndDate fills out WatchPackageModel.workoutEndDate which
|
// workoutEndDate fills out WatchPackageModel.workoutEndDate which
|
||||||
// tells the watch app to stop the workout
|
// tells the watch app to stop the workout
|
||||||
|
|||||||
@@ -25,10 +25,19 @@ struct ExternalWorkoutDetailView: View {
|
|||||||
avPlayer.play()
|
avPlayer.play()
|
||||||
}
|
}
|
||||||
|
|
||||||
ExtExerciseList(workout: workout,
|
VStack {
|
||||||
currentExerciseIdx: bridgeModule.currentExerciseIdx)
|
if let currentExercisePositionString = bridgeModule.currentExercisePositionString {
|
||||||
|
Text(currentExercisePositionString)
|
||||||
|
.font(Font.system(size: 55))
|
||||||
|
.scaledToFit()
|
||||||
|
.minimumScaleFactor(0.01)
|
||||||
|
.lineLimit(1)
|
||||||
|
.padding()
|
||||||
|
}
|
||||||
|
ExtExerciseList(workout: workout,
|
||||||
|
currentExerciseIdx: bridgeModule.currentExerciseIdx)
|
||||||
|
}
|
||||||
.frame(width: metrics.size.width * 0.3, height: metrics.size.height * 0.8)
|
.frame(width: metrics.size.width * 0.3, height: metrics.size.height * 0.8)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ExtCountdownView()
|
ExtCountdownView()
|
||||||
|
|||||||
Reference in New Issue
Block a user