improve settings UI + find wallpapers on home page
This commit is contained in:
1 parent
b0db8da590
commit
dcd368817d
2 files changed
+38
-33
No files matched your search
@@ -106,6 +106,13 @@ struct ContentView: View {
|
|||||||
.padding()
|
.padding()
|
||||||
.navigationTitle("Pocket Poster")
|
.navigationTitle("Pocket Poster")
|
||||||
.toolbar {
|
.toolbar {
|
||||||
|
ToolbarItem(placement: .topBarLeading) {
|
||||||
|
if let wpURL = URL(string: PosterBoardManager.WallpapersURL) {
|
||||||
|
Link(destination: wpURL) {
|
||||||
|
Image(systemName: "safari")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
ToolbarItem(placement: .topBarTrailing, content: {
|
ToolbarItem(placement: .topBarTrailing, content: {
|
||||||
NavigationLink(destination: {
|
NavigationLink(destination: {
|
||||||
SettingsView()
|
SettingsView()
|
||||||
|
|||||||
@@ -19,35 +19,35 @@ struct SettingsView: View {
|
|||||||
@State var errorAlertDescr: String?
|
@State var errorAlertDescr: String?
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
ScrollView {
|
List {
|
||||||
Section {
|
Section {
|
||||||
HStack {
|
VStack {
|
||||||
// Add button to run task to check until file exists from Nugget pc over AFC
|
TextField("Enter App Hash", text: $pbHash)
|
||||||
Text("App Hash:")
|
.textFieldStyle(RoundedBorderTextFieldStyle())
|
||||||
.font(.headline)
|
.font(.system(.body, design: .monospaced))
|
||||||
.foregroundColor(.primary)
|
HStack {
|
||||||
Spacer()
|
Spacer()
|
||||||
Button(action: {
|
// Run task to check until file exists from Nugget pc over AFC
|
||||||
UIApplication.shared.confirmAlert(title: "Waiting for app hash...", body: "Connect your device to Nugget and click the \"Pocket Poster Helper\" button.", confirmTitle: "Cancel", onOK: {
|
Button(action: {
|
||||||
cancelWaitForHash()
|
UIApplication.shared.confirmAlert(title: "Waiting for app hash...", body: "Connect your device to Nugget and click the \"Pocket Poster Helper\" button.", confirmTitle: "Cancel", onOK: {
|
||||||
}, noCancel: true)
|
cancelWaitForHash()
|
||||||
startWaitForHash()
|
}, noCancel: true)
|
||||||
}) {
|
startWaitForHash()
|
||||||
Text("Detect")
|
}) {
|
||||||
}
|
Text("Detect")
|
||||||
.buttonStyle(TintedButton(color: .green, fullwidth: false))
|
}
|
||||||
.onChange(of: checkingForHash) {
|
.foregroundStyle(.green)
|
||||||
if !checkingForHash {
|
.onChange(of: checkingForHash) {
|
||||||
// hide ui
|
if !checkingForHash {
|
||||||
UIApplication.shared.dismissAlert(animated: true)
|
// hide ui alert
|
||||||
|
UIApplication.shared.dismissAlert(animated: true)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TextField("Enter App Hash", text: $pbHash)
|
} header: {
|
||||||
.textFieldStyle(RoundedBorderTextFieldStyle())
|
Label("App Hash", systemImage: "lock.app.dashed")
|
||||||
.font(.system(.body, design: .monospaced))
|
|
||||||
}
|
}
|
||||||
.padding(.bottom, 5)
|
|
||||||
|
|
||||||
Section {
|
Section {
|
||||||
Button(action: {
|
Button(action: {
|
||||||
@@ -56,7 +56,6 @@ struct SettingsView: View {
|
|||||||
}) {
|
}) {
|
||||||
Text("Replay Tutorial")
|
Text("Replay Tutorial")
|
||||||
}
|
}
|
||||||
.buttonStyle(TintedButton(color: .blue, fullwidth: true))
|
|
||||||
|
|
||||||
Button(action: {
|
Button(action: {
|
||||||
UIImpactFeedbackGenerator(style: .soft).impactOccurred()
|
UIImpactFeedbackGenerator(style: .soft).impactOccurred()
|
||||||
@@ -75,31 +74,30 @@ struct SettingsView: View {
|
|||||||
}) {
|
}) {
|
||||||
Text("Clear App Cache")
|
Text("Clear App Cache")
|
||||||
}
|
}
|
||||||
.buttonStyle(TintedButton(color: .red, fullwidth: true))
|
.foregroundStyle(.red)
|
||||||
|
} header: {
|
||||||
|
Label("Actions", systemImage: "gear")
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: Links
|
// MARK: Links
|
||||||
Section {
|
Section {
|
||||||
if let scURL = URL(string: PosterBoardManager.ShortcutURL) {
|
if let scURL = URL(string: PosterBoardManager.ShortcutURL) {
|
||||||
Link(destination: scURL) {
|
Link(destination: scURL) {
|
||||||
Text("Download Shortcut")
|
Label("Download Shortcut", systemImage: "arrow.down.circle")
|
||||||
}
|
}
|
||||||
.buttonStyle(TintedButton(color: .blue, fullwidth: true))
|
|
||||||
}
|
}
|
||||||
if let fbURL = URL(string: "shortcuts://run-shortcut?name=PosterBoard&input=text&text=troubleshoot") {
|
if let fbURL = URL(string: "shortcuts://run-shortcut?name=PosterBoard&input=text&text=troubleshoot") {
|
||||||
Link(destination: fbURL) {
|
Link(destination: fbURL) {
|
||||||
Text("Create Fallback Method")
|
Label("Create Fallback Method", systemImage: "appclip")
|
||||||
}
|
}
|
||||||
.buttonStyle(TintedButton(color: .blue, fullwidth: true))
|
|
||||||
}
|
}
|
||||||
if let wpURL = URL(string: PosterBoardManager.WallpapersURL) {
|
if let wpURL = URL(string: PosterBoardManager.WallpapersURL) {
|
||||||
Link(destination: wpURL) {
|
Link(destination: wpURL) {
|
||||||
Text("Find Wallpapers")
|
Label("Find Wallpapers", systemImage: "safari")
|
||||||
}
|
}
|
||||||
.buttonStyle(TintedButton(color: .blue, fullwidth: true))
|
|
||||||
}
|
}
|
||||||
} header: {
|
} header: {
|
||||||
Text("Links")
|
Label("Links", systemImage: "link")
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Credits
|
// TODO: Credits
|
||||||
|
|||||||
Reference in new issue
Block a user