Merge branch 'develop'

This commit is contained in:
Trey t
2022-02-27 15:59:02 -06:00
14 changed files with 97 additions and 119 deletions

View File

@@ -43,7 +43,7 @@
1C358FBE27B4D1F2002C83A6 /* CurrentStreakTemplate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C358FBD27B4D1F2002C83A6 /* CurrentStreakTemplate.swift */; }; 1C358FBE27B4D1F2002C83A6 /* CurrentStreakTemplate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C358FBD27B4D1F2002C83A6 /* CurrentStreakTemplate.swift */; };
1C358FC027B4D20C002C83A6 /* MonthTotalTemplate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C358FBF27B4D20C002C83A6 /* MonthTotalTemplate.swift */; }; 1C358FC027B4D20C002C83A6 /* MonthTotalTemplate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C358FBF27B4D20C002C83A6 /* MonthTotalTemplate.swift */; };
1C358FC227B4D227002C83A6 /* WeekTotalTemplate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C358FC127B4D227002C83A6 /* WeekTotalTemplate.swift */; }; 1C358FC227B4D227002C83A6 /* WeekTotalTemplate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C358FC127B4D227002C83A6 /* WeekTotalTemplate.swift */; };
1C361F0A27C0356000E832FC /* HomeViewTwo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C361F0927C0356000E832FC /* HomeViewTwo.swift */; }; 1C361F0A27C0356000E832FC /* MonthView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C361F0927C0356000E832FC /* MonthView.swift */; };
1C361F0C27C0356B00E832FC /* MainTabView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C361F0B27C0356B00E832FC /* MainTabView.swift */; }; 1C361F0C27C0356B00E832FC /* MainTabView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C361F0B27C0356B00E832FC /* MainTabView.swift */; };
1C361F0D27C03BDF00E832FC /* OnboardingData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C5F4975279C84090092F1B4 /* OnboardingData.swift */; }; 1C361F0D27C03BDF00E832FC /* OnboardingData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C5F4975279C84090092F1B4 /* OnboardingData.swift */; };
1C361F0F27C03C0E00E832FC /* LocalNotification.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1CD90B75278C8119001C4FEA /* LocalNotification.swift */; }; 1C361F0F27C03C0E00E832FC /* LocalNotification.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1CD90B75278C8119001C4FEA /* LocalNotification.swift */; };
@@ -192,7 +192,7 @@
1C358FBD27B4D1F2002C83A6 /* CurrentStreakTemplate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CurrentStreakTemplate.swift; sourceTree = "<group>"; }; 1C358FBD27B4D1F2002C83A6 /* CurrentStreakTemplate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CurrentStreakTemplate.swift; sourceTree = "<group>"; };
1C358FBF27B4D20C002C83A6 /* MonthTotalTemplate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MonthTotalTemplate.swift; sourceTree = "<group>"; }; 1C358FBF27B4D20C002C83A6 /* MonthTotalTemplate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MonthTotalTemplate.swift; sourceTree = "<group>"; };
1C358FC127B4D227002C83A6 /* WeekTotalTemplate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WeekTotalTemplate.swift; sourceTree = "<group>"; }; 1C358FC127B4D227002C83A6 /* WeekTotalTemplate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WeekTotalTemplate.swift; sourceTree = "<group>"; };
1C361F0927C0356000E832FC /* HomeViewTwo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeViewTwo.swift; sourceTree = "<group>"; }; 1C361F0927C0356000E832FC /* MonthView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MonthView.swift; sourceTree = "<group>"; };
1C361F0B27C0356B00E832FC /* MainTabView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainTabView.swift; sourceTree = "<group>"; }; 1C361F0B27C0356B00E832FC /* MainTabView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainTabView.swift; sourceTree = "<group>"; };
1C361F1327C03C8600E832FC /* OnboardingDataDataManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingDataDataManager.swift; sourceTree = "<group>"; }; 1C361F1327C03C8600E832FC /* OnboardingDataDataManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingDataDataManager.swift; sourceTree = "<group>"; };
1C361F1627C046D800E832FC /* MonthDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MonthDetailView.swift; sourceTree = "<group>"; }; 1C361F1627C046D800E832FC /* MonthDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MonthDetailView.swift; sourceTree = "<group>"; };
@@ -312,7 +312,6 @@
children = ( children = (
1CAD603227A5C1C800C520BD /* HomeView.swift */, 1CAD603227A5C1C800C520BD /* HomeView.swift */,
1CA0376F2799FFA600D26164 /* HomeViewViewModel.swift */, 1CA0376F2799FFA600D26164 /* HomeViewViewModel.swift */,
1C361F1827C046E400E832FC /* HomeViewTwo */,
); );
path = HomeView; path = HomeView;
sourceTree = "<group>"; sourceTree = "<group>";
@@ -391,13 +390,13 @@
path = SharingTemplates; path = SharingTemplates;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
1C361F1827C046E400E832FC /* HomeViewTwo */ = { 1C4DAA7327CC263F00C25D2B /* MonthView */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
1C361F0927C0356000E832FC /* HomeViewTwo.swift */, 1C361F0927C0356000E832FC /* MonthView.swift */,
1C361F1627C046D800E832FC /* MonthDetailView.swift */, 1C361F1627C046D800E832FC /* MonthDetailView.swift */,
); );
path = HomeViewTwo; path = MonthView;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
1C4FF3C527BEE07800BE8F34 /* Persisence */ = { 1C4FF3C527BEE07800BE8F34 /* Persisence */ = {
@@ -451,6 +450,7 @@
1CAD603327A5C1C800C520BD /* HeaderStatsView.swift */, 1CAD603327A5C1C800C520BD /* HeaderStatsView.swift */,
1C04488F27C2CA9C00D22444 /* HomeView */, 1C04488F27C2CA9C00D22444 /* HomeView */,
1C361F0B27C0356B00E832FC /* MainTabView.swift */, 1C361F0B27C0356B00E832FC /* MainTabView.swift */,
1C4DAA7327CC263F00C25D2B /* MonthView */,
1C04489327C2CABF00D22444 /* SettingsView */, 1C04489327C2CABF00D22444 /* SettingsView */,
1C04489527C2CB1A00D22444 /* Sharing */, 1C04489527C2CB1A00D22444 /* Sharing */,
1C358FB427B0ADF3002C83A6 /* SharingTemplates */, 1C358FB427B0ADF3002C83A6 /* SharingTemplates */,
@@ -838,7 +838,7 @@
1C361F0C27C0356B00E832FC /* MainTabView.swift in Sources */, 1C361F0C27C0356B00E832FC /* MainTabView.swift in Sources */,
1CEC967127B9C2BB00CC8688 /* CustomWidgetModel.swift in Sources */, 1CEC967127B9C2BB00CC8688 /* CustomWidgetModel.swift in Sources */,
1C2162EE27C15191004353D1 /* MoodEntryFunctions.swift in Sources */, 1C2162EE27C15191004353D1 /* MoodEntryFunctions.swift in Sources */,
1C361F0A27C0356000E832FC /* HomeViewTwo.swift in Sources */, 1C361F0A27C0356000E832FC /* MonthView.swift in Sources */,
1C361F1427C03C8600E832FC /* OnboardingDataDataManager.swift in Sources */, 1C361F1427C03C8600E832FC /* OnboardingDataDataManager.swift in Sources */,
1C358FAD27ADD0C3002C83A6 /* Theme.swift in Sources */, 1C358FAD27ADD0C3002C83A6 /* Theme.swift in Sources */,
1C2162EB27C14EFA004353D1 /* Date+Extensions.swift in Sources */, 1C2162EB27C14EFA004353D1 /* Date+Extensions.swift in Sources */,

View File

@@ -31,12 +31,11 @@ class LocalNotification {
public class func rescheduleNotifiations() { public class func rescheduleNotifiations() {
if let data = GroupUserDefaults.groupDefaults.object(forKey: UserDefaultsStore.Keys.savedOnboardingData.rawValue) as? Data, if let data = GroupUserDefaults.groupDefaults.object(forKey: UserDefaultsStore.Keys.savedOnboardingData.rawValue) as? Data,
let model = try? JSONDecoder().decode(OnboardingData.self, from: data) { let model = try? JSONDecoder().decode(OnboardingData.self, from: data) {
LocalNotification.scheduleReminder(atTime: model.date, LocalNotification.scheduleReminder(atTime: model.date)
withTitle: model.title)
} }
} }
public class func scheduleReminder(atTime time: Date, withTitle title: String) { public class func scheduleReminder(atTime time: Date) {
self.removeNotificaiton() self.removeNotificaiton()
LocalNotification.testIfEnabled(completion: { result in LocalNotification.testIfEnabled(completion: { result in

View File

@@ -15,6 +15,6 @@ final class OnboardingDataDataManager: ObservableObject {
public func updateOnboardingData(onboardingData: OnboardingData) { public func updateOnboardingData(onboardingData: OnboardingData) {
let onboardingData = UserDefaultsStore.saveOnboarding(onboardingData: onboardingData) let onboardingData = UserDefaultsStore.saveOnboarding(onboardingData: onboardingData)
savedOnboardingData = onboardingData savedOnboardingData = onboardingData
LocalNotification.scheduleReminder(atTime: onboardingData.date, withTitle: onboardingData.title) LocalNotification.scheduleReminder(atTime: onboardingData.date)
} }
} }

View File

@@ -173,36 +173,5 @@ class UserDefaultsStore {
fatalError("error saving") fatalError("error saving")
} }
} }
@discardableResult
static func makeWidgetCurrent(withUUID uuid: String) -> [CustomWidgetModel] {
do {
let existingWidgets = getCustomWidgets()
if let foundWidget = existingWidgets.first(where: {
$0.uuid == uuid
}) {
existingWidgets.forEach({
$0.inUse = false
})
foundWidget.inUse = true
} else {
if let first = existingWidgets.first {
first.inUse = true
}
}
existingWidgets.forEach({
$0.isSaved = true
})
let data = try JSONEncoder().encode(existingWidgets)
GroupUserDefaults.groupDefaults.set(data, forKey: UserDefaultsStore.Keys.customWidget.rawValue)
return UserDefaultsStore.getCustomWidgets()
} catch {
fatalError("error saving")
}
}
} }

View File

@@ -13,10 +13,9 @@ import UserNotifications
final class OnboardingData: NSObject, ObservableObject, Codable { final class OnboardingData: NSObject, ObservableObject, Codable {
@Published var date: Date = Date() @Published var date: Date = Date()
@Published var inputDay: DayOptions = .Today @Published var inputDay: DayOptions = .Today
@Published var title: String = OnboardingTitle.titleOptions[0]
enum CodingKeys: CodingKey { enum CodingKeys: CodingKey {
case date, inputDay, title case date, inputDay
} }
func encode(to encoder: Encoder) throws { func encode(to encoder: Encoder) throws {
@@ -24,7 +23,6 @@ final class OnboardingData: NSObject, ObservableObject, Codable {
try container.encode(date, forKey: .date) try container.encode(date, forKey: .date)
try container.encode(inputDay, forKey: .inputDay) try container.encode(inputDay, forKey: .inputDay)
try container.encode(title, forKey: .title)
} }
required init(from decoder: Decoder) throws { required init(from decoder: Decoder) throws {
@@ -32,7 +30,6 @@ final class OnboardingData: NSObject, ObservableObject, Codable {
date = try container.decode(Date.self, forKey: .date) date = try container.decode(Date.self, forKey: .date)
inputDay = try container.decode(DayOptions.self, forKey: .inputDay) inputDay = try container.decode(DayOptions.self, forKey: .inputDay)
title = try container.decode(String.self, forKey: .title)
} }
func ableToVoteBasedOnCurentTime() -> Bool { func ableToVoteBasedOnCurentTime() -> Bool {
@@ -70,7 +67,6 @@ extension OnboardingData: RawRepresentable {
self.date = result.date self.date = result.date
self.inputDay = result.inputDay self.inputDay = result.inputDay
self.title = result.title
} }
public var rawValue: String { public var rawValue: String {

View File

@@ -19,7 +19,7 @@ struct OnboardingMain: View {
OnboardingDay(onboardingData: onboardingData) OnboardingDay(onboardingData: onboardingData)
OnboardingTitle(onboardingData: onboardingData) // OnboardingTitle(onboardingData: onboardingData)
OnboardingWrapup(onboardingData: onboardingData, OnboardingWrapup(onboardingData: onboardingData,
completionClosure: { _ in completionClosure: { _ in

View File

@@ -34,7 +34,7 @@ struct OnboardingTitle: View {
ForEach(OnboardingTitle.titleOptions, id: \.self) { option in ForEach(OnboardingTitle.titleOptions, id: \.self) { option in
Button(action: { Button(action: {
onboardingData.title = option // onboardingData.title = option
}, label: { }, label: {
Text(option) Text(option)
.font(.system(size: 15)) .font(.system(size: 15))
@@ -54,15 +54,15 @@ struct OnboardingTitle: View {
.padding([.top], 25) .padding([.top], 25)
.padding([.trailing, .leading], 55) .padding([.trailing, .leading], 55)
TextField("Notification", text: $onboardingData.title) // TextField("Notification", text: $onboardingData.title)
.frame(height: 44) // .frame(height: 44)
.foregroundColor(Color(UIColor.white)) // .foregroundColor(Color(UIColor.white))
.textFieldStyle(PlainTextFieldStyle()) // .textFieldStyle(PlainTextFieldStyle())
.padding([.leading, .trailing], 4) // .padding([.leading, .trailing], 4)
.cornerRadius(16) // .cornerRadius(16)
.overlay(RoundedRectangle(cornerRadius: 16).stroke(Color.white)) // .overlay(RoundedRectangle(cornerRadius: 16).stroke(Color.white))
.padding([.leading, .trailing], 75) // .padding([.leading, .trailing], 75)
.padding([.top], 45) // .padding([.top], 45)
Spacer() Spacer()
} }

View File

@@ -44,18 +44,18 @@ struct OnboardingWrapup: View {
.padding([.trailing, .leading], 55) .padding([.trailing, .leading], 55)
.padding([.top], 15) .padding([.top], 15)
Text(String(localized: "onboarding_wrap_up_2")) // Text(String(localized: "onboarding_wrap_up_2"))
.font(.title) // .font(.title)
.foregroundColor(Color(UIColor.white)) // .foregroundColor(Color(UIColor.white))
.padding([.trailing, .leading], 55) // .padding([.trailing, .leading], 55)
.padding([.top], 15) // .padding([.top], 15)
Text(onboardingData.title) // Text(onboardingData.title)
.font(.title) // .font(.title)
.fontWeight(.bold) // .fontWeight(.bold)
.foregroundColor(Color(UIColor.white)) // .foregroundColor(Color(UIColor.white))
.padding([.trailing, .leading], 55) // .padding([.trailing, .leading], 55)
.padding([.top], 15) // .padding([.top], 15)
Text(String(localized: "onboarding_wrap_up_3")) Text(String(localized: "onboarding_wrap_up_3"))
.font(.title) .font(.title)

View File

@@ -12,11 +12,11 @@ struct CreateWidgetView: View {
@Environment(\.dismiss) var dismiss @Environment(\.dismiss) var dismiss
@StateObject private var customWidget: CustomWidgetModel @StateObject private var customWidget: CustomWidgetModel
@State private var mouth: CustomWidgetMouthOptions = CustomWidgetMouthOptions.defaultOption @State private var mouth: CustomWidgetMouthOptions = CustomWidgetMouthOptions.defaultOption
@State var widgetView: CustomWidgetView @State var widgetView: CustomWidgetView
private var randomElements: [AnyView] private var randomElements: [AnyView]
init(customWidget: CustomWidgetModel, randomElements: [AnyView] = [AnyView]()) { init(customWidget: CustomWidgetModel, randomElements: [AnyView] = [AnyView]()) {
@@ -106,7 +106,7 @@ struct CreateWidgetView: View {
HStack(alignment: .center) { HStack(alignment: .center) {
Spacer() Spacer()
VStack(alignment: .center) { VStack(alignment: .center) {
Menu("Left Eye") { Menu(String(localized: "create_widget_view_left_eye")) {
ForEach(CustomWidgetEyeOptions.allCases, id: \.self) { option in ForEach(CustomWidgetEyeOptions.allCases, id: \.self) { option in
Button(action: { Button(action: {
update(eye: .left, eyeOption: option) update(eye: .left, eyeOption: option)
@@ -119,7 +119,7 @@ struct CreateWidgetView: View {
} }
Spacer() Spacer()
VStack(alignment: .center) { VStack(alignment: .center) {
Menu("Right Eye") { Menu(String(localized: "create_widget_view_right_eye")) {
ForEach(CustomWidgetEyeOptions.allCases, id: \.self) { option in ForEach(CustomWidgetEyeOptions.allCases, id: \.self) { option in
Button(action: { Button(action: {
update(eye: .right, eyeOption: option) update(eye: .right, eyeOption: option)
@@ -132,7 +132,7 @@ struct CreateWidgetView: View {
} }
Spacer() Spacer()
VStack(alignment: .center) { VStack(alignment: .center) {
Menu("Mouth") { Menu(String(localized: "create_widget_view_mouth")) {
ForEach(CustomWidgetMouthOptions.allCases, id: \.self) { option in ForEach(CustomWidgetMouthOptions.allCases, id: \.self) { option in
Button(action: { Button(action: {
update(mouthOption: option) update(mouthOption: option)
@@ -186,21 +186,21 @@ struct CreateWidgetView: View {
VStack { VStack {
HStack(spacing: 0) { HStack(spacing: 0) {
VStack(alignment: .center) { VStack(alignment: .center) {
Text("background") Text(String(localized: "create_widget_background_color"))
ColorPicker("", selection: $customWidget.bgColor) ColorPicker("", selection: $customWidget.bgColor)
.labelsHidden() .labelsHidden()
} }
.frame(minWidth: 0, maxWidth: .infinity) .frame(minWidth: 0, maxWidth: .infinity)
VStack(alignment: .center) { VStack(alignment: .center) {
Text("Inner") Text(String(localized: "create_widget_inner_color"))
ColorPicker("", selection: $customWidget.innerColor) ColorPicker("", selection: $customWidget.innerColor)
.labelsHidden() .labelsHidden()
} }
.frame(minWidth: 0, maxWidth: .infinity) .frame(minWidth: 0, maxWidth: .infinity)
VStack(alignment: .center) { VStack(alignment: .center) {
Text("Face Outline") Text(String(localized: "create_widget_face_outline_color"))
ColorPicker("", selection: $customWidget.circleStrokeColor) ColorPicker("", selection: $customWidget.circleStrokeColor)
.labelsHidden() .labelsHidden()
} }
@@ -209,21 +209,21 @@ struct CreateWidgetView: View {
HStack(spacing: 0) { HStack(spacing: 0) {
VStack(alignment: .center) { VStack(alignment: .center) {
Text("Left Eye") Text(String(localized: "create_widget_view_left_eye_color"))
ColorPicker("", selection: $customWidget.leftEyeColor) ColorPicker("", selection: $customWidget.leftEyeColor)
.labelsHidden() .labelsHidden()
} }
.frame(minWidth: 0, maxWidth: .infinity) .frame(minWidth: 0, maxWidth: .infinity)
VStack(alignment: .center) { VStack(alignment: .center) {
Text("right eye") Text(String(localized: "create_widget_view_right_eye_color"))
ColorPicker("", selection: $customWidget.rightEyeColor) ColorPicker("", selection: $customWidget.rightEyeColor)
.labelsHidden() .labelsHidden()
} }
.frame(minWidth: 0, maxWidth: .infinity) .frame(minWidth: 0, maxWidth: .infinity)
VStack(alignment: .center) { VStack(alignment: .center) {
Text("mouth") Text(String(localized: "create_widget_view_mouth_color"))
ColorPicker("", selection: $customWidget.mouthColor) ColorPicker("", selection: $customWidget.mouthColor)
.labelsHidden() .labelsHidden()
} }
@@ -253,12 +253,12 @@ struct CreateWidgetView: View {
.background(.blue) .background(.blue)
Button(action: { Button(action: {
UserDefaultsStore.saveCustomWidget(widgetModel: customWidget, inUse: true) UserDefaultsStore.saveCustomWidget(widgetModel: customWidget, inUse: false)
let impactMed = UIImpactFeedbackGenerator(style: .heavy) let impactMed = UIImpactFeedbackGenerator(style: .heavy)
impactMed.impactOccurred() impactMed.impactOccurred()
dismiss() dismiss()
}, label: { }, label: {
Text("Save") Text(String(localized: "create_widget_save"))
.font(.title) .font(.title)
.fontWeight(.bold) .fontWeight(.bold)
.foregroundColor(Color(UIColor.white)) .foregroundColor(Color(UIColor.white))
@@ -268,23 +268,23 @@ struct CreateWidgetView: View {
.frame(height: 40) .frame(height: 40)
.background(.green) .background(.green)
if customWidget.isSaved { Button(action: {
Button(action: { UserDefaultsStore.saveCustomWidget(widgetModel: customWidget, inUse: true)
UserDefaultsStore.makeWidgetCurrent(withUUID: customWidget.uuid) let impactMed = UIImpactFeedbackGenerator(style: .heavy)
let impactMed = UIImpactFeedbackGenerator(style: .heavy) impactMed.impactOccurred()
impactMed.impactOccurred() dismiss()
dismiss() }, label: {
}, label: { Text(String(localized: "create_widget_use"))
Text("Use") .font(.title)
.font(.title) .fontWeight(.bold)
.fontWeight(.bold) .foregroundColor(Color(UIColor.white))
.foregroundColor(Color(UIColor.white))
})
.frame(height: 40)
.frame(minWidth: 0, maxWidth: .infinity)
.background(.pink)
})
.frame(height: 40)
.frame(minWidth: 0, maxWidth: .infinity)
.background(.pink)
if customWidget.isSaved {
Button(action: { Button(action: {
UserDefaultsStore.deleteCustomWidget(withUUID: customWidget.uuid) UserDefaultsStore.deleteCustomWidget(withUUID: customWidget.uuid)
let impactMed = UIImpactFeedbackGenerator(style: .heavy) let impactMed = UIImpactFeedbackGenerator(style: .heavy)
@@ -299,7 +299,6 @@ struct CreateWidgetView: View {
.frame(height: 40) .frame(height: 40)
.frame(minWidth: 0, maxWidth: .infinity) .frame(minWidth: 0, maxWidth: .infinity)
.background(.orange) .background(.orange)
} }
} }
} }

View File

@@ -58,7 +58,7 @@ struct CustomizeView: View {
ZStack { ZStack {
theme.currentTheme.secondaryBGColor theme.currentTheme.secondaryBGColor
VStack { VStack {
Text(String(localized: "settings_view_change_icon")) Text(String(localized: "customize_view_view_change_icon"))
.font(.body) .font(.body)
.foregroundColor(theme.currentTheme.labelColor) .foregroundColor(theme.currentTheme.labelColor)
.padding(.top) .padding(.top)
@@ -102,7 +102,7 @@ struct CustomizeView: View {
ZStack { ZStack {
theme.currentTheme.secondaryBGColor theme.currentTheme.secondaryBGColor
VStack { VStack {
Text(String(localized: "settings_background_title")) Text(String(localized: "customize_view_background_title"))
.font(.body) .font(.body)
.foregroundColor(theme.currentTheme.labelColor) .foregroundColor(theme.currentTheme.labelColor)
@@ -143,13 +143,9 @@ struct CustomizeView: View {
ZStack { ZStack {
theme.currentTheme.secondaryBGColor theme.currentTheme.secondaryBGColor
VStack { VStack {
Text("Create Custom Widget") Text(String(localized: "customize_view_custom_widget_title"))
.font(.body) .font(.body)
.foregroundColor(theme.currentTheme.labelColor) .foregroundColor(theme.currentTheme.labelColor)
.onTapGesture {
selectedWidget.fuckingWrapped = CustomWidgetModel.randomWidget
selectedWidget.showFuckingSheet = true
}
.padding(.top) .padding(.top)
ScrollView(.horizontal) { ScrollView(.horizontal) {
HStack { HStack {
@@ -162,7 +158,15 @@ struct CustomizeView: View {
selectedWidget.showFuckingSheet = true selectedWidget.showFuckingSheet = true
} }
} }
RoundedRectangle(cornerRadius: 10).fill().foregroundColor(theme.currentTheme.secondaryBGColor)
.frame(width: 50, height: 50)
.overlay(
Image(systemName: "plus")
)
.onTapGesture {
selectedWidget.fuckingWrapped = CustomWidgetModel.randomWidget
selectedWidget.showFuckingSheet = true
}
} }
.padding() .padding()
} }

View File

@@ -23,7 +23,7 @@ struct MainTabView: View {
Label(String(localized: "content_view_tab_main"), systemImage: "list.dash") Label(String(localized: "content_view_tab_main"), systemImage: "list.dash")
} }
HomeViewTwo() MonthView()
.tabItem { .tabItem {
Label(String(localized: "content_view_tab_month"), systemImage: "calendar") Label(String(localized: "content_view_tab_month"), systemImage: "calendar")
} }

View File

@@ -7,7 +7,7 @@
import SwiftUI import SwiftUI
struct HomeViewTwo: View { struct MonthView: View {
@AppStorage(UserDefaultsStore.Keys.needsOnboarding.rawValue, store: GroupUserDefaults.groupDefaults) private var needsOnboarding = true @AppStorage(UserDefaultsStore.Keys.needsOnboarding.rawValue, store: GroupUserDefaults.groupDefaults) private var needsOnboarding = true
@AppStorage(UserDefaultsStore.Keys.theme.rawValue, store: GroupUserDefaults.groupDefaults) private var theme: Theme = .system @AppStorage(UserDefaultsStore.Keys.theme.rawValue, store: GroupUserDefaults.groupDefaults) private var theme: Theme = .system
@@ -37,7 +37,6 @@ struct HomeViewTwo: View {
var body: some View { var body: some View {
ZStack { ZStack {
if viewModel.hasNoData { if viewModel.hasNoData {
settingsButtonView
VStack { VStack {
Spacer() Spacer()
EmptyHomeView(viewModel: viewModel) EmptyHomeView(viewModel: viewModel)
@@ -46,9 +45,6 @@ struct HomeViewTwo: View {
} }
} else { } else {
ScrollView { ScrollView {
ZStack {
settingsButtonView
}
LazyVStack(spacing: 5, pinnedViews: [.sectionHeaders]) { LazyVStack(spacing: 5, pinnedViews: [.sectionHeaders]) {
ForEach(viewModel.grouped.sorted(by: { $0.key < $1.key }), id: \.key) { year, months in ForEach(viewModel.grouped.sorted(by: { $0.key < $1.key }), id: \.key) { year, months in
@@ -76,6 +72,7 @@ struct HomeViewTwo: View {
.edgesIgnoringSafeArea(.top) .edgesIgnoringSafeArea(.top)
} }
} }
.padding(.top)
.background( .background(
theme.currentTheme.bg theme.currentTheme.bg
.edgesIgnoringSafeArea(.all) .edgesIgnoringSafeArea(.all)
@@ -89,7 +86,7 @@ struct HomeViewTwo: View {
} }
} }
extension HomeViewTwo { extension MonthView {
private var topView: some View { private var topView: some View {
VStack { VStack {
if ShowBasedOnVoteLogics.isMissingCurrentVote(onboardingData: onboardingData.savedOnboardingData) { if ShowBasedOnVoteLogics.isMissingCurrentVote(onboardingData: onboardingData.savedOnboardingData) {
@@ -126,7 +123,7 @@ extension HomeViewTwo {
} }
// view that make up the list body // view that make up the list body
extension HomeViewTwo { extension MonthView {
private func homeViewTwoSectionHeaderView(month: Int, year: Int) -> some View { private func homeViewTwoSectionHeaderView(month: Int, year: Int) -> some View {
Text("\(Random.monthName(fromMonthInt: month)) \(String(year))") Text("\(Random.monthName(fromMonthInt: month)) \(String(year))")
.font(.body) .font(.body)
@@ -161,6 +158,6 @@ extension HomeViewTwo {
struct HomeViewTwo_Previews: PreviewProvider { struct HomeViewTwo_Previews: PreviewProvider {
static var previews: some View { static var previews: some View {
HomeViewTwo() MonthView()
} }
} }

View File

@@ -53,12 +53,11 @@
"settings_view_special_thanks_to_body" = "Special body"; "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_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_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"; "settings_view_show_onboarding" = "Show onboarding";
"settings_use_cloudkit_title" = "Use CloudKit"; "settings_use_cloudkit_title" = "Use CloudKit";
"settings_use_cloudkit_body" = "CloudKit fucking sucks"; "settings_use_cloudkit_body" = "CloudKit fucking sucks";
"settings_use_delete_enable" = "Allow deletion of entry"; "settings_use_delete_enable" = "Allow deletion of entry";
"settings_background_title" = "What background would you like to use";
"mood_value_great" = "Great"; "mood_value_great" = "Great";
"mood_value_good" = "Good"; "mood_value_good" = "Good";
@@ -74,3 +73,18 @@
"share_view_longest_streak_template_title" = "Longest consecutive days I was %@"; "share_view_longest_streak_template_title" = "Longest consecutive days I was %@";
"customize_view_title" = "Make ifeel yours!!!"; "customize_view_title" = "Make ifeel yours!!!";
"customize_view_custom_widget_title" = "Custom Widgets";
"customize_view_background_title" = "Pick a theme";
"customize_view_view_change_icon" = "Change App Icon";
"create_widget_view_left_eye" = "Left Eye";
"create_widget_view_right_eye" = "Right Eye";
"create_widget_view_mouth" = "Mouth";
"create_widget_background_color" = "Background";
"create_widget_inner_color" = "Inner";
"create_widget_face_outline_color" = "Face Outline";
"create_widget_view_left_eye_color" = "Left Eye";
"create_widget_view_right_eye_color" = "Right Eye";
"create_widget_view_mouth_color" = "Mouth";
"create_widget_save" = "Save";
"create_widget_use" = "Use";