in azure-communication-ui/calling/src/main/java/com/azure/android/communication/ui/calling/presentation/fragment/calling/participantlist/ParticipantListView.kt [46:81]
fun start(viewLifecycleOwner: LifecycleOwner) {
initializeParticipantListDrawer()
viewLifecycleOwner.lifecycleScope.launch {
avatarViewManager.getRemoteParticipantsPersonaSharedFlow().collect {
if (participantListDrawer.isShowing) {
updateParticipantListContent(
viewModel.participantListContentStateFlow.value,
)
}
}
}
viewLifecycleOwner.lifecycleScope.launch {
viewModel.participantListContentStateFlow.collect { vvm ->
if (vvm.isDisplayed) {
showParticipantList()
} else {
if (participantListDrawer.isShowing) {
participantListDrawer.dismissDialog()
}
}
// To avoid, unnecessary updated to list, the state will update lists only when displayed
if (participantListDrawer.isShowing) {
updateParticipantListContent(vvm)
}
if (::admitDeclineAlertDialog.isInitialized && admitDeclineAlertDialog.isShowing &&
!vvm.remoteParticipantList.any { it.userIdentifier == admitDeclinePopUpParticipantId }
) {
admitDeclineAlertDialog.dismiss()
}
}
}
}