mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-29 08:04:32 +00:00
Fix Timer Bug for UI Layout
This commit is contained in:
parent
d4886dfc9e
commit
6e365c1b11
5 changed files with 100 additions and 67 deletions
|
|
@ -51,6 +51,10 @@ class DynamicIslandViewCoordinator: ObservableObject {
|
|||
|
||||
@Published var currentView: NotchViews = .home {
|
||||
didSet {
|
||||
if Defaults[.enableMinimalisticUI] && currentView != .home {
|
||||
currentView = .home
|
||||
return
|
||||
}
|
||||
handleStatsTabTransition(from: oldValue, to: currentView)
|
||||
}
|
||||
}
|
||||
|
|
@ -116,6 +120,13 @@ class DynamicIslandViewCoordinator: ObservableObject {
|
|||
self?.handleTimerFeatureToggle(change.newValue)
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
|
||||
Defaults.publisher(.enableMinimalisticUI)
|
||||
.receive(on: DispatchQueue.main)
|
||||
.sink { [weak self] change in
|
||||
self?.handleMinimalisticModeChange(change.newValue)
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
}
|
||||
|
||||
private func handleStatsTabTransition(from oldValue: NotchViews, to newValue: NotchViews) {
|
||||
|
|
@ -152,6 +163,15 @@ class DynamicIslandViewCoordinator: ObservableObject {
|
|||
currentView = .home
|
||||
}
|
||||
}
|
||||
|
||||
private func handleMinimalisticModeChange(_ isEnabled: Bool) {
|
||||
guard isEnabled else { return }
|
||||
if currentView != .home {
|
||||
withAnimation(.smooth) {
|
||||
currentView = .home
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func toggleSneakPeek(status: Bool, type: SneakContentType, duration: TimeInterval = 1.5, value: CGFloat = 0, icon: String = "") {
|
||||
let resolvedDuration: TimeInterval
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue