From 137eb6de294b26996c0684212c9be24b8432cbc4 Mon Sep 17 00:00:00 2001 From: Christophe Deschamps Date: Wed, 11 May 2022 15:14:58 +0200 Subject: [PATCH] Set appropriate visibility of Conference layout --- .../ActiveCallOrConferenceView.swift | 5 +++-- .../Conference/VoipConferenceActiveSpeakerView.swift | 5 ----- .../Fragments/Conference/VoipConferenceGridView.swift | 7 +------ 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/Classes/Swift/Voip/Views/CompositeViewControllers/ActiveCallOrConferenceView.swift b/Classes/Swift/Voip/Views/CompositeViewControllers/ActiveCallOrConferenceView.swift index 8583bef83..152242a88 100644 --- a/Classes/Swift/Voip/Views/CompositeViewControllers/ActiveCallOrConferenceView.swift +++ b/Classes/Swift/Voip/Views/CompositeViewControllers/ActiveCallOrConferenceView.swift @@ -122,8 +122,9 @@ import linphonesw self.currentCallView!.isHidden = true self.extraButtonsView.isHidden = true self.conferencePausedView?.isHidden = true - self.conferenceGridView!.isHidden = false - self.conferenceActiveSpeakerView?.isHidden = true + let conferenceMode = ConferenceViewModel.shared.conferenceDisplayMode.value + self.conferenceGridView!.isHidden = conferenceMode != .Grid + self.conferenceActiveSpeakerView?.isHidden = conferenceMode != .ActiveSpeaker self.conferenceGridView?.conferenceViewModel = ConferenceViewModel.shared } else { self.conferenceGridView?.isHidden = true diff --git a/Classes/Swift/Voip/Views/Fragments/Conference/VoipConferenceActiveSpeakerView.swift b/Classes/Swift/Voip/Views/Fragments/Conference/VoipConferenceActiveSpeakerView.swift index 09d1d4c9b..723d3f007 100644 --- a/Classes/Swift/Voip/Views/Fragments/Conference/VoipConferenceActiveSpeakerView.swift +++ b/Classes/Swift/Voip/Views/Fragments/Conference/VoipConferenceActiveSpeakerView.swift @@ -219,11 +219,6 @@ class VoipConferenceActiveSpeakerView: UIView, UICollectionViewDataSource, UICol // UICollectionView related delegates - func collectionView(_ collectionView: UICollectionView, didEndDisplaying cell: UICollectionViewCell, forItemAt indexPath: IndexPath) { - let gcell = (cell as! VoipActiveSpeakerParticipantCell) - gcell.participantData?.participantDevice.nativeVideoWindowId = nil - gcell.participantData?.clearObservers() - } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat { return inter_cell diff --git a/Classes/Swift/Voip/Views/Fragments/Conference/VoipConferenceGridView.swift b/Classes/Swift/Voip/Views/Fragments/Conference/VoipConferenceGridView.swift index b4c93bfee..d2394bec1 100644 --- a/Classes/Swift/Voip/Views/Fragments/Conference/VoipConferenceGridView.swift +++ b/Classes/Swift/Voip/Views/Fragments/Conference/VoipConferenceGridView.swift @@ -151,7 +151,7 @@ class VoipConferenceGridView: UIView, UICollectionViewDataSource, UICollectionVi } ControlsViewModel.shared.fullScreenMode.observe { (fullScreen) in - if (self.isHidden) { + if (self.isHidden || self.conferenceViewModel?.conference.value?.call?.params?.conferenceVideoLayout != .Grid) { return } self.gridContainer.removeConstraints().done() @@ -189,11 +189,6 @@ class VoipConferenceGridView: UIView, UICollectionViewDataSource, UICollectionVi } } - func collectionView(_ collectionView: UICollectionView, didEndDisplaying cell: UICollectionViewCell, forItemAt indexPath: IndexPath) { - let gcell = (cell as! VoipGridParticipantCell) - gcell.participantData?.participantDevice.nativeVideoWindowId = nil - gcell.participantData?.clearObservers() - } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat { return inter_cell