From 1902870e03e40d7d18c280053bca0b1ad1d236d1 Mon Sep 17 00:00:00 2001 From: NinjaCheetah <58050615+NinjaCheetah@users.noreply.github.com> Date: Wed, 28 Jan 2026 00:13:10 -0500 Subject: [PATCH] Increased padding around content in views This increased padding is roughly the same as the padding around native iOS components like lists, which makes it look a lot more uniform. The increased padding also makes everything feel a little less cramped. --- Shared/Components/TigerCenterParsers.swift | 24 ++++++++++++------- TigerDine.xcodeproj/project.pbxproj | 8 +++---- .../BackgroundRefresh.swift | 1 + TigerDine/Views/DetailView.swift | 14 ++++------- TigerDine/Views/FoodTruckView.swift | 2 +- TigerDine/Views/Fragments/LoadingView.swift | 13 +++++++++- TigerDine/Views/Menus/MenuItemView.swift | 2 +- .../Views/Visiting Chefs/VisitingChefs.swift | 2 +- TigerDineWidgets/Widgets/HoursWidget.swift | 9 +++---- 9 files changed, 46 insertions(+), 29 deletions(-) rename TigerDine/{Data => Components}/BackgroundRefresh.swift (94%) diff --git a/Shared/Components/TigerCenterParsers.swift b/Shared/Components/TigerCenterParsers.swift index 47ecd25..50886fc 100644 --- a/Shared/Components/TigerCenterParsers.swift +++ b/Shared/Components/TigerCenterParsers.swift @@ -87,7 +87,8 @@ func parseLocationInfo(location: DiningLocationParser, forDate: Date?) -> Dining diningTimes: nil, open: .closed, visitingChefs: nil, - dailySpecials: nil) + dailySpecials: nil + ) } var openStrings: [String] = [] @@ -160,13 +161,15 @@ func parseLocationInfo(location: DiningLocationParser, forDate: Date?) -> Dining bySettingHour: openTimeComponents.hour!, minute: openTimeComponents.minute!, second: openTimeComponents.second!, - of: now)!) + of: now)! + ) closeDates.append(calendar.date( bySettingHour: closeTimeComponents.hour!, minute: closeTimeComponents.minute!, second: closeTimeComponents.second!, - of: now)!) + of: now)! + ) } var diningTimes: [DiningTimes] = [] for i in 0.. Dining description: menu.description ?? "No description available", // Some don't have descriptions, apparently. openTime: openTime, closeTime: closeTime, - status: visitngChefStatus)) + status: visitngChefStatus) + ) } else if menu.category == "Daily Specials" { print("found daily special: \(menu.name)") let splitString = menu.name.split(separator: "(", maxSplits: 1) - specials.append(DailySpecial( - name: String(splitString[0]), - type: String(splitString.count > 1 ? String(splitString[1]) : "").replacingOccurrences(of: ")", with: ""))) + specials.append( + DailySpecial( + name: String(splitString[0]), + type: String(splitString.count > 1 ? String(splitString[1]) : "").replacingOccurrences(of: ")", with: "") + ) + ) } } visitingChefs = chefs @@ -297,7 +304,8 @@ func parseLocationInfo(location: DiningLocationParser, forDate: Date?) -> Dining diningTimes: diningTimes, open: openStatus, visitingChefs: visitingChefs, - dailySpecials: dailySpecials) + dailySpecials: dailySpecials + ) } extension DiningLocation { diff --git a/TigerDine.xcodeproj/project.pbxproj b/TigerDine.xcodeproj/project.pbxproj index e3f6682..d18f674 100644 --- a/TigerDine.xcodeproj/project.pbxproj +++ b/TigerDine.xcodeproj/project.pbxproj @@ -292,7 +292,7 @@ CODE_SIGN_ENTITLEMENTS = TigerDineWidgets/TigerDineWidgets.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 31; + CURRENT_PROJECT_VERSION = 32; DEVELOPMENT_TEAM = 5GF7GKNTK4; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = TigerDineWidgets/Info.plist; @@ -325,7 +325,7 @@ CODE_SIGN_ENTITLEMENTS = TigerDineWidgets/TigerDineWidgets.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 31; + CURRENT_PROJECT_VERSION = 32; DEVELOPMENT_TEAM = 5GF7GKNTK4; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = TigerDineWidgets/Info.plist; @@ -481,7 +481,7 @@ CODE_SIGN_ENTITLEMENTS = TigerDine/TigerDine.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 31; + CURRENT_PROJECT_VERSION = 32; DEVELOPMENT_TEAM = 5GF7GKNTK4; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; @@ -518,7 +518,7 @@ CODE_SIGN_ENTITLEMENTS = TigerDine/TigerDine.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 31; + CURRENT_PROJECT_VERSION = 32; DEVELOPMENT_TEAM = 5GF7GKNTK4; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; diff --git a/TigerDine/Data/BackgroundRefresh.swift b/TigerDine/Components/BackgroundRefresh.swift similarity index 94% rename from TigerDine/Data/BackgroundRefresh.swift rename to TigerDine/Components/BackgroundRefresh.swift index 2815ceb..85a687d 100644 --- a/TigerDine/Data/BackgroundRefresh.swift +++ b/TigerDine/Components/BackgroundRefresh.swift @@ -20,6 +20,7 @@ func scheduleNextRefresh() { do { try BGTaskScheduler.shared.submit(request) + print("background refresh scheduled successfully") } catch { print("failed to schedule background refresh: ", error) } diff --git a/TigerDine/Views/DetailView.swift b/TigerDine/Views/DetailView.swift index 245d1ba..2a65c76 100644 --- a/TigerDine/Views/DetailView.swift +++ b/TigerDine/Views/DetailView.swift @@ -137,7 +137,7 @@ struct DetailView: View { .font(.title3) #endif } - .padding(.bottom, 12) + .padding(.bottom, 16) if let visitingChefs = location.visitingChefs, !visitingChefs.isEmpty { VStack(alignment: .leading) { Text("Today's Visiting Chefs") @@ -172,7 +172,7 @@ struct DetailView: View { Divider() } } - .padding(.bottom, 12) + .padding(.bottom, 16) } if let dailySpecials = location.dailySpecials, !dailySpecials.isEmpty { VStack(alignment: .leading) { @@ -189,7 +189,7 @@ struct DetailView: View { Divider() } } - .padding(.bottom, 12) + .padding(.bottom, 16) } VStack(alignment: .leading) { Text("Upcoming Hours") @@ -209,16 +209,12 @@ struct DetailView: View { Divider() } } - .padding(.bottom, 12) + .padding(.bottom, 16) // Ideally I'd like this text to be justified to more effectively use the screen space. Text(location.desc) .font(.body) - .padding(.bottom, 10) - Text("IMPORTANT: Some locations' descriptions may refer to them as being cashless during certain hours. This is outdated information, as all RIT Dining locations are now cashless 24/7.") - .font(.callout) - .foregroundStyle(.secondary) } - .padding(.horizontal, 8) + .padding(.horizontal, 16) .toolbar { ToolbarItemGroup(placement: .primaryAction) { // Favorites toggle button. diff --git a/TigerDine/Views/FoodTruckView.swift b/TigerDine/Views/FoodTruckView.swift index f439d05..cbf25e6 100644 --- a/TigerDine/Views/FoodTruckView.swift +++ b/TigerDine/Views/FoodTruckView.swift @@ -55,7 +55,7 @@ struct FoodTruckView: View { Text("Food truck data is sourced directly from the RIT Events website, and may not be presented correctly. Use the globe button in the top right to access the RIT Events website directly to see the original source of the information.") .foregroundStyle(.secondary) } - .padding(.horizontal, 8) + .padding(.horizontal, 16) } .toolbar { ToolbarItemGroup(placement: .primaryAction) { diff --git a/TigerDine/Views/Fragments/LoadingView.swift b/TigerDine/Views/Fragments/LoadingView.swift index 9f9de23..82e1694 100644 --- a/TigerDine/Views/Fragments/LoadingView.swift +++ b/TigerDine/Views/Fragments/LoadingView.swift @@ -17,6 +17,7 @@ struct LoadingView: View { @State var loadingType: LoadingType = .normal @State private var rotationDegrees: Double = 0 + @State private var loadingText: String = "" private var animation: Animation { .linear @@ -33,6 +34,13 @@ struct LoadingView: View { } } + var loadingTextOptions: [String] = [ + "Loading...", + "One moment...", + "Hang tight...", + "Just a moment...", + ] + var body: some View { VStack { if loadFailed { @@ -55,8 +63,11 @@ struct LoadingView: View { rotationDegrees = 360.0 } } - Text("Loading...") + Text(loadingText) .foregroundStyle(.secondary) + .onAppear { + loadingText = loadingTextOptions.randomElement() ?? "" + } } } .padding() diff --git a/TigerDine/Views/Menus/MenuItemView.swift b/TigerDine/Views/Menus/MenuItemView.swift index 20852bd..385abc0 100644 --- a/TigerDine/Views/Menus/MenuItemView.swift +++ b/TigerDine/Views/Menus/MenuItemView.swift @@ -91,7 +91,7 @@ struct MenuItemView: View { .foregroundStyle(.secondary) .textSelection(.enabled) } - .padding(.horizontal, 8) + .padding(.horizontal, 16) } .navigationTitle("Details") .navigationBarTitleDisplayMode(.inline) diff --git a/TigerDine/Views/Visiting Chefs/VisitingChefs.swift b/TigerDine/Views/Visiting Chefs/VisitingChefs.swift index 808e33b..7f1f748 100644 --- a/TigerDine/Views/Visiting Chefs/VisitingChefs.swift +++ b/TigerDine/Views/Visiting Chefs/VisitingChefs.swift @@ -123,7 +123,7 @@ struct VisitingChefs: View { } } } - .padding(.horizontal, 8) + .padding(.horizontal, 16) } .sheet(item: $safariUrl) { url in SafariView(url: url.url) diff --git a/TigerDineWidgets/Widgets/HoursWidget.swift b/TigerDineWidgets/Widgets/HoursWidget.swift index 3fed118..cea2078 100644 --- a/TigerDineWidgets/Widgets/HoursWidget.swift +++ b/TigerDineWidgets/Widgets/HoursWidget.swift @@ -148,10 +148,11 @@ struct OpenWidgetEntryView : View { Text("Closing Soon") .foregroundStyle(.orange) } - - Text("\(dateDisplay.string(from: diningTimes[0].openTime)) - \(dateDisplay.string(from: diningTimes[0].closeTime))") - .font(.system(size: 15)) - .foregroundStyle(.secondary) + ForEach(diningTimes, id: \.self) { diningTime in + Text("\(dateDisplay.string(from: diningTime.openTime)) - \(dateDisplay.string(from: diningTime.closeTime))") + .font(.system(size: 14)) + .foregroundStyle(.secondary) + } } else { Text("Closed") .foregroundStyle(.red)