Luminate/Sources/LuminateUI/Utilities/PageAnimationTracker.swift

29 lines
672 B
Swift

//
// PageAnimationTracker.swift
// LuminateUI
//
// Created by Brendan Szymanski on 6/15/26.
//
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
}
}
}