From 5e3906e5787d71505945fe1db0dabf1126f93fcb Mon Sep 17 00:00:00 2001 From: Christophe Deschamps Date: Mon, 19 Sep 2022 09:46:13 +0200 Subject: [PATCH] Set special color for local participants in conference --- Classes/Swift/Voip/Theme/VoipTheme.swift | 1 + .../Conference/VoipActiveSpeakerParticipantCell.swift | 3 ++- .../Fragments/Conference/VoipAudioOnlyParticipantCell.swift | 5 ++++- .../Views/Fragments/Conference/VoipGridParticipantCell.swift | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Classes/Swift/Voip/Theme/VoipTheme.swift b/Classes/Swift/Voip/Theme/VoipTheme.swift index b4c0c65be..f4498b9b1 100644 --- a/Classes/Swift/Voip/Theme/VoipTheme.swift +++ b/Classes/Swift/Voip/Theme/VoipTheme.swift @@ -61,6 +61,7 @@ import UIKit static let voipBackgroundColor = LightDarkColor(voip_gray_blue_color,voip_dark_color) static let voipBackgroundBWColor = LightDarkColor(UIColor.white,voip_dark_color) static let voipParticipantBackgroundColor = LightDarkColor(voip_gray_background,voip_dark_color2) + static let voipParticipantMeBackgroundColor = LightDarkColor(voip_gray_background,voip_dark_color3) static let voipExtraButtonsBackgroundColor = LightDarkColor(voip_gray,voip_dark_color3) static let voipToolbarBackgroundColor = LightDarkColor(toolbar_color,voip_dark_color4) static let voipDrawableColor = LightDarkColor(voip_dark_gray,.white) diff --git a/Classes/Swift/Voip/Views/Fragments/Conference/VoipActiveSpeakerParticipantCell.swift b/Classes/Swift/Voip/Views/Fragments/Conference/VoipActiveSpeakerParticipantCell.swift index 0ab00f5ac..c37696767 100644 --- a/Classes/Swift/Voip/Views/Fragments/Conference/VoipActiveSpeakerParticipantCell.swift +++ b/Classes/Swift/Voip/Views/Fragments/Conference/VoipActiveSpeakerParticipantCell.swift @@ -85,7 +85,8 @@ class VoipActiveSpeakerParticipantCell: UICollectionViewCell { } else if (data.videoEnabled.value == true) { self.contentView.backgroundColor = .black } else { - self.contentView.backgroundColor = VoipTheme.voipParticipantBackgroundColor.get() + self.contentView.backgroundColor = data.isMe ? VoipTheme.voipParticipantMeBackgroundColor.get() : VoipTheme.voipParticipantBackgroundColor.get() + } // Avatar diff --git a/Classes/Swift/Voip/Views/Fragments/Conference/VoipAudioOnlyParticipantCell.swift b/Classes/Swift/Voip/Views/Fragments/Conference/VoipAudioOnlyParticipantCell.swift index bc7a44097..376b88c3d 100644 --- a/Classes/Swift/Voip/Views/Fragments/Conference/VoipAudioOnlyParticipantCell.swift +++ b/Classes/Swift/Voip/Views/Fragments/Conference/VoipAudioOnlyParticipantCell.swift @@ -73,6 +73,9 @@ class VoipAudioOnlyParticipantCell: UICollectionViewCell { func updateElements(skipVideo:Bool = false) { if let data = participantData { + // background + contentView.backgroundColor = data.isMe ? VoipTheme.voipParticipantMeBackgroundColor.get() : VoipTheme.voipParticipantBackgroundColor.get() + // Avatar self.avatar.isHidden = data.isInConference.value != true && data.isJoining.value != true @@ -105,7 +108,7 @@ class VoipAudioOnlyParticipantCell: UICollectionViewCell { layer.cornerRadius = corner_radius clipsToBounds = true - contentView.backgroundColor = VoipTheme.voipParticipantBackgroundColor.get() + layer.borderColor = VoipTheme.primary_color.cgColor contentView.addSubview(avatar) diff --git a/Classes/Swift/Voip/Views/Fragments/Conference/VoipGridParticipantCell.swift b/Classes/Swift/Voip/Views/Fragments/Conference/VoipGridParticipantCell.swift index d6e71a8b8..16841b8c8 100644 --- a/Classes/Swift/Voip/Views/Fragments/Conference/VoipGridParticipantCell.swift +++ b/Classes/Swift/Voip/Views/Fragments/Conference/VoipGridParticipantCell.swift @@ -87,7 +87,7 @@ class VoipGridParticipantCell: UICollectionViewCell { } else if (data.videoEnabled.value == true) { self.contentView.backgroundColor = .black } else { - self.contentView.backgroundColor = VoipTheme.voipParticipantBackgroundColor.get() + self.contentView.backgroundColor = data.isMe ? VoipTheme.voipParticipantMeBackgroundColor.get() : VoipTheme.voipParticipantBackgroundColor.get() } // Avatar