fix missing images heights on month detail

This commit is contained in:
Trey t
2022-04-23 11:14:10 -05:00
parent 75b8db8c8e
commit d116d082eb
10 changed files with 29 additions and 44 deletions

View File

@@ -15,11 +15,12 @@ import Firebase
class AppDelegate: NSObject, UIApplicationDelegate { class AppDelegate: NSObject, UIApplicationDelegate {
private let savedOnboardingData = UserDefaultsStore.getOnboarding() private let savedOnboardingData = UserDefaultsStore.getOnboarding()
@AppStorage(UserDefaultsStore.Keys.textColor.rawValue, store: GroupUserDefaults.groupDefaults) private var textColor: Color = DefaultTextColor.textColor @AppStorage(UserDefaultsStore.Keys.textColor.rawValue, store: GroupUserDefaults.groupDefaults) private var textColor: Color = DefaultTextColor.textColor
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
// PersistenceController.shared.clearDB() // PersistenceController.shared.clearDB()
// PersistenceController.shared.deleteLast(numberOfEntries: 5) // PersistenceController.shared.deleteLast(numberOfEntries: 5)
// GroupUserDefaults.groupDefaults.set(false, forKey: UserDefaultsStore.Keys.showNSFW.rawValue) // PersistenceController.shared.deleteRandomFromLast(numberOfEntries: 10)
// GroupUserDefaults.groupDefaults.set(false, forKey: UserDefaultsStore.Keys.showNSFW.rawValue)
FirebaseApp.configure() FirebaseApp.configure()
PersistenceController.shared.removeNoForDates() PersistenceController.shared.removeNoForDates()

View File

@@ -1,26 +0,0 @@
{
"images" : [
{
"filename" : "xmark-solid.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "xmark-solid@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "xmark-solid@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -29,4 +29,16 @@ extension PersistenceController {
} }
try! viewContext.save() try! viewContext.save()
} }
func deleteRandomFromLast(numberOfEntries: Int) {
let entries = PersistenceController.shared.getData(startDate: Calendar.current.date(byAdding: .day, value: -numberOfEntries, to: Date())!,
endDate: Date(),
includedDays: [])
for entry in entries {
if Bool.random() {
viewContext.delete(entry)
}
}
try! viewContext.save()
}
} }

View File

@@ -167,29 +167,27 @@ struct MonthDetailView: View {
Text(" ") Text(" ")
.font(.title3) .font(.title3)
.foregroundColor(Mood.placeholder.color) .foregroundColor(Mood.placeholder.color)
Circle()
.frame(minWidth: 5,
maxWidth: 50,
minHeight: 5,
maxHeight: 50,
alignment: .center)
.foregroundColor(moodTint.color(forMood: entry.mood))
} else { } else {
Text(entry.forDate!, Text(entry.forDate!,
format: Date.FormatStyle().day()) format: Date.FormatStyle().day())
.font(.title3) .font(.title3)
.foregroundColor(textColor) .foregroundColor(textColor)
}
if entry.mood == .placeholder {
Circle()
.frame(minWidth: 5,
maxWidth: 500,
minHeight: 5,
maxHeight: 500,
alignment: .center)
.foregroundColor(moodTint.color(forMood: entry.mood))
} else {
entry.mood.icon entry.mood.icon
.resizable() .resizable()
.aspectRatio(contentMode: .fit) .scaledToFit()
.frame(minWidth: 5, .frame(minWidth: 5,
maxWidth: 500, maxWidth: 50,
minHeight: 5, minHeight: 5,
maxHeight: 500, maxHeight: 50,
alignment: .center) alignment: .center)
.foregroundColor(moodTint.color(forMood: entry.mood)) .foregroundColor(moodTint.color(forMood: entry.mood))
} }