Exhaustive file-by-file audit of every Swift file in the project (iOS app, Watch app, Widget extension). Every interactive UI element — buttons, toggles, pickers, links, menus, tap gestures, text editors, color pickers, photo pickers — now has an accessibilityIdentifier for XCUITest automation. 46 files changed across Shared/, Onboarding/, Watch App/, and Widget targets. Added ~100 new ID definitions covering settings debug controls, export/photo views, sharing templates, customization subviews, onboarding flows, tip modals, widget voting buttons, and watch mood buttons.
101 lines
3.3 KiB
Swift
101 lines
3.3 KiB
Swift
//
|
|
// OnboardingWrapup.swift
|
|
// Reflect (iOS)
|
|
//
|
|
// Created by Trey Tartt on 1/21/22.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct OnboardingWrapup: View {
|
|
@ObservedObject var onboardingData: OnboardingData
|
|
|
|
let completionClosure: ((OnboardingData) -> Void)
|
|
|
|
var formatter: DateFormatter {
|
|
let dateFormatter = DateFormatter()
|
|
dateFormatter.timeStyle = .short
|
|
return dateFormatter
|
|
}
|
|
|
|
var body: some View {
|
|
GeometryReader { geometry in
|
|
VStack {
|
|
ScrollView {
|
|
|
|
Spacer()
|
|
|
|
Text(String(localized: "onboarding_wrap_up_1"))
|
|
.padding(.top)
|
|
.padding()
|
|
.font(.title)
|
|
.foregroundColor(Color(UIColor.white))
|
|
|
|
Text(formatter.string(from: onboardingData.date))
|
|
.font(.title)
|
|
.fontWeight(.bold)
|
|
.padding()
|
|
.foregroundColor(Color(UIColor.white))
|
|
|
|
Text(String(localized: "onboarding_wrap_up_3"))
|
|
.font(.title)
|
|
.padding()
|
|
.foregroundColor(Color(UIColor.white))
|
|
|
|
Text(onboardingData.inputDay.localizedValue)
|
|
.font(.title)
|
|
.fontWeight(.bold)
|
|
.padding()
|
|
.foregroundColor(Color(UIColor.white))
|
|
|
|
Button(action: {
|
|
AnalyticsManager.shared.track(.onboardingCompleted(dayId: String(onboardingData.inputDay.rawValue)))
|
|
completionClosure(onboardingData)
|
|
}, label: {
|
|
Text(String(localized: "onboarding_wrap_up_complete_button"))
|
|
.font(.title)
|
|
.fontWeight(.bold)
|
|
.foregroundColor(Color(hex: "31d158"))
|
|
.padding()
|
|
.background(RoundedRectangle(cornerRadius: 10).fill().foregroundColor(Color.white))
|
|
.cornerRadius(10)
|
|
})
|
|
.accessibilityIdentifier(AccessibilityID.Onboarding.wrapupContinue)
|
|
.padding([.top], 65)
|
|
}
|
|
.multilineTextAlignment(.center)
|
|
}
|
|
.frame(maxWidth: geometry.size.width)
|
|
}
|
|
.background {
|
|
ZStack {
|
|
Color(hex: "31d158")
|
|
VStack {
|
|
Spacer()
|
|
Image("great", bundle: .main)
|
|
.foregroundColor(Color(UIColor.darkText))
|
|
.opacity(0.04)
|
|
.scaleEffect(1.2, anchor: .trailing)
|
|
.accessibilityHidden(true)
|
|
Spacer()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
struct OnboardingWrapup_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
Group {
|
|
OnboardingWrapup(onboardingData: OnboardingData(), completionClosure: { _ in
|
|
|
|
})
|
|
|
|
OnboardingWrapup(onboardingData: OnboardingData(), completionClosure: { _ in
|
|
|
|
})
|
|
.preferredColorScheme(.dark)
|
|
}
|
|
}
|
|
}
|