Skip to content

Commit af125dc

Browse files
authored
Merge pull request #263 from rfcbf/feature/adjust_onboarding
feat: Adjust in Onboarding UI
2 parents c4967b6 + 7e4ef90 commit af125dc

File tree

7 files changed

+267
-249
lines changed

7 files changed

+267
-249
lines changed

MacMagazine/Features/OnboardingLibrary/Sources/OnboardingLibrary/Model/OnBoardingFeature.swift

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,57 +13,57 @@ public extension OnBoardingFeature {
1313
OnBoardingFeature(
1414
symbol: "sparkles",
1515
title: "Nova interface",
16-
subTitle: "Liquid Glass. Rápido e fácil de usar."
16+
subTitle: "Liquid Glass. Rápida, moderna e fácil de usar."
1717
),
1818
OnBoardingFeature(
1919
symbol: "ipad.and.iphone",
20-
title: "iPhone e iPad",
21-
subTitle: "Experiências diferentes, pensadas para cada dispositivo."
20+
title: "Dispositivos suportados",
21+
subTitle: "iPhone, iPad, Mac e Apple Watch"
2222
),
2323
OnBoardingFeature(
2424
symbol: "apple.podcasts.pages",
25-
title: "Experiência em podcasts",
26-
subTitle: "Controle completo do player. Capítulos."
25+
title: "MacMagazine no Ar",
26+
subTitle: "Player completo para o nosso podcast, com suporte a capítulos."
2727
),
2828
OnBoardingFeature(
2929
symbol: "photo.on.rectangle.angled",
3030
title: "Instagram",
31-
subTitle: "Nova categoria dedicada ao Instagram."
32-
),
33-
OnBoardingFeature(
34-
symbol: "folder.fill",
35-
title: "Categorias de posts",
36-
subTitle: "Explore conteúdos organizados por categorias."
31+
subTitle: "Nova aba dedicada à rede social."
3732
),
33+
// OnBoardingFeature(
34+
// symbol: "folder.fill",
35+
// title: "Categorias de posts",
36+
// subTitle: "Explore conteúdos organizados por categorias."
37+
// ),
3838
OnBoardingFeature(
3939
symbol: "slider.horizontal.3",
4040
title: "App personalizável",
41-
subTitle: "Deixe o app com a sua cara, com ajustes personalizados."
41+
subTitle: "Deixe o app com a sua cara!"
4242
),
4343
OnBoardingFeature(
4444
symbol: "icloud.fill",
4545
title: "Sincronização com iCloud",
46-
subTitle: "Suas preferências sincronizadas em todos os dispositivos."
46+
subTitle: "Preferências sincronizadas em todos os seus dispositivos."
4747
),
4848
OnBoardingFeature(
4949
symbol: "applewatch",
5050
title: "Novo app para Apple Watch",
51-
subTitle: "Fique informado direto no pulso."
51+
subTitle: "Fique informado diretamente no pulso."
5252
),
5353
OnBoardingFeature(
5454
symbol: "square.grid.2x2.fill",
55-
title: "Nova interface de widgets",
56-
subTitle: "Widgets lindos com design Liquid Glass."
57-
),
58-
OnBoardingFeature(
59-
symbol: "gift.fill",
60-
title: "Mais uma novidade",
61-
subTitle: "Descubra recursos escondidos por todo o app."
62-
),
63-
OnBoardingFeature(
64-
symbol: "desktopcomputer",
65-
title: "App para macOS",
66-
subTitle: "Aplicativo completo para Mac, pensado para o desktop."
55+
title: "Widgets lindos…",
56+
subTitle: "Três tamanhos de widgets para você escolher."
6757
)
58+
// OnBoardingFeature(
59+
// symbol: "gift.fill",
60+
// title: "Mais uma novidade",
61+
// subTitle: "Descubra recursos escondidos por todo o app."
62+
// ),
63+
// OnBoardingFeature(
64+
// symbol: "desktopcomputer",
65+
// title: "App para macOS",
66+
// subTitle: "Aplicativo completo para Mac, pensado para o desktop."
67+
// )
6868
]
6969
}

MacMagazine/Features/OnboardingLibrary/Sources/OnboardingLibrary/Views/Components/OnboardingCTAButton.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public struct OnboardingCTAButton: View {
3434
HStack(spacing: 8) {
3535
Text(title)
3636
.textCase(.uppercase)
37-
.fontWeight(.semibold)
37+
.fontWeight(.bold)
3838
.font(isLandscape ? .subheadline : .body)
3939

4040
if showChevron {

MacMagazine/Features/OnboardingLibrary/Sources/OnboardingLibrary/Views/Components/OnboardingSkipButton.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public struct OnboardingSkipButton: View {
2929
.font(.body)
3030
.foregroundColor(.primary)
3131
.padding()
32-
.glassEffect(.clear.interactive())
32+
.glassEffect()
3333
}
3434
.accessibilityLabel(label)
3535
.accessibilityHint(hint)

MacMagazine/Features/OnboardingLibrary/Sources/OnboardingLibrary/Views/OnboardingContainerView.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ public struct OnboardingContainerView: View {
3131
PermissionsView(coordinator: coordinator, logoNamespace: logoAnimation)
3232
}
3333
}
34-
.frame(maxWidth: .infinity, maxHeight: .infinity)
3534
.transition(.opacity)
3635
}
3736
.frame(maxWidth: .infinity, maxHeight: .infinity)
@@ -44,7 +43,7 @@ public struct OnboardingContainerView: View {
4443
// MARK: - Preview
4544

4645
#if DEBUG
47-
#Preview("Sheet - iPhone") {
46+
#Preview("Sheet - Portrait") {
4847
OnboardingSheetPreviewHost()
4948
}
5049

MacMagazine/Features/OnboardingLibrary/Sources/OnboardingLibrary/Views/Screen1_WelcomeView.swift

Lines changed: 42 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,22 @@ struct WelcomeView: View {
4848
// MARK: - Portrait Layout
4949

5050
private var portraitLayout: some View {
51-
VStack(spacing: 24) {
52-
Spacer()
53-
51+
VStack(spacing: 0) {
52+
// Logo fixed at top
5453
logoView(width: 152, height: 152)
55-
.padding(.bottom, 48)
54+
.padding(.top, 70)
55+
.onboardingFade(animateIn, delay: 0.00, duration: reduceMotion ? 0 : 0.70)
56+
.scaleEffect(animateIn ? 1 : (reduceMotion ? 1 : 0.90))
57+
.animation(reduceMotion ? nil : .easeOut(duration: 0.70), value: animateIn)
58+
59+
Spacer()
5660

5761
messageView
5862
.onboardingFade(animateIn, delay: 0.25, duration: 0.60)
5963

6064
Spacer()
61-
65+
}
66+
.safeAreaInset(edge: .bottom) {
6267
ctaButton
6368
.padding(.horizontal, 20)
6469
.padding(.vertical, 16)
@@ -100,27 +105,23 @@ struct WelcomeView: View {
100105
.padding(.vertical, 16)
101106
}
102107

103-
// MARK: - Componentes Compartilhados
108+
// MARK: - Shared Components
104109

105110
private func logoView(width: CGFloat, height: CGFloat) -> some View {
106111
OnboardingLogoView(width: width, height: height)
107-
.matchedGeometryEffect(id: "onboarding_logo", in: logoNamespace)
108-
.onboardingFade(animateIn, delay: 0.00, duration: reduceMotion ? 0 : 0.70)
109-
.scaleEffect(animateIn ? 1 : (reduceMotion ? 1 : 0.90))
110-
.animation(reduceMotion ? nil : .easeOut(duration: 0.70), value: animateIn)
111112
.accessibilityHidden(true)
112113
}
113114

114115
private var messageView: some View {
115116
VStack(spacing: 10) {
116-
Text("Bem-vindo ao novo MacMagazine")
117+
Text("Bem-vindo ao novo app do MacMagazine")
117118
.font(isLandscape ? .title2.weight(.bold) : .largeTitle.weight(.bold))
118119
.multilineTextAlignment(.center)
119120
.lineLimit(nil)
120121
.fixedSize(horizontal: false, vertical: true)
121122
.accessibilityAddTraits(.isHeader)
122123

123-
Text("Notícias, reviews e podcasts em um visual totalmente renovado.")
124+
Text("Notícias, reviews, vídeos e podcasts em um visual totalmente renovado.")
124125
.font(isLandscape ? .body : .title3)
125126
.foregroundStyle(.secondary)
126127
.multilineTextAlignment(.center)
@@ -132,18 +133,9 @@ struct WelcomeView: View {
132133
}
133134

134135
private var ctaButton: some View {
135-
PrimaryButton(
136-
"Continuar",
137-
size: 340,
138-
style: ButtonStyleConfiguration(
139-
color: .white,
140-
stroke: theme.button.primary.color ?? .blue,
141-
fill: theme.button.primary.color ?? .blue
142-
)
143-
) {
136+
OnboardingCTAButton("Continuar") {
144137
trackAndNavigate()
145138
}
146-
.frame(maxWidth: .infinity)
147139
.accessibilityLabel("Continuar")
148140
.accessibilityHint("Avança para ver as novidades do app")
149141
}
@@ -155,7 +147,7 @@ struct WelcomeView: View {
155147
buttonId: AnalyticsConstants.ButtonID.onboardingWelcomeContinue.id,
156148
screen: AnalyticsConstants.Screen.onboardingWelcome.name
157149
))
158-
withAnimation(reduceMotion ? nil : .spring(response: 0.6, dampingFraction: 0.8)) {
150+
withAnimation(reduceMotion ? nil : .spring(response: 0.7, dampingFraction: 0.85)) {
159151
coordinator.navigate(to: .features)
160152
}
161153
}
@@ -166,29 +158,38 @@ struct WelcomeView: View {
166158
#if DEBUG
167159
#Preview("Welcome — Portrait") {
168160
@Previewable @Namespace var namespace
169-
170-
NavigationStack {
171-
WelcomeView(
172-
coordinator: OnboardingCoordinator(
173-
permissionManager: PermissionManager(analytics: AnalyticsManager()),
174-
analytics: AnalyticsManager()
175-
),
176-
logoNamespace: namespace
177-
)
178-
}
161+
WelcomeSheetPreviewHost()
179162
}
180163

181164
#Preview("Welcome — Landscape", traits: .landscapeLeft) {
182165
@Previewable @Namespace var namespace
166+
WelcomeSheetPreviewHost()
167+
}
183168

184-
NavigationStack {
185-
WelcomeView(
186-
coordinator: OnboardingCoordinator(
187-
permissionManager: PermissionManager(analytics: AnalyticsManager()),
188-
analytics: AnalyticsManager()
189-
),
190-
logoNamespace: namespace
191-
)
169+
private struct WelcomeSheetPreviewHost: View {
170+
@State private var isPresented = true
171+
@State private var coordinator = OnboardingCoordinator(
172+
permissionManager: PermissionManager(analytics: AnalyticsManager()),
173+
analytics: AnalyticsManager()
174+
)
175+
176+
var body: some View {
177+
ZStack {
178+
Color.gray.opacity(0.12)
179+
.ignoresSafeArea()
180+
181+
Text("MainView (simulação)")
182+
.font(.headline)
183+
}
184+
.sheet(isPresented: $isPresented) {
185+
OnboardingContainerView(coordinator: coordinator)
186+
.environment(\.theme, ThemeColor())
187+
.presentationDetents([.large])
188+
.interactiveDismissDisabled(true)
189+
}
190+
.onAppear {
191+
isPresented = true
192+
}
192193
}
193194
}
194195
#endif

0 commit comments

Comments
 (0)