Theme updates

This commit is contained in:
Ali
2021-05-29 01:10:45 +04:00
parent b11b306c30
commit 154c74a607
20 changed files with 115 additions and 61 deletions

View File

@@ -180,14 +180,22 @@ public final class GradientBackgroundNode: ASDisplayNode {
private let cloneNodes = SparseBag<Weak<CloneNode>>()
override public init() {
private let useSharedAnimationPhase: Bool
static var sharedPhase: Int = 0
public init(useSharedAnimationPhase: Bool = false) {
self.useSharedAnimationPhase = useSharedAnimationPhase
self.contentView = UIImageView()
super.init()
self.view.addSubview(self.contentView)
self.phase = 0
if useSharedAnimationPhase {
self.phase = GradientBackgroundNode.sharedPhase
} else {
self.phase = 0
}
}
deinit {
@@ -280,6 +288,9 @@ public final class GradientBackgroundNode: ASDisplayNode {
} else {
self.phase = self.phase - 1
}
if self.useSharedAnimationPhase {
GradientBackgroundNode.sharedPhase = self.phase
}
if let size = self.validLayout {
self.updateLayout(size: size, transition: transition)
}