mirror of
https://github.com/NinjaCheetah/RIT-Dining.git
synced 2026-03-03 12:45:28 -05:00
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.
This commit is contained in:
@@ -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..<openDates.count {
|
||||
@@ -269,13 +272,17 @@ func parseLocationInfo(location: DiningLocationParser, forDate: Date?) -> 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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
@@ -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.
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -91,7 +91,7 @@ struct MenuItemView: View {
|
||||
.foregroundStyle(.secondary)
|
||||
.textSelection(.enabled)
|
||||
}
|
||||
.padding(.horizontal, 8)
|
||||
.padding(.horizontal, 16)
|
||||
}
|
||||
.navigationTitle("Details")
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
|
||||
@@ -123,7 +123,7 @@ struct VisitingChefs: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
.padding(.horizontal, 8)
|
||||
.padding(.horizontal, 16)
|
||||
}
|
||||
.sheet(item: $safariUrl) { url in
|
||||
SafariView(url: url.url)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user