Skip to content

Commit

Permalink
Merge pull request #44 from SchweizerischeBundesbahnen/develop
Browse files Browse the repository at this point in the history
Onboarding: fix padding + accessibility element order
  • Loading branch information
fleuryj authored Nov 8, 2022
2 parents 6aa721f + fe901c9 commit 2d39133
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,21 @@ struct OnboardingCardsWrapperView: View {
private var portraitView: some View {
VStack(spacing: 0) {
cardsView()
.accessibilitySortPriority(2)
VStack(spacing: 16) {
HStack {
backButton
.buttonStyle(SBBIconButtonStyle(size: .small))
.accessibility(identifier: "onboardingPreviousCardButton")
.accessibilitySortPriority(3)
Spacer()
SBBPaginationView(currentPageIndex: $viewModel.currentCardIndex, numberOfPages: viewModel.cardViews.count)
.accessibility(hidden: true)
Spacer()
nextButton
.buttonStyle(SBBIconButtonStyle(size: .small))
.accessibility(identifier: "onboardingNextCardButton")
.accessibilitySortPriority(1)
}
Button(action: {
self.viewModel.state = .hidden
Expand All @@ -79,6 +82,7 @@ struct OnboardingCardsWrapperView: View {
}
.buttonStyle(SBBTertiaryButtonStyle(size: .small))
.accessibility(identifier: "onboardingAbortTourButton")
.accessibilitySortPriority(0)
}
.padding(.horizontal, 8)
.padding(.vertical, 24)
Expand All @@ -95,9 +99,11 @@ struct OnboardingCardsWrapperView: View {
backButton
.buttonStyle(SBBIconButtonStyle(size: .large, style: .negative))
.accessibility(identifier: "onboardingPreviousCardButton")
.accessibilitySortPriority(3)
Spacer()
}
cardsView(safeAreaInsetsLeading: 44 + 10 + 8 + geometry.safeAreaInsets.leading)
.accessibilitySortPriority(2)
ZStack {
VStack {
Button(action: {
Expand All @@ -110,17 +116,20 @@ struct OnboardingCardsWrapperView: View {
.buttonStyle(SBBIconButtonStyle(size: .large, style: .negative))
.accessibility(identifier: "onboardingAbortTourButton")
.padding(.top, 16)
.accessibilitySortPriority(0)
Spacer()
}
VStack {
Spacer()
nextButton
.buttonStyle(SBBIconButtonStyle(size: .large, style: .negative))
.accessibility(identifier: "onboardingNextCardButton")
.accessibilitySortPriority(1)
Spacer()
}
}
}
.sbbScreenPadding(.horizontal)
.background(Color.sbbColor(.primary).edgesIgnoringSafeArea(.all))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ struct OnboardingTitleWrapperView: View {
}
}
}
.sbbScreenPadding(.vertical)
.sbbScreenPadding()
}

var body: some View {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2d39133

Please sign in to comment.