Various fixes

This commit is contained in:
Ilya Laktyushin
2022-11-26 16:16:37 +04:00
parent 8c006150f8
commit 58f9896a10
74 changed files with 1185 additions and 679 deletions

View File

@@ -156,6 +156,13 @@ public final class SolidRoundedButtonNode: ASDisplayNode {
self.animationTimer = timer
timer.start()
}
} else {
self.animationNode?.play()
let timer = SwiftSignalKit.Timer(timeout: 4.0, repeat: true, completion: { [weak self] in
self?.animationNode?.play()
}, queue: Queue.mainQueue())
self.animationTimer = timer
timer.start()
}
}
} else if let animationNode = self.animationNode {
@@ -173,6 +180,14 @@ public final class SolidRoundedButtonNode: ASDisplayNode {
}
}
public var animationSize: CGSize = CGSize(width: 30.0, height: 30.0) {
didSet {
if let width = self.validLayout {
_ = self.updateLayout(width: width, transition: .immediate)
}
}
}
public var iconPosition: SolidRoundedButtonIconPosition = .left {
didSet {
if let width = self.validLayout {
@@ -559,7 +574,7 @@ public final class SolidRoundedButtonNode: ASDisplayNode {
let iconSize: CGSize
if let _ = self.animationNode {
iconSize = CGSize(width: 30.0, height: 30.0)
iconSize = self.animationSize
} else {
iconSize = self.iconNode.image?.size ?? CGSize()
}
@@ -794,6 +809,13 @@ public final class SolidRoundedButtonView: UIView {
self.animationTimer = timer
timer.start()
}
} else {
self.animationNode?.play()
let timer = SwiftSignalKit.Timer(timeout: 4.0, repeat: true, completion: { [weak self] in
self?.animationNode?.play()
}, queue: Queue.mainQueue())
self.animationTimer = timer
timer.start()
}
}
} else if let animationNode = self.animationNode {