Exemplo n.º 1
0
        private void OnVoipStateUpdate(VoipState voipState)
        {
            RunOnUiThread(async () =>
            {
                _currentVoipState = voipState.State;

                switch (voipState.State)
                {
                    case VoipStateEnum.LocalRinging:
                        await PlaySound(true);
                        ShowAsParallel = false;
                        UpdateSelection();
                        break;
                    case VoipStateEnum.RemoteRinging:
                        await PlaySound(false);
                        ShowAsParallel = false;
                        UpdateSelection();
                        break;
                    case VoipStateEnum.Idle:
                        await StopSound();
                        ShowAsParallel = LayoutService.Instance.LayoutType == LayoutType.Parallel;
                        UpdateSelection();
                        break;
                    case VoipStateEnum.EstablishOutgoing:
                    case VoipStateEnum.EstablishIncoming:
                        await StopSound();
                        break;
                    case VoipStateEnum.HangingUp:
                    case VoipStateEnum.ActiveCall:
                        break;
                    default:
                        throw new ArgumentOutOfRangeException();
                }
            });
        }
Exemplo n.º 2
0
        private void OnVoipStateUpdate(VoipState voipState)
        {
            RunOnUiThread(async() =>
            {
                _currentVoipState = voipState.State;

                switch (voipState.State)
                {
                case VoipStateEnum.LocalRinging:
                    await PlaySound(true);
                    ShowAsParallel = false;
                    UpdateSelection();
                    break;

                case VoipStateEnum.RemoteRinging:
                    await PlaySound(false);
                    ShowAsParallel = false;
                    UpdateSelection();
                    break;

                case VoipStateEnum.Idle:
                    await StopSound();
                    ShowAsParallel = LayoutService.Instance.LayoutType == LayoutType.Parallel;
                    UpdateSelection();
                    break;

                case VoipStateEnum.EstablishOutgoing:
                case VoipStateEnum.EstablishIncoming:
                    await StopSound();
                    break;

                case VoipStateEnum.HangingUp:
                case VoipStateEnum.ActiveCall:
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
            });
        }