mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 15:14:33 +00:00
Improve animation
This commit is contained in:
parent
39673e9130
commit
f782c9d135
2 changed files with 24 additions and 25 deletions
|
|
@ -234,13 +234,11 @@ class DynamicIslandViewModel: NSObject, ObservableObject {
|
|||
DispatchQueue.main.async(execute: applyWindowResize)
|
||||
}
|
||||
|
||||
withAnimation(.bouncy) {
|
||||
self.notchSize = targetSize
|
||||
self.notchState = .open
|
||||
}
|
||||
|
||||
// Force music information update when notch is opened
|
||||
MusicManager.shared.forceUpdate()
|
||||
notchSize = targetSize
|
||||
notchState = .open
|
||||
|
||||
// Force music information update when notch is opened
|
||||
MusicManager.shared.forceUpdate()
|
||||
}
|
||||
|
||||
private func calculateDynamicNotchSize() -> CGSize {
|
||||
|
|
@ -254,12 +252,10 @@ class DynamicIslandViewModel: NSObject, ObservableObject {
|
|||
}
|
||||
|
||||
func close() {
|
||||
withAnimation(.smooth) { [weak self] in
|
||||
guard let self = self else { return }
|
||||
self.notchSize = getClosedNotchSize(screen: self.screen)
|
||||
self.closedNotchSize = self.notchSize
|
||||
self.notchState = .closed
|
||||
}
|
||||
let targetSize = getClosedNotchSize(screen: screen)
|
||||
notchSize = targetSize
|
||||
closedNotchSize = targetSize
|
||||
notchState = .closed
|
||||
|
||||
// Set the current view to shelf if it contains files and the user enables openShelfByDefault
|
||||
// Otherwise, if the user has not enabled openLastShelfByDefault, set the view to home
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue