From 197dd047a6f9d8b4b0384726b7d39c09efad3769 Mon Sep 17 00:00:00 2001 From: robert Date: Sat, 25 Feb 2023 23:26:55 -0600 Subject: [PATCH 1/2] Onboarding carousel frame updated to full width, while maintaining cell sizing across idioms --- .../SwiftUI/UI/HICarouselSwiftUIView.swift | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/HackIllinois/SwiftUI/UI/HICarouselSwiftUIView.swift b/HackIllinois/SwiftUI/UI/HICarouselSwiftUIView.swift index 27a2a89d..fc7d3c22 100644 --- a/HackIllinois/SwiftUI/UI/HICarouselSwiftUIView.swift +++ b/HackIllinois/SwiftUI/UI/HICarouselSwiftUIView.swift @@ -41,13 +41,26 @@ struct HICarouselSwiftUIView: View { .padding(.top, 20) } .tag(index) + .padding(.horizontal, horizontalCarouselPadding) } } .tabViewStyle(PageTabViewStyle(indexDisplayMode: .never)) HITabIndicator(count: carouselData.count, current: $currentIndex) .offset(y: -50) } - .frame(width: UIDevice.current.userInterfaceIdiom == .pad ? 800: 300) + .frame(width: UIScreen.main.bounds.width) + .padding(.horizontal, -horizontalCarouselPadding) + .ignoresSafeArea() + } + + var horizontalCarouselPadding: CGFloat { + let maxWidth = UIScreen.main.bounds.width + let carouselWidth = min(800, maxWidth) + let padding = maxWidth - carouselWidth + return max( + CGFloat(padding / 2.0), + 60 + ) } } From e0c117648168e2513f6e7c9cbe6f27e1794efbf5 Mon Sep 17 00:00:00 2001 From: Lasya <44485522+lasyaneti@users.noreply.github.com> Date: Tue, 8 Aug 2023 12:18:56 -0700 Subject: [PATCH 2/2] Empty commit to trigger build/lint workflow --- HackIllinois/SwiftUI/UI/HICarouselSwiftUIView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HackIllinois/SwiftUI/UI/HICarouselSwiftUIView.swift b/HackIllinois/SwiftUI/UI/HICarouselSwiftUIView.swift index fc7d3c22..878ccc6e 100644 --- a/HackIllinois/SwiftUI/UI/HICarouselSwiftUIView.swift +++ b/HackIllinois/SwiftUI/UI/HICarouselSwiftUIView.swift @@ -7,7 +7,7 @@ // This file is part of the Hackillinois iOS App. // The Hackillinois iOS App is open source software, released under the University of // Illinois/NCSA Open Source License. You should have received a copy of -// this license in a file with the distribution. +// this license in a file with the distribution. // import Foundation