22 lines
571 B
Swift
22 lines
571 B
Swift
import Adwaita
|
|
import Foundation
|
|
import LuminateCore
|
|
|
|
public class PageAnimationTracker: PageAnimationTracking {
|
|
public var isAnimating = false
|
|
private var pushGeneration = 0
|
|
|
|
public init() {}
|
|
|
|
public func markPush() {
|
|
isAnimating = true
|
|
pushGeneration += 1
|
|
let captured = pushGeneration
|
|
Idle(delay: 250) { [weak self] in
|
|
guard let self, self.pushGeneration == captured else { return false }
|
|
self.isAnimating = false
|
|
StateManager.updateViews()
|
|
return false
|
|
}
|
|
}
|
|
}
|