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,
|
diningTimes: nil,
|
||||||
open: .closed,
|
open: .closed,
|
||||||
visitingChefs: nil,
|
visitingChefs: nil,
|
||||||
dailySpecials: nil)
|
dailySpecials: nil
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
var openStrings: [String] = []
|
var openStrings: [String] = []
|
||||||
@@ -160,13 +161,15 @@ func parseLocationInfo(location: DiningLocationParser, forDate: Date?) -> Dining
|
|||||||
bySettingHour: openTimeComponents.hour!,
|
bySettingHour: openTimeComponents.hour!,
|
||||||
minute: openTimeComponents.minute!,
|
minute: openTimeComponents.minute!,
|
||||||
second: openTimeComponents.second!,
|
second: openTimeComponents.second!,
|
||||||
of: now)!)
|
of: now)!
|
||||||
|
)
|
||||||
|
|
||||||
closeDates.append(calendar.date(
|
closeDates.append(calendar.date(
|
||||||
bySettingHour: closeTimeComponents.hour!,
|
bySettingHour: closeTimeComponents.hour!,
|
||||||
minute: closeTimeComponents.minute!,
|
minute: closeTimeComponents.minute!,
|
||||||
second: closeTimeComponents.second!,
|
second: closeTimeComponents.second!,
|
||||||
of: now)!)
|
of: now)!
|
||||||
|
)
|
||||||
}
|
}
|
||||||
var diningTimes: [DiningTimes] = []
|
var diningTimes: [DiningTimes] = []
|
||||||
for i in 0..<openDates.count {
|
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.
|
description: menu.description ?? "No description available", // Some don't have descriptions, apparently.
|
||||||
openTime: openTime,
|
openTime: openTime,
|
||||||
closeTime: closeTime,
|
closeTime: closeTime,
|
||||||
status: visitngChefStatus))
|
status: visitngChefStatus)
|
||||||
|
)
|
||||||
} else if menu.category == "Daily Specials" {
|
} else if menu.category == "Daily Specials" {
|
||||||
print("found daily special: \(menu.name)")
|
print("found daily special: \(menu.name)")
|
||||||
let splitString = menu.name.split(separator: "(", maxSplits: 1)
|
let splitString = menu.name.split(separator: "(", maxSplits: 1)
|
||||||
specials.append(DailySpecial(
|
specials.append(
|
||||||
name: String(splitString[0]),
|
DailySpecial(
|
||||||
type: String(splitString.count > 1 ? String(splitString[1]) : "").replacingOccurrences(of: ")", with: "")))
|
name: String(splitString[0]),
|
||||||
|
type: String(splitString.count > 1 ? String(splitString[1]) : "").replacingOccurrences(of: ")", with: "")
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
visitingChefs = chefs
|
visitingChefs = chefs
|
||||||
@@ -297,7 +304,8 @@ func parseLocationInfo(location: DiningLocationParser, forDate: Date?) -> Dining
|
|||||||
diningTimes: diningTimes,
|
diningTimes: diningTimes,
|
||||||
open: openStatus,
|
open: openStatus,
|
||||||
visitingChefs: visitingChefs,
|
visitingChefs: visitingChefs,
|
||||||
dailySpecials: dailySpecials)
|
dailySpecials: dailySpecials
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
extension DiningLocation {
|
extension DiningLocation {
|
||||||
|
|||||||
@@ -292,7 +292,7 @@
|
|||||||
CODE_SIGN_ENTITLEMENTS = TigerDineWidgets/TigerDineWidgets.entitlements;
|
CODE_SIGN_ENTITLEMENTS = TigerDineWidgets/TigerDineWidgets.entitlements;
|
||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 31;
|
CURRENT_PROJECT_VERSION = 32;
|
||||||
DEVELOPMENT_TEAM = 5GF7GKNTK4;
|
DEVELOPMENT_TEAM = 5GF7GKNTK4;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
INFOPLIST_FILE = TigerDineWidgets/Info.plist;
|
INFOPLIST_FILE = TigerDineWidgets/Info.plist;
|
||||||
@@ -325,7 +325,7 @@
|
|||||||
CODE_SIGN_ENTITLEMENTS = TigerDineWidgets/TigerDineWidgets.entitlements;
|
CODE_SIGN_ENTITLEMENTS = TigerDineWidgets/TigerDineWidgets.entitlements;
|
||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 31;
|
CURRENT_PROJECT_VERSION = 32;
|
||||||
DEVELOPMENT_TEAM = 5GF7GKNTK4;
|
DEVELOPMENT_TEAM = 5GF7GKNTK4;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
INFOPLIST_FILE = TigerDineWidgets/Info.plist;
|
INFOPLIST_FILE = TigerDineWidgets/Info.plist;
|
||||||
@@ -481,7 +481,7 @@
|
|||||||
CODE_SIGN_ENTITLEMENTS = TigerDine/TigerDine.entitlements;
|
CODE_SIGN_ENTITLEMENTS = TigerDine/TigerDine.entitlements;
|
||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 31;
|
CURRENT_PROJECT_VERSION = 32;
|
||||||
DEVELOPMENT_TEAM = 5GF7GKNTK4;
|
DEVELOPMENT_TEAM = 5GF7GKNTK4;
|
||||||
ENABLE_PREVIEWS = YES;
|
ENABLE_PREVIEWS = YES;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
@@ -518,7 +518,7 @@
|
|||||||
CODE_SIGN_ENTITLEMENTS = TigerDine/TigerDine.entitlements;
|
CODE_SIGN_ENTITLEMENTS = TigerDine/TigerDine.entitlements;
|
||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 31;
|
CURRENT_PROJECT_VERSION = 32;
|
||||||
DEVELOPMENT_TEAM = 5GF7GKNTK4;
|
DEVELOPMENT_TEAM = 5GF7GKNTK4;
|
||||||
ENABLE_PREVIEWS = YES;
|
ENABLE_PREVIEWS = YES;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ func scheduleNextRefresh() {
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
try BGTaskScheduler.shared.submit(request)
|
try BGTaskScheduler.shared.submit(request)
|
||||||
|
print("background refresh scheduled successfully")
|
||||||
} catch {
|
} catch {
|
||||||
print("failed to schedule background refresh: ", error)
|
print("failed to schedule background refresh: ", error)
|
||||||
}
|
}
|
||||||
@@ -137,7 +137,7 @@ struct DetailView: View {
|
|||||||
.font(.title3)
|
.font(.title3)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
.padding(.bottom, 12)
|
.padding(.bottom, 16)
|
||||||
if let visitingChefs = location.visitingChefs, !visitingChefs.isEmpty {
|
if let visitingChefs = location.visitingChefs, !visitingChefs.isEmpty {
|
||||||
VStack(alignment: .leading) {
|
VStack(alignment: .leading) {
|
||||||
Text("Today's Visiting Chefs")
|
Text("Today's Visiting Chefs")
|
||||||
@@ -172,7 +172,7 @@ struct DetailView: View {
|
|||||||
Divider()
|
Divider()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.padding(.bottom, 12)
|
.padding(.bottom, 16)
|
||||||
}
|
}
|
||||||
if let dailySpecials = location.dailySpecials, !dailySpecials.isEmpty {
|
if let dailySpecials = location.dailySpecials, !dailySpecials.isEmpty {
|
||||||
VStack(alignment: .leading) {
|
VStack(alignment: .leading) {
|
||||||
@@ -189,7 +189,7 @@ struct DetailView: View {
|
|||||||
Divider()
|
Divider()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.padding(.bottom, 12)
|
.padding(.bottom, 16)
|
||||||
}
|
}
|
||||||
VStack(alignment: .leading) {
|
VStack(alignment: .leading) {
|
||||||
Text("Upcoming Hours")
|
Text("Upcoming Hours")
|
||||||
@@ -209,16 +209,12 @@ struct DetailView: View {
|
|||||||
Divider()
|
Divider()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.padding(.bottom, 12)
|
.padding(.bottom, 16)
|
||||||
// Ideally I'd like this text to be justified to more effectively use the screen space.
|
// Ideally I'd like this text to be justified to more effectively use the screen space.
|
||||||
Text(location.desc)
|
Text(location.desc)
|
||||||
.font(.body)
|
.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 {
|
.toolbar {
|
||||||
ToolbarItemGroup(placement: .primaryAction) {
|
ToolbarItemGroup(placement: .primaryAction) {
|
||||||
// Favorites toggle button.
|
// 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.")
|
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)
|
.foregroundStyle(.secondary)
|
||||||
}
|
}
|
||||||
.padding(.horizontal, 8)
|
.padding(.horizontal, 16)
|
||||||
}
|
}
|
||||||
.toolbar {
|
.toolbar {
|
||||||
ToolbarItemGroup(placement: .primaryAction) {
|
ToolbarItemGroup(placement: .primaryAction) {
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ struct LoadingView: View {
|
|||||||
@State var loadingType: LoadingType = .normal
|
@State var loadingType: LoadingType = .normal
|
||||||
|
|
||||||
@State private var rotationDegrees: Double = 0
|
@State private var rotationDegrees: Double = 0
|
||||||
|
@State private var loadingText: String = ""
|
||||||
|
|
||||||
private var animation: Animation {
|
private var animation: Animation {
|
||||||
.linear
|
.linear
|
||||||
@@ -33,6 +34,13 @@ struct LoadingView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var loadingTextOptions: [String] = [
|
||||||
|
"Loading...",
|
||||||
|
"One moment...",
|
||||||
|
"Hang tight...",
|
||||||
|
"Just a moment...",
|
||||||
|
]
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VStack {
|
VStack {
|
||||||
if loadFailed {
|
if loadFailed {
|
||||||
@@ -55,8 +63,11 @@ struct LoadingView: View {
|
|||||||
rotationDegrees = 360.0
|
rotationDegrees = 360.0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Text("Loading...")
|
Text(loadingText)
|
||||||
.foregroundStyle(.secondary)
|
.foregroundStyle(.secondary)
|
||||||
|
.onAppear {
|
||||||
|
loadingText = loadingTextOptions.randomElement() ?? ""
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.padding()
|
.padding()
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ struct MenuItemView: View {
|
|||||||
.foregroundStyle(.secondary)
|
.foregroundStyle(.secondary)
|
||||||
.textSelection(.enabled)
|
.textSelection(.enabled)
|
||||||
}
|
}
|
||||||
.padding(.horizontal, 8)
|
.padding(.horizontal, 16)
|
||||||
}
|
}
|
||||||
.navigationTitle("Details")
|
.navigationTitle("Details")
|
||||||
.navigationBarTitleDisplayMode(.inline)
|
.navigationBarTitleDisplayMode(.inline)
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ struct VisitingChefs: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.padding(.horizontal, 8)
|
.padding(.horizontal, 16)
|
||||||
}
|
}
|
||||||
.sheet(item: $safariUrl) { url in
|
.sheet(item: $safariUrl) { url in
|
||||||
SafariView(url: url.url)
|
SafariView(url: url.url)
|
||||||
|
|||||||
@@ -148,10 +148,11 @@ struct OpenWidgetEntryView : View {
|
|||||||
Text("Closing Soon")
|
Text("Closing Soon")
|
||||||
.foregroundStyle(.orange)
|
.foregroundStyle(.orange)
|
||||||
}
|
}
|
||||||
|
ForEach(diningTimes, id: \.self) { diningTime in
|
||||||
Text("\(dateDisplay.string(from: diningTimes[0].openTime)) - \(dateDisplay.string(from: diningTimes[0].closeTime))")
|
Text("\(dateDisplay.string(from: diningTime.openTime)) - \(dateDisplay.string(from: diningTime.closeTime))")
|
||||||
.font(.system(size: 15))
|
.font(.system(size: 14))
|
||||||
.foregroundStyle(.secondary)
|
.foregroundStyle(.secondary)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Text("Closed")
|
Text("Closed")
|
||||||
.foregroundStyle(.red)
|
.foregroundStyle(.red)
|
||||||
|
|||||||
Reference in New Issue
Block a user