From 3d062fff78cc6b287c74e6171f855a3500c0156d Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Wed, 16 Dec 2020 18:18:16 +0400 Subject: [PATCH] Voice Chat UI fixes --- .../TelegramCallsUI/Sources/CallControllerButton.swift | 8 ++++---- .../TelegramCallsUI/Sources/VoiceChatActionButton.swift | 2 +- .../TelegramCallsUI/Sources/VoiceChatController.swift | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/submodules/TelegramCallsUI/Sources/CallControllerButton.swift b/submodules/TelegramCallsUI/Sources/CallControllerButton.swift index 8803f9516a..3b1bc17a62 100644 --- a/submodules/TelegramCallsUI/Sources/CallControllerButton.swift +++ b/submodules/TelegramCallsUI/Sources/CallControllerButton.swift @@ -14,7 +14,7 @@ final class CallControllerButtonItemNode: HighlightTrackingButtonNode { enum Color: Equatable { case red case green - case custom(UInt32) + case custom(UInt32, CGFloat) } case blurred(isFilled: Bool) @@ -197,8 +197,8 @@ final class CallControllerButtonItemNode: HighlightTrackingButtonNode { fillColor = UIColor(rgb: 0xd92326) case .green: fillColor = UIColor(rgb: 0x74db58) - case let .custom(color): - fillColor = UIColor(rgb: color) + case let .custom(color, alpha): + fillColor = UIColor(rgb: color, alpha: alpha) } } @@ -293,7 +293,7 @@ final class CallControllerButtonItemNode: HighlightTrackingButtonNode { fillColor = UIColor(rgb: 0xd92326).withMultipliedBrightnessBy(0.2).withAlphaComponent(0.2) case .green: fillColor = UIColor(rgb: 0x74db58).withMultipliedBrightnessBy(0.2).withAlphaComponent(0.2) - case let .custom(color): + case let .custom(color, alpha): fillColor = UIColor(rgb: color).withMultipliedBrightnessBy(0.2).withAlphaComponent(0.2) } } diff --git a/submodules/TelegramCallsUI/Sources/VoiceChatActionButton.swift b/submodules/TelegramCallsUI/Sources/VoiceChatActionButton.swift index 5da4fc7963..2b2efd4bff 100644 --- a/submodules/TelegramCallsUI/Sources/VoiceChatActionButton.swift +++ b/submodules/TelegramCallsUI/Sources/VoiceChatActionButton.swift @@ -158,7 +158,7 @@ final class VoiceChatActionButton: HighlightTrackingButtonNode { } let updatedTitle = self.titleLabel.attributedText?.string != title - let updatedSubtitle = self.subtitleLabel.attributedText?.string != title + let updatedSubtitle = self.subtitleLabel.attributedText?.string != subtitle self.titleLabel.attributedText = NSAttributedString(string: title, font: titleFont, textColor: .white) self.subtitleLabel.attributedText = NSAttributedString(string: subtitle, font: subtitleFont, textColor: .white) diff --git a/submodules/TelegramCallsUI/Sources/VoiceChatController.swift b/submodules/TelegramCallsUI/Sources/VoiceChatController.swift index 407ec95c26..dd65f0e9fc 100644 --- a/submodules/TelegramCallsUI/Sources/VoiceChatController.swift +++ b/submodules/TelegramCallsUI/Sources/VoiceChatController.swift @@ -1570,9 +1570,9 @@ public final class VoiceChatController: ViewController { private func updateButtons(transition: ContainedViewLayoutTransition) { let audioButtonAppearance: CallControllerButtonItemNode.Content.Appearance if let color = self.currentAudioButtonColor { - audioButtonAppearance = .color(.custom(color.rgb)) + audioButtonAppearance = .color(.custom(color.rgb, 1.0)) } else { - audioButtonAppearance = .color(.custom(self.isFullscreen ? 0x1c1c1e : 0x2c2c2e)) + audioButtonAppearance = .color(.custom(self.isFullscreen ? 0x1c1c1e : 0x2c2c2e, 1.0)) } var audioMode: CallControllerButtonsSpeakerMode = .none @@ -1628,7 +1628,7 @@ public final class VoiceChatController: ViewController { let sideButtonSize = CGSize(width: 60.0, height: 60.0) self.audioOutputNode.update(size: sideButtonSize, content: CallControllerButtonItemNode.Content(appearance: soundAppearance, image: soundImage), text: soundTitle, transition: .animated(duration: 0.3, curve: .linear)) - self.leaveNode.update(size: sideButtonSize, content: CallControllerButtonItemNode.Content(appearance: .color(.custom(0x602522)), image: .end), text: self.presentationData.strings.VoiceChat_Leave, transition: .immediate) + self.leaveNode.update(size: sideButtonSize, content: CallControllerButtonItemNode.Content(appearance: .color(.custom(0xff3b30, 0.3)), image: .end), text: self.presentationData.strings.VoiceChat_Leave, transition: .immediate) } func containerLayoutUpdated(_ layout: ContainerViewLayout, navigationHeight: CGFloat, transition: ContainedViewLayoutTransition) {