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:
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user