From a0a7c16c9675adb7033d25e583557c6a954d5f9b Mon Sep 17 00:00:00 2001 From: Trey t Date: Sun, 23 Jan 2022 11:28:31 -0600 Subject: [PATCH] special thanks and why bg mode will expand to show explanation when tapped --- Shared/views/SettingsView.swift | 38 +++++++++++++++++++++++++++------ en.lproj/Localizable.strings | 6 ++++-- 2 files changed, 35 insertions(+), 9 deletions(-) diff --git a/Shared/views/SettingsView.swift b/Shared/views/SettingsView.swift index f0bb3dc..4a648f8 100644 --- a/Shared/views/SettingsView.swift +++ b/Shared/views/SettingsView.swift @@ -15,6 +15,9 @@ struct SettingsView: View { @State private var showOnboarding = false + @State private var showSpecialThanks = false + @State private var showWhyBGMode = false + var body: some View { ZStack { Color(UIColor.secondarySystemBackground) @@ -22,15 +25,16 @@ struct SettingsView: View { VStack { closeButtonView .padding() - randomShitCell addTestDataCell clearDB - whyBackgroundMode changeIcon showOnboardingButton + whyBackgroundMode + specialThanksCell Spacer() } .padding() + }.sheet(isPresented: $showOnboarding) { OnboardingMain(onboardingData: UserDefaultsStore.getOnboarding(), updateBoardingDataClosure: { onboardingData in @@ -38,6 +42,7 @@ struct SettingsView: View { showOnboarding = false }) } + .ignoresSafeArea() } private var closeButtonView: some View { @@ -53,16 +58,23 @@ struct SettingsView: View { } } - private var randomShitCell: some View { + private var specialThanksCell: some View { ZStack { Color(UIColor.systemBackground) VStack { Button(action: { - + withAnimation{ + showSpecialThanks.toggle() + } }, label: { - Text(String(localized: "settings_view_special_thanks_to")) + Text(String(localized: "settings_view_special_thanks_to_title")) }) .padding() + + if showSpecialThanks { + Text(String(localized: "settings_view_special_thanks_to_body")) + .padding() + } } } .fixedSize(horizontal: false, vertical: true) @@ -102,8 +114,20 @@ struct SettingsView: View { private var whyBackgroundMode: some View { ZStack { Color(UIColor.systemBackground) - Text(String(localized: "settings_view_why_bg_mode")) - .padding() + VStack { + 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) .clipShape(RoundedRectangle(cornerRadius: 25, style: .continuous)) diff --git a/en.lproj/Localizable.strings b/en.lproj/Localizable.strings index e8a768f..8e38a93 100644 --- a/en.lproj/Localizable.strings +++ b/en.lproj/Localizable.strings @@ -44,8 +44,10 @@ "filter_view_end_date" = "End Date"; "settings_view_exit" = "Exit"; -"settings_view_special_thanks_to" = "Special thanks to"; -"settings_view_why_bg_mode" = "we do bg mode b/c we can"; +"settings_view_special_thanks_to_title" = "Special thanks"; +"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_show_onboarding" = "Show onboarding";