fun start()

in azure-communication-ui/calling/src/main/java/com/azure/android/communication/ui/calling/presentation/fragment/calling/controlbar/captions/CaptionsListView.kt [41:105]


    fun start(viewLifecycleOwner: LifecycleOwner) {
        initializeDrawer()

        viewLifecycleOwner.lifecycleScope.launchAll(
            {
                viewModel.displayStateFlow.collect {
                    if (it) {
                        menuDrawer.show()
                    } else {
                        menuDrawer.dismiss()
                    }
                }
            },
            {
                viewModel.activeCaptionLanguageStateFlow.collect {
                    redrawCaptionsListView()
                }
            },
            {
                viewModel.activeSpokenLanguageStateFlow.collect {
                    redrawCaptionsListView()
                }
            },
            {
                viewModel.isCaptionsLangButtonVisibleStateFlow.collect {
                    redrawCaptionsListView()
                }
            },
            {
                viewModel.isCaptionsActiveStateFlow.collect {
                    redrawCaptionsListView()
                }
            },
            {
                viewModel.isCaptionsToggleVisibleStateFlow.collect {
                    redrawCaptionsListView()
                }
            },
            {
                viewModel.isCaptionsToggleEnabledStateFlow.collect {
                    redrawCaptionsListView()
                }
            },
            {
                viewModel.isCaptionsEnabledStateFlow.collect {
                    redrawCaptionsListView()
                }
            },
            {
                viewModel.isSpokenLanguageButtonVisibleStateFlow.collect {
                    redrawCaptionsListView()
                }
            },
            {
                viewModel.isSpokenLanguageButtonEnabledStateFlow.collect {
                    redrawCaptionsListView()
                }
            },
            {
                viewModel.isRttButtonEnabledStateFlow.collect {
                    redrawCaptionsListView()
                }
            },
        )
    }