special thanks and why bg mode will expand to show explanation when tapped

This commit is contained in:
Trey t
2022-01-23 11:28:31 -06:00
parent fc62413a53
commit a0a7c16c96
2 changed files with 35 additions and 9 deletions

View File

@@ -15,6 +15,9 @@ struct SettingsView: View {
@State private var showOnboarding = false @State private var showOnboarding = false
@State private var showSpecialThanks = false
@State private var showWhyBGMode = false
var body: some View { var body: some View {
ZStack { ZStack {
Color(UIColor.secondarySystemBackground) Color(UIColor.secondarySystemBackground)
@@ -22,15 +25,16 @@ struct SettingsView: View {
VStack { VStack {
closeButtonView closeButtonView
.padding() .padding()
randomShitCell
addTestDataCell addTestDataCell
clearDB clearDB
whyBackgroundMode
changeIcon changeIcon
showOnboardingButton showOnboardingButton
whyBackgroundMode
specialThanksCell
Spacer() Spacer()
} }
.padding() .padding()
}.sheet(isPresented: $showOnboarding) { }.sheet(isPresented: $showOnboarding) {
OnboardingMain(onboardingData: UserDefaultsStore.getOnboarding(), OnboardingMain(onboardingData: UserDefaultsStore.getOnboarding(),
updateBoardingDataClosure: { onboardingData in updateBoardingDataClosure: { onboardingData in
@@ -38,6 +42,7 @@ struct SettingsView: View {
showOnboarding = false showOnboarding = false
}) })
} }
.ignoresSafeArea()
} }
private var closeButtonView: some View { private var closeButtonView: some View {
@@ -53,16 +58,23 @@ struct SettingsView: View {
} }
} }
private var randomShitCell: some View { private var specialThanksCell: some View {
ZStack { ZStack {
Color(UIColor.systemBackground) Color(UIColor.systemBackground)
VStack { VStack {
Button(action: { Button(action: {
withAnimation{
showSpecialThanks.toggle()
}
}, label: { }, label: {
Text(String(localized: "settings_view_special_thanks_to")) Text(String(localized: "settings_view_special_thanks_to_title"))
}) })
.padding() .padding()
if showSpecialThanks {
Text(String(localized: "settings_view_special_thanks_to_body"))
.padding()
}
} }
} }
.fixedSize(horizontal: false, vertical: true) .fixedSize(horizontal: false, vertical: true)
@@ -102,8 +114,20 @@ struct SettingsView: View {
private var whyBackgroundMode: some View { private var whyBackgroundMode: some View {
ZStack { ZStack {
Color(UIColor.systemBackground) Color(UIColor.systemBackground)
Text(String(localized: "settings_view_why_bg_mode")) VStack {
.padding() Button(action: {
withAnimation{
showWhyBGMode.toggle()
}
}, label: {
Text(String(localized: "settings_view_why_bg_mode_title"))
})
.padding()
if showWhyBGMode {
Text(String(localized: "settings_view_why_bg_mode_body"))
.padding()
}
}
} }
.fixedSize(horizontal: false, vertical: true) .fixedSize(horizontal: false, vertical: true)
.clipShape(RoundedRectangle(cornerRadius: 25, style: .continuous)) .clipShape(RoundedRectangle(cornerRadius: 25, style: .continuous))

View File

@@ -44,8 +44,10 @@
"filter_view_end_date" = "End Date"; "filter_view_end_date" = "End Date";
"settings_view_exit" = "Exit"; "settings_view_exit" = "Exit";
"settings_view_special_thanks_to" = "Special thanks to"; "settings_view_special_thanks_to_title" = "Special thanks";
"settings_view_why_bg_mode" = "we do bg mode b/c we can"; "settings_view_special_thanks_to_body" = "Special body";
"settings_view_why_bg_mode_title" = "What do we use background task for?";
"settings_view_why_bg_mode_body" = "We use it to update the database for any missing day. For example: if you rate Monday and Wednesday you'll see that Tuesday will show on the view as missing, and by tapping that row you can then rate the day that is missing. We need a time to search for and add missing days, we do this nightly and while your device is not being used. It's a quick process and doesn't impact battery life.";
"settings_view_change_icon" = "Change Icon"; "settings_view_change_icon" = "Change Icon";
"settings_view_show_onboarding" = "Show onboarding"; "settings_view_show_onboarding" = "Show onboarding";