update strings

update empty views
take out headers on customize views
make refresh on sample row go through moods great->horrible
other small UI changes
This commit is contained in:
Trey t
2022-04-11 23:05:59 -04:00
parent 1e5b02858e
commit 26fffc1b74
13 changed files with 128 additions and 131 deletions

View File

@@ -17,6 +17,15 @@ enum Mood: Int {
case missing
case placeholder
var next: Mood {
var moodValue = self.rawValue
moodValue -= 1
if moodValue < 0 {
moodValue = 4
}
return Mood.init(rawValue: moodValue) ?? Mood.horrible
}
var strValue: String {
switch self {
case .horrible:

View File

@@ -35,13 +35,13 @@ struct OnboardingCustomizeOne: View {
.font(.title)
.padding()
.fixedSize(horizontal: false, vertical: true)
.foregroundColor(Color(UIColor.white))
.foregroundColor(.black)
Text(String(localized: "onboarding_title_customize_one_section_one_title"))
.font(.title3)
.fixedSize(horizontal: false, vertical: true)
.padding()
.foregroundColor(Color(UIColor.white))
.foregroundColor(.black)
.multilineTextAlignment(.leading)
IconPickerView()
@@ -49,7 +49,7 @@ struct OnboardingCustomizeOne: View {
.font(.title3)
.padding()
.fixedSize(horizontal: false, vertical: true)
.foregroundColor(Color(UIColor.white))
.foregroundColor(.black)
DayFilterPickerView()
@@ -57,7 +57,7 @@ struct OnboardingCustomizeOne: View {
.font(.title3)
.padding()
.fixedSize(horizontal: false, vertical: true)
.foregroundColor(Color(UIColor.white))
.foregroundColor(.black)
}
}
.padding()

View File

@@ -28,31 +28,30 @@ struct OnboardingCustomizeTwo: View {
Spacer()
}
VStack {
VStack(alignment: .leading) {
Text(String(localized: "onboarding_title_customize_two_title"))
.font(.title)
.padding()
.fixedSize(horizontal: false, vertical: true)
.foregroundColor(.white)
SampleEntryView()
.padding([.top])
ScrollView {
VStack(alignment: .leading) {
Text(String(localized: "onboarding_title_customize_two_title"))
.font(.title)
.padding()
.fixedSize(horizontal: false, vertical: true)
.foregroundColor(Color(UIColor.white))
Text(String(localized: "onboarding_title_customize_two_section_one_title"))
.font(.title3)
.padding()
.fixedSize(horizontal: false, vertical: true)
.foregroundColor(Color(UIColor.white))
.foregroundColor(.white)
ImagePackPickerView()
Text(String(localized: "onboarding_title_customize_two_section_two_title"))
.font(.title3)
.padding()
.fixedSize(horizontal: false, vertical: true)
.foregroundColor(Color(UIColor.white))
.foregroundColor(.white)
TintPickerView()
@@ -61,7 +60,7 @@ struct OnboardingCustomizeTwo: View {
.font(.title3)
.padding()
.fixedSize(horizontal: false, vertical: true)
.foregroundColor(Color(UIColor.white))
.foregroundColor(.white)
TextColorPickerView()

View File

@@ -52,7 +52,7 @@ struct OnboardingDay: View {
.font(.title)
.padding()
.fixedSize(horizontal: false, vertical: true)
.foregroundColor(.black)
.foregroundColor(.white)
Picker(selection: $onboardingData.inputDay,
@@ -61,15 +61,17 @@ struct OnboardingDay: View {
Text(day.localizedValue)
}
}
.labelsHidden()
.frame(minWidth: 0, maxWidth: .infinity)
.padding()
.padding([.trailing, .leading], 55)
.pickerStyle(SegmentedPickerStyle())
.colorScheme(.dark)
Text(previewText)
.font(.title3)
.padding()
.fixedSize(horizontal: false, vertical: true)
.foregroundColor(.black)
.foregroundColor(.white)
}
}
.padding()

View File

@@ -36,6 +36,7 @@ struct OnboardingWrapup: View {
Spacer()
Text(String(localized: "onboarding_wrap_up_1"))
.padding(.top)
.padding()
.font(.title)
.foregroundColor(Color(UIColor.white))
@@ -66,7 +67,7 @@ struct OnboardingWrapup: View {
Text(String(localized: "onboarding_wrap_up_complete_button"))
.font(.title)
.fontWeight(.bold)
.foregroundColor(.yellow)
.foregroundColor(Color(hex: "31d158"))
.padding()
.background(RoundedRectangle(cornerRadius: 10).fill().foregroundColor(Color.white))
.cornerRadius(10)

View File

@@ -105,8 +105,8 @@ struct CreateWidgetView: View {
}, label: {
Image(systemName: "shuffle")
.font(.title)
.foregroundColor(Color(UIColor.white))
.foregroundColor(.white)
.padding([.top, .bottom])
})
.frame(minWidth: 0, maxWidth: .infinity)
.frame(minHeight: 40, maxHeight: .infinity)
@@ -122,7 +122,8 @@ struct CreateWidgetView: View {
Text(String(localized: "create_widget_save"))
.font(.title)
.fontWeight(.bold)
.foregroundColor(Color(UIColor.white))
.foregroundColor(.white)
.padding([.top, .bottom])
})
.frame(minWidth: 0, maxWidth: .infinity)
@@ -139,7 +140,8 @@ struct CreateWidgetView: View {
Text(String(localized: "create_widget_use"))
.font(.title)
.fontWeight(.bold)
.foregroundColor(Color(UIColor.white))
.foregroundColor(.white)
.padding([.top, .bottom])
})
.frame(minWidth: 0, maxWidth: .infinity)
@@ -156,7 +158,8 @@ struct CreateWidgetView: View {
}, label: {
Image(systemName: "trash")
.font(.title)
.foregroundColor(Color(UIColor.white))
.foregroundColor(.white)
.padding([.top, .bottom])
})
.frame(minWidth: 0, maxWidth: .infinity)

View File

@@ -18,29 +18,23 @@ struct ShapePickerView: View {
ZStack {
theme.currentTheme.secondaryBGColor
VStack {
HStack {
Spacer()
Text(shapeRefreshToggleThing.description.localizedLowercase)
.hidden()
Image(systemName: "arrow.triangle.2.circlepath.circle")
.resizable()
.frame(width: 20, height: 20, alignment: .trailing)
.foregroundColor(Color(UIColor.systemGray))
.onTapGesture {
shapeRefreshToggleThing.toggle()
}
}
Spacer()
}
.padding()
VStack(alignment:.leading) {
Text(String(localized: "customize_view_view_pick_shape"))
.padding([.leading])
.foregroundColor(textColor)
Divider()
VStack {
HStack {
Spacer()
Text(shapeRefreshToggleThing.description.localizedLowercase)
.hidden()
Image(systemName: "arrow.triangle.2.circlepath.circle")
.resizable()
.frame(width: 20, height: 20, alignment: .trailing)
.foregroundColor(Color(UIColor.systemGray))
.onTapGesture {
shapeRefreshToggleThing.toggle()
}
}
}
HStack {
ForEach(BGShape.allCases, id: \.rawValue) { ashape in

View File

@@ -126,7 +126,7 @@ struct DayView: View {
settingsButtonView
if viewModel.hasNoData {
Spacer()
EmptyHomeView(viewModel: viewModel)
EmptyHomeView(showVote: true, viewModel: viewModel)
Spacer()
} else {
ZStack {

View File

@@ -11,18 +11,31 @@ struct EmptyHomeView: View {
@AppStorage(UserDefaultsStore.Keys.theme.rawValue, store: GroupUserDefaults.groupDefaults) private var theme: Theme = .system
@AppStorage(UserDefaultsStore.Keys.textColor.rawValue, store: GroupUserDefaults.groupDefaults) private var textColor: Color = DefaultTextColor.textColor
let viewModel: DayViewViewModel
let showVote: Bool
let viewModel: DayViewViewModel?
var body: some View {
ZStack {
theme.currentTheme.secondaryBGColor
VStack {
AddMoodHeaderView(addItemHeaderClosure: { (mood, date) in
withAnimation {
viewModel.add(mood: mood, forDate: date, entryType: .header)
if showVote {
AddMoodHeaderView(addItemHeaderClosure: { (mood, date) in
withAnimation {
viewModel?.add(mood: mood, forDate: date, entryType: .header)
}
})
} else {
VStack {
Spacer()
Text(String(localized: "view_no_data"))
.font(.title)
.padding()
.fixedSize(horizontal: false, vertical: true)
.foregroundColor(textColor)
Spacer()
}
})
}
}
}
.fixedSize(horizontal: false, vertical: true)
@@ -32,6 +45,10 @@ struct EmptyHomeView: View {
struct EmptyHomeView_Previews: PreviewProvider {
static var previews: some View {
EmptyHomeView(viewModel: DayViewViewModel(addMonthStartWeekdayPadding: false))
Group {
EmptyHomeView(showVote: true, viewModel: DayViewViewModel(addMonthStartWeekdayPadding: false))
EmptyHomeView(showVote: false, viewModel: nil)
}
}
}

View File

@@ -48,15 +48,8 @@ struct MonthView: View {
var body: some View {
ZStack {
if viewModel.hasNoData {
VStack {
Spacer()
Text(String(localized: "month_view_no_data"))
.font(.title)
.padding()
.fixedSize(horizontal: false, vertical: true)
.foregroundColor(textColor)
Spacer()
}
EmptyHomeView(showVote: false, viewModel: nil)
.padding()
} else {
ScrollView {
VStack(spacing: 5) {
@@ -178,17 +171,6 @@ extension MonthView {
VStack {
HStack {
homeViewTwoSectionHeaderView(month: month, year: year)
// Image(systemName: "square.and.arrow.up")
// .foregroundColor(textColor)
// .onTapGesture {
// let impactMed = UIImpactFeedbackGenerator(style: .heavy)
// impactMed.impactOccurred()
//
// let _image = shareViewImage(month: month, year: year, entries: entries).asImage(size: CGSize(width: 400, height: 260))
// self.shareImage.showFuckingSheet = true
// self.shareImage.fuckingWrappedShrable = _image
// }
}
Divider()
LazyVGrid(columns: columns, spacing: 15) {

View File

@@ -8,7 +8,7 @@
import SwiftUI
struct SampleEntryView: View {
@State private var sampleListEntry = PersistenceController.shared.randomEntries(count: 1).first!
@State private var sampleListEntry = PersistenceController.shared.generateObjectNotInArray(forDate: Date(), withMood: Mood.great)
@AppStorage(UserDefaultsStore.Keys.theme.rawValue, store: GroupUserDefaults.groupDefaults) private var theme: Theme = .system
@AppStorage(UserDefaultsStore.Keys.textColor.rawValue, store: GroupUserDefaults.groupDefaults) private var textColor: Color = DefaultTextColor.textColor
@@ -24,17 +24,13 @@ struct SampleEntryView: View {
.frame(width: 20, height: 20, alignment: .trailing)
.foregroundColor(Color(UIColor.systemGray))
.onTapGesture {
sampleListEntry = PersistenceController.shared.randomEntries(count: 1).first!
sampleListEntry = PersistenceController.shared.generateObjectNotInArray(forDate: Date(), withMood: sampleListEntry.mood.next)
}
}
Spacer()
}.padding()
VStack(alignment:.leading) {
Text(String(localized: "customize_view_view_example_row"))
.padding([.leading, .top])
.foregroundColor(textColor)
Divider()
EntryListView(entry: sampleListEntry)
.padding()
}

View File

@@ -44,13 +44,20 @@ struct YearView: View {
]
var body: some View {
ScrollView {
gridView
.onAppear(perform: {
self.viewModel.filterEntries(startDate: Date(timeIntervalSince1970: 0), endDate: Date())
})
ZStack {
if self.viewModel.data.keys.isEmpty {
EmptyHomeView(showVote: false, viewModel: nil)
.padding()
} else {
ScrollView {
gridView
}
.padding(.bottom, 5)
}
}
.padding(.bottom, 5)
.onAppear(perform: {
self.viewModel.filterEntries(startDate: Date(timeIntervalSince1970: 0), endDate: Date())
})
.background(
theme.currentTheme.bg
.edgesIgnoringSafeArea(.all)