mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Stream improvements
This commit is contained in:
@@ -3,11 +3,18 @@ import UIKit
|
||||
import ComponentFlow
|
||||
|
||||
public final class ActivityIndicatorComponent: Component {
|
||||
public let color: UIColor
|
||||
|
||||
public init(
|
||||
color: UIColor
|
||||
) {
|
||||
self.color = color
|
||||
}
|
||||
|
||||
public static func ==(lhs: ActivityIndicatorComponent, rhs: ActivityIndicatorComponent) -> Bool {
|
||||
if lhs.color != rhs.color {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -21,6 +28,10 @@ public final class ActivityIndicatorComponent: Component {
|
||||
}
|
||||
|
||||
func update(component: ActivityIndicatorComponent, availableSize: CGSize, transition: Transition) -> CGSize {
|
||||
if component.color != self.color {
|
||||
self.color = component.color
|
||||
}
|
||||
|
||||
if !self.isAnimating {
|
||||
self.startAnimating()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user