mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
[WIP] Video chat v2
This commit is contained in:
@@ -9,13 +9,16 @@ import LottieComponent
|
||||
|
||||
final class VideoChatMuteIconComponent: Component {
|
||||
let color: UIColor
|
||||
let isFilled: Bool
|
||||
let isMuted: Bool
|
||||
|
||||
init(
|
||||
color: UIColor,
|
||||
isFilled: Bool,
|
||||
isMuted: Bool
|
||||
) {
|
||||
self.color = color
|
||||
self.isFilled = isFilled
|
||||
self.isMuted = isMuted
|
||||
}
|
||||
|
||||
@@ -23,6 +26,9 @@ final class VideoChatMuteIconComponent: Component {
|
||||
if lhs.color != rhs.color {
|
||||
return false
|
||||
}
|
||||
if lhs.isFilled != rhs.isFilled {
|
||||
return false
|
||||
}
|
||||
if lhs.isMuted != rhs.isMuted {
|
||||
return false
|
||||
}
|
||||
@@ -37,6 +43,10 @@ final class VideoChatMuteIconComponent: Component {
|
||||
|
||||
private var contentImage: UIImage?
|
||||
|
||||
var iconView: UIView {
|
||||
return self.icon.view
|
||||
}
|
||||
|
||||
override init(frame: CGRect) {
|
||||
self.icon = VoiceChatMicrophoneNode()
|
||||
|
||||
@@ -62,7 +72,7 @@ final class VideoChatMuteIconComponent: Component {
|
||||
self.addSubview(self.icon.view)
|
||||
}
|
||||
transition.setFrame(view: self.icon.view, frame: animationFrame)
|
||||
self.icon.update(state: VoiceChatMicrophoneNode.State(muted: component.isMuted, filled: true, color: component.color), animated: !transition.animation.isImmediate)
|
||||
self.icon.update(state: VoiceChatMicrophoneNode.State(muted: component.isMuted, filled: component.isFilled, color: component.color), animated: !transition.animation.isImmediate)
|
||||
|
||||
return availableSize
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user