icon switcher

close #13
This commit is contained in:
Trey t
2022-01-16 12:55:04 -06:00
parent 8bbd9fb6c4
commit 434dc33584
148 changed files with 1428 additions and 45 deletions

View File

@@ -32,6 +32,7 @@ struct SettingsView: View {
addTestDataCell
clearDB
whyBackgroundMode
changeIcon
Spacer()
}
.padding()
@@ -126,6 +127,48 @@ struct SettingsView: View {
.clipShape(RoundedRectangle(cornerRadius: 25, style: .continuous))
}
let iconSets: [(String,String)] = [
("PurpleFeelsAppIcon", "PurpleAppIcon"),
("RedFeelsAppIcon", "RedAppIcon")
]
private var changeIcon: some View {
ZStack {
Color(UIColor.systemBackground)
VStack {
Text("Change Icon")
HStack {
Button(action: {
UIApplication.shared.setAlternateIconName(nil)
}, label: {
Image("FeelsAppIcon", bundle: .main)
.resizable()
.frame(width: 50, height:50)
.cornerRadius(10)
})
.padding()
ForEach(iconSets, id: \.self.0){ iconSet in
Button(action: {
UIApplication.shared.setAlternateIconName(iconSet.1) { (error) in
// FIXME: Handle error
}
}, label: {
Image(iconSet.0, bundle: .main)
.resizable()
.frame(width: 50, height:50)
.cornerRadius(10)
})
.padding()
}
}
}
}
.fixedSize(horizontal: false, vertical: true)
.clipShape(RoundedRectangle(cornerRadius: 25, style: .continuous))
}
private func updateNotificationTimes(toDate date: Date) {
LocalNotification.removeNotificaiton()