mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-28 15:44:32 +00:00
Tried to fix the detach animation
This commit is contained in:
parent
f425b38a81
commit
a1678afe0a
4 changed files with 46 additions and 201 deletions
|
|
@ -102,9 +102,6 @@ class DynamicIslandViewCoordinator: ObservableObject {
|
|||
}
|
||||
|
||||
@Published var statsSecondRowExpansion: CGFloat = 1
|
||||
private var statsSecondRowWorkItem: DispatchWorkItem?
|
||||
private let statsSecondRowRevealDelay: TimeInterval = 0.5
|
||||
private let statsSecondRowAnimationDuration: TimeInterval = 0.3
|
||||
@Published var notesLayoutState: NotesLayoutState = .list
|
||||
@Published var selectedExtensionExperienceID: String?
|
||||
|
||||
|
|
@ -206,22 +203,8 @@ class DynamicIslandViewCoordinator: ObservableObject {
|
|||
|
||||
private func handleStatsTabTransition(from oldValue: NotchViews, to newValue: NotchViews) {
|
||||
guard oldValue != newValue else { return }
|
||||
statsSecondRowWorkItem?.cancel()
|
||||
if newValue == .stats && Defaults[.enableStatsFeature] {
|
||||
statsSecondRowExpansion = 0
|
||||
let workItem = DispatchWorkItem { [weak self] in
|
||||
guard let self else { return }
|
||||
withAnimation(.easeInOut(duration: self.statsSecondRowAnimationDuration)) {
|
||||
self.statsSecondRowExpansion = 1
|
||||
}
|
||||
self.statsSecondRowWorkItem = nil
|
||||
}
|
||||
statsSecondRowWorkItem = workItem
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + statsSecondRowRevealDelay, execute: workItem)
|
||||
} else {
|
||||
withAnimation(.easeInOut(duration: 0.2)) {
|
||||
statsSecondRowExpansion = 0
|
||||
}
|
||||
statsSecondRowExpansion = 1
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue