mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Various improvements
This commit is contained in:
@@ -131,11 +131,7 @@ final class SemanticStatusNodeIconContext: SemanticStatusNodeStateContext {
|
||||
}
|
||||
}
|
||||
|
||||
var icon: SemanticStatusNodeIcon {
|
||||
didSet {
|
||||
self.animationNode?.enqueueState(self.icon == .play ? .play : .pause, animated: self.iconImage != nil)
|
||||
}
|
||||
}
|
||||
private(set) var icon: SemanticStatusNodeIcon
|
||||
|
||||
private var animationNode: PlayPauseIconNode?
|
||||
private var iconImage: UIImage?
|
||||
@@ -171,6 +167,11 @@ final class SemanticStatusNodeIconContext: SemanticStatusNodeStateContext {
|
||||
|
||||
var requestUpdate: () -> Void = {}
|
||||
|
||||
func setIcon(icon: SemanticStatusNodeIcon, animated: Bool) {
|
||||
self.icon = icon
|
||||
self.animationNode?.enqueueState(self.icon == .play ? .play : .pause, animated: animated)
|
||||
}
|
||||
|
||||
func drawingState(transitionFraction: CGFloat) -> SemanticStatusNodeStateDrawingState {
|
||||
return DrawingState(transitionFraction: transitionFraction, icon: self.icon, iconImage: self.iconImage, iconOffset: self.iconOffset)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user