'Keep Screen Awake'-Setting, Acknowledge used libraries
This commit is contained in:
@@ -157,6 +157,14 @@ struct RecipeDetailView: View {
|
||||
fetchMode: UserSettings.shared.storeImages ? .preferServer : .onlyServer
|
||||
)
|
||||
}
|
||||
.onAppear {
|
||||
if UserSettings.shared.keepScreenAwake {
|
||||
UIApplication.shared.isIdleTimerDisabled = true
|
||||
}
|
||||
}
|
||||
.onDisappear {
|
||||
UIApplication.shared.isIdleTimerDisabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,6 +48,12 @@ struct SettingsView: View {
|
||||
Text("Configure which sections in your recipes are expanded by default.")
|
||||
}
|
||||
|
||||
Section {
|
||||
Toggle(isOn: $userSettings.keepScreenAwake) {
|
||||
Text("Keep screen awake when viewing recipes")
|
||||
}
|
||||
}
|
||||
|
||||
Section {
|
||||
Toggle(isOn: $userSettings.storeRecipes) {
|
||||
Text("Offline recipes")
|
||||
@@ -112,6 +118,23 @@ struct SettingsView: View {
|
||||
} footer: {
|
||||
Text("Deleting local data will not affect the recipe data stored on your server.")
|
||||
}
|
||||
|
||||
Section(header: Text("Acknowledgements")) {
|
||||
VStack(alignment: .leading) {
|
||||
if let url = URL(string: "https://github.com/scinfu/SwiftSoup") {
|
||||
Link("SwiftSoup", destination: url)
|
||||
.font(.headline)
|
||||
Text("An HTML parsing and web scraping library for Swift. Used for importing schema.org recipes from websites.")
|
||||
}
|
||||
}
|
||||
VStack(alignment: .leading) {
|
||||
if let url = URL(string: "https://github.com/techprimate/TPPDF") {
|
||||
Link("TPPDF", destination: url)
|
||||
.font(.headline)
|
||||
Text("A simple-to-use PDF builder for Swift. Used for generating recipe PDF documents.")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.navigationTitle("Settings")
|
||||
.alert(alertType.getTitle(), isPresented: $showAlert) {
|
||||
|
||||
Reference in New Issue
Block a user