Commit 331773234b
Verified · cmc
Sources/OrgstarMobile/OnboardingScreen.swift +16 −2 · view
| @@ -17,6 +17,7 @@ struct OnboardingScreen: View { | |||
| 17 | @State private var importing = false | 17 | @State private var importing = false |
| 18 | @State private var problem: String? | 18 | @State private var problem: String? |
| 19 | @Environment(\.accessibilityReduceMotion) private var reduceMotion | 19 | @Environment(\.accessibilityReduceMotion) private var reduceMotion |
| 20 | @Environment(\.dynamicTypeSize) private var dynamicTypeSize | ||
| 20 | 21 | ||
| 21 | private enum Step: Int, CaseIterable { | 22 | private enum Step: Int, CaseIterable { |
| 22 | case welcome, folder, notifications, calendar, reminders | 23 | case welcome, folder, notifications, calendar, reminders |
| @@ -179,10 +180,20 @@ struct OnboardingScreen: View { | |||
| 179 | Text(text).font(.body).foregroundStyle(.secondary).multilineTextAlignment(.center) | 180 | Text(text).font(.body).foregroundStyle(.secondary).multilineTextAlignment(.center) |
| 180 | content | 181 | content |
| 181 | } | 182 | } |
| 182 | .padding(.vertical, 24) | 183 | .padding(.vertical, 40) |
| 183 | .frame(maxWidth: .infinity, minHeight: geometry.size.height) | 184 | .frame(maxWidth: .infinity, minHeight: geometry.size.height) |
| 184 | } | 185 | } |
| 185 | .scrollBounceBehavior(.basedOnSize) | 186 | .scrollBounceBehavior(.basedOnSize) |
| 187 | .scrollIndicatorsFlash(onAppear: true) | ||
| 188 | // Text cut off at an edge fades out rather than showing as a sliver; the fades | ||
| 189 | // cover only the padding when the page fits. | ||
| 190 | .mask { | ||
| 191 | VStack(spacing: 0) { | ||
| 192 | LinearGradient(colors: [.clear, .black], startPoint: .top, endPoint: .bottom).frame(height: 40) | ||
| 193 | Color.black | ||
| 194 | LinearGradient(colors: [.black, .clear], startPoint: .top, endPoint: .bottom).frame(height: 40) | ||
| 195 | } | ||
| 196 | } | ||
| 186 | } | 197 | } |
| 187 | VStack(spacing: 12) { actions() } | 198 | VStack(spacing: 12) { actions() } |
| 188 | } | 199 | } |
| @@ -190,7 +201,10 @@ struct OnboardingScreen: View { | |||
| 190 | 201 | ||
| 191 | private func feature(_ symbol: String, _ title: LocalizedStringKey, _ text: LocalizedStringKey) -> some View { | 202 | private func feature(_ symbol: String, _ title: LocalizedStringKey, _ text: LocalizedStringKey) -> some View { |
| 192 | HStack(alignment: .top, spacing: 14) { | 203 | HStack(alignment: .top, spacing: 14) { |
| 193 | Image(systemName: symbol).font(.title2).foregroundStyle(Color.accentColor).frame(width: 32) | 204 | // At accessibility sizes the text takes the whole width. |
| 205 | if !dynamicTypeSize.isAccessibilitySize { | ||
| 206 | Image(systemName: symbol).font(.title2).foregroundStyle(Color.accentColor).frame(width: 32) | ||
| 207 | } | ||
| 194 | VStack(alignment: .leading, spacing: 2) { | 208 | VStack(alignment: .leading, spacing: 2) { |
| 195 | Text(title).font(.headline) | 209 | Text(title).font(.headline) |
| 196 | Text(text).font(.subheadline).foregroundStyle(.secondary) | 210 | Text(text).font(.subheadline).foregroundStyle(.secondary) |