mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Theme updates
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user