separate all customize views into their own files

make corner radius a constant
create the views in the main app file and pass through so they dont get re-drawn when changing UI things
This commit is contained in:
Trey t
2022-04-02 10:53:04 -05:00
parent 3d1b7abc64
commit 682f62fa4a
25 changed files with 764 additions and 551 deletions

View File

@@ -14,8 +14,6 @@ struct FeelsApp: App {
@Environment(\.scenePhase) private var scenePhase
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
@StateObject var daysFilter = DaysFilterClass()
let persistenceController = PersistenceController.shared
init() {
@@ -28,12 +26,16 @@ struct FeelsApp: App {
var body: some Scene {
WindowGroup {
MainTabView()
.environment(\.managedObjectContext, persistenceController.viewContext)
.environmentObject(daysFilter)
// build these here so when tints and other things get updated the views / their data dont
// have to get redrawn
MainTabView(dayView: DayView(viewModel: DayViewViewModel(addMonthStartWeekdayPadding: false)),
monthView: MonthView(viewModel: DayViewViewModel(addMonthStartWeekdayPadding: true)),
yearView: YearView(viewModel: YearViewModel()),
customizeView: CustomizeView())
.environment(\.managedObjectContext, persistenceController.viewContext)
}.onChange(of: scenePhase) { phase in
if phase == .background {
// BGTask.scheduleBackgroundProcessing()
//BGTask.scheduleBackgroundProcessing()
WidgetCenter.shared.reloadAllTimelines()
}