Skip to content

Open-source gym & body-weight tracker, now in the App Store (iPhone + Apple Watch) and as an Android APK. Plan routines, log workouts, see which muscles are trained, import from Strong/Hevy/FitNotes. Self-host it or use it on the phone alone.

Watch: the crown editor's reps/weight choice without a segmented picker

Duarte Santos5c9937e222bb
diff --git a/frontend/ios/App/Watch/OpenGymWatchApp.swift b/frontend/ios/App/Watch/OpenGymWatchApp.swift
index 163313a7b..63ec214b0 100644
--- a/frontend/ios/App/Watch/OpenGymWatchApp.swift
+++ b/frontend/ios/App/Watch/OpenGymWatchApp.swift
@@ -256,12 +256,11 @@ struct AdjustView: View {
var body: some View {
VStack(spacing: 8) {
- Picker("", selection: $target) {
- Text("Reps").tag(CrownTarget.reps)
- Text(store.unit).tag(CrownTarget.weight)
+ // What the crown turns: reps or the weight (no segmented picker on watchOS).
+ HStack(spacing: 6) {
+ CrownChoice(title: Text("Reps"), on: target == .reps) { target = .reps }
+ CrownChoice(title: Text(store.unit), on: target == .weight) { target = .weight }
}
- .pickerStyle(.segmented)
- .labelsHidden()
Text(formatNumber(target == .weight ? store.weight : store.reps))
.font(.system(size: 52, weight: .semibold, design: .rounded).monospacedDigit())
.foregroundStyle(Theme.accent)
@@ -388,3 +387,21 @@ struct ClipView: View {
.accessibilityHidden(true)
}
}
+
+struct CrownChoice: View {
+ let title: Text
+ let on: Bool
+ let action: () -> Void
+
+ var body: some View {
+ Button(action: action) {
+ title
+ .font(.footnote.weight(.semibold))
+ .frame(maxWidth: .infinity)
+ .padding(.vertical, 4)
+ .background(Capsule().fill(on ? Theme.accent : Color.gray.opacity(0.25)))
+ .foregroundStyle(on ? Color.black : Color.primary)
+ }
+ .buttonStyle(.plain)
+ }
+}