mycode/myApp/Keging/IOS/TimerSettingsView.swift
songyc macbook 06d13b2f3d feat(keging): 준비 시간(0~10초, 기본 3초) — 시작 버튼 후 카운트다운 뒤 첫 수축
- KegelPhase에 prepare 국면 추가(무진동 — 첫 수축 진동이 시작 신호), 준비 0초면 즉시 수축
- 세팅에 '준비' 스테퍼(0~10초), 워치 자동 동기화, 구버전 설정 decodeIfPresent 보존
- 진행 화면: 준비=회그린 원이 작게 시작해 천천히 부풀며 첫 수축으로 연결(기존 그래픽 문법 유지),
  진행 링 0·카운터 색 연동. 워치·Live Activity도 준비 국면 색/표시 대응
- 기록·건강의 시작 시각은 준비를 뺀 첫 수축 기준. Live Activity는 sync 단일 진입점으로 정리
- 도움말·세팅 푸터 문구 갱신, 신규 문자열 번역(en/ja)·stale 정리 — 전 카탈로그 0/0
- 검증: Debug·Release·워치 빌드 그린, 준비→수축 전환·세팅 화면 QA

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UPmp29DQHY6Ahfss5SRopT
2026-08-29 20:55:10 +09:00

70 lines
3.0 KiB
Swift

//
// TimerSettingsView.swift
// Keging
//
// · , ,
//
import SwiftUI
struct TimerSettingsView: View {
@EnvironmentObject private var settings: SettingsStore
@Environment(\.dismiss) private var dismiss
var body: some View {
NavigationStack {
Form {
Section {
Stepper(value: $settings.config.prepSeconds, in: 0...10) {
LabeledContent("준비", value: String(localized: "\(settings.config.prepSeconds)"))
}
Stepper(value: $settings.config.contractSeconds, in: 1...60) {
LabeledContent("수축", value: String(localized: "\(settings.config.contractSeconds)"))
}
Stepper(value: $settings.config.relaxSeconds, in: 1...60) {
LabeledContent("이완", value: String(localized: "\(settings.config.relaxSeconds)"))
}
Stepper(value: $settings.config.reps, in: 1...100) {
LabeledContent("횟수", value: String(localized: "\(settings.config.reps)"))
}
} header: {
Text("사이클")
} footer: {
Text("시작 버튼을 누르면 준비 시간 뒤에 수축 → 이완을 \(settings.config.reps)회 반복해요. 한 세트 약 \(durationText).")
}
Section {
Picker("수축 진동", selection: $settings.config.contractPattern) {
ForEach(HapticPattern.allCases) { Text($0.label).tag($0) }
}
Picker("이완 진동", selection: $settings.config.relaxPattern) {
ForEach(HapticPattern.allCases) { Text($0.label).tag($0) }
}
Button("수축 진동 미리 느끼기") { Haptics.play(settings.config.contractPattern) }
Button("이완 진동 미리 느끼기") { Haptics.play(settings.config.relaxPattern) }
} header: {
Text("진동 패턴")
} footer: {
Text("수축과 이완의 진동이 달라 화면을 보지 않아도 구분할 수 있어요. 진동은 실기기에서만 느껴져요.")
}
}
.navigationTitle("운동 세팅")
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .confirmationAction) {
Button("완료") { dismiss() }
}
}
}
}
private var durationText: String {
let total = Int(settings.config.totalDuration)
let minutes = total / 60
let seconds = total % 60
if minutes == 0 { return String(localized: "\(seconds)") }
if seconds == 0 { return String(localized: "\(minutes)") }
return String(localized: "\(minutes)\(seconds)")
}
}