Fixed issue with switch from grid to active speaker conference layout when 6 participants are reached
This commit is contained in:
parent
219cfed4ce
commit
f3419951f8
4 changed files with 4 additions and 8 deletions
|
@ -84,6 +84,7 @@ class ConferenceCallFragment : GenericFragment<VoipConferenceCallFragmentBinding
|
||||||
viewLifecycleOwner
|
viewLifecycleOwner
|
||||||
) { displayMode ->
|
) { displayMode ->
|
||||||
startTimer(R.id.active_conference_timer)
|
startTimer(R.id.active_conference_timer)
|
||||||
|
|
||||||
if (displayMode == ConferenceDisplayMode.ACTIVE_SPEAKER) {
|
if (displayMode == ConferenceDisplayMode.ACTIVE_SPEAKER) {
|
||||||
if (conferenceViewModel.conferenceExists.value == true) {
|
if (conferenceViewModel.conferenceExists.value == true) {
|
||||||
Log.i("[Conference Call] Local participant is in conference and current layout is active speaker, updating Core's native window id")
|
Log.i("[Conference Call] Local participant is in conference and current layout is active speaker, updating Core's native window id")
|
||||||
|
@ -107,6 +108,8 @@ class ConferenceCallFragment : GenericFragment<VoipConferenceCallFragmentBinding
|
||||||
it.size > conferenceViewModel.maxParticipantsForMosaicLayout
|
it.size > conferenceViewModel.maxParticipantsForMosaicLayout
|
||||||
) {
|
) {
|
||||||
showSnackBar(R.string.conference_too_many_participants_for_mosaic_layout)
|
showSnackBar(R.string.conference_too_many_participants_for_mosaic_layout)
|
||||||
|
Log.w("[Conference Call] More than ${conferenceViewModel.maxParticipantsForMosaicLayout} participants (${it.size}), forcing active speaker layout")
|
||||||
|
conferenceViewModel.conferenceDisplayMode.value = ConferenceDisplayMode.ACTIVE_SPEAKER
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ class ConferenceLayoutFragment : GenericFragment<VoipConferenceLayoutFragmentBin
|
||||||
conferenceViewModel.conferenceParticipantDevices.observe(
|
conferenceViewModel.conferenceParticipantDevices.observe(
|
||||||
viewLifecycleOwner
|
viewLifecycleOwner
|
||||||
) {
|
) {
|
||||||
if (it.size > conferenceViewModel.maxParticipantsForMosaicLayout) {
|
if (it.size > conferenceViewModel.maxParticipantsForMosaicLayout && conferenceViewModel.conferenceDisplayMode.value == ConferenceDisplayMode.GRID) {
|
||||||
showTooManyParticipantsForMosaicLayoutDialog()
|
showTooManyParticipantsForMosaicLayoutDialog()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,12 +69,6 @@ class ConferenceViewModel : ViewModel() {
|
||||||
override fun onParticipantAdded(conference: Conference, participant: Participant) {
|
override fun onParticipantAdded(conference: Conference, participant: Participant) {
|
||||||
Log.i("[Conference] Participant added: ${participant.address.asStringUriOnly()}")
|
Log.i("[Conference] Participant added: ${participant.address.asStringUriOnly()}")
|
||||||
updateParticipantsList(conference)
|
updateParticipantsList(conference)
|
||||||
|
|
||||||
val count = conferenceParticipants.value.orEmpty().size
|
|
||||||
if (count > maxParticipantsForMosaicLayout && conferenceDisplayMode.value == ConferenceDisplayMode.GRID) {
|
|
||||||
Log.w("[Conference] More than $maxParticipantsForMosaicLayout participants ($count), forcing active speaker layout")
|
|
||||||
conferenceDisplayMode.value = ConferenceDisplayMode.ACTIVE_SPEAKER
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onParticipantRemoved(conference: Conference, participant: Participant) {
|
override fun onParticipantRemoved(conference: Conference, participant: Participant) {
|
||||||
|
|
|
@ -93,7 +93,6 @@
|
||||||
android:checked="@{conferenceViewModel.conferenceDisplayMode == ConferenceDisplayMode.ACTIVE_SPEAKER}"
|
android:checked="@{conferenceViewModel.conferenceDisplayMode == ConferenceDisplayMode.ACTIVE_SPEAKER}"
|
||||||
android:drawableEnd="@drawable/icon_conference_layout_active_speaker"
|
android:drawableEnd="@drawable/icon_conference_layout_active_speaker"
|
||||||
android:drawableTint="?attr/voipDrawableColor"
|
android:drawableTint="?attr/voipDrawableColor"
|
||||||
android:enabled="@{conferenceViewModel.conferenceParticipantDevices.size() > conferenceViewModel.maxParticipantsForMosaicLayout ? false : true}"
|
|
||||||
android:onClickListener="@{() -> conferenceViewModel.changeLayout(ConferenceDisplayMode.ACTIVE_SPEAKER)}"
|
android:onClickListener="@{() -> conferenceViewModel.changeLayout(ConferenceDisplayMode.ACTIVE_SPEAKER)}"
|
||||||
android:text="@string/conference_display_mode_active_speaker" />
|
android:text="@string/conference_display_mode_active_speaker" />
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue