コード例 #1
0
        private async void StartStopButton_Click(object sender, EventArgs e)
        {
            await _semaphoreSlim.WaitAsync();

            bool isRunning = await _viewModel.IsEnabled();

            switch (isRunning)
            {
            case true when !_permissionUtils.AreAllPermissionsGranted():
                PreventMultiplePermissionsDialogsForAction(_permissionUtils.HasPermissions);
                _semaphoreSlim.Release();
                break;

            case true:
                await DialogUtils.DisplayDialogAsync(
                    this,
                    _viewModel.OffDialogViewModel,
                    StopGoogleAPI,
                    () => _semaphoreSlim.Release());

                break;

            default:
                await DialogUtils.DisplayDialogAsync(
                    this,
                    _viewModel.OnDialogViewModel,
                    StartGoogleAPI,
                    () => _semaphoreSlim.Release());

                break;
            }

            UpdateUI();
        }
コード例 #2
0
            public async void OnCheckedChanged(RadioGroup group, int checkedId)
            {
                switch (checkedId)
                {
                case Resource.Id.settings_general_english:
                    await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel);

                    LocalPreferencesHelper.SetAppLanguage("en");
                    break;

                case Resource.Id.settings_general_bokmal:
                    await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel);

                    LocalPreferencesHelper.SetAppLanguage("nb");
                    break;

                case Resource.Id.settings_general_nynorsk:
                    await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel);

                    LocalPreferencesHelper.SetAppLanguage("nn");
                    break;
                }
                LocalesService.SetInternationalization();
                // TODO Client do not want reset feature for now. Left for future release.
                //_self._resetViews.ResetViews();
            }
コード例 #3
0
        private async void OnExitClick(object sender, EventArgs args)
        {
            bool isOkPressed = await DialogUtils.DisplayDialogAsync(this, _viewModel.CloseDialogViewModel);

            if (isOkPressed)
            {
                GoToInfectionStatusPage();
            }
        }
コード例 #4
0
 private void ShowOutdatedGPSDialog()
 {
     DialogUtils.DisplayDialogAsync(
         this,
         "BASE_ERROR_TITLE".Translate(),
         "LAUNCHER_PAGE_GPS_VERSION_DIALOG_MESSAGE_ANDROID".Translate(),
         "ERROR_OK_BTN".Translate()
         );
 }
コード例 #5
0
 private async void ShowAbortDialog()
 {
     await DialogUtils.DisplayDialogAsync(
         this,
         AbortDuringEUConsentViewModel,
         GoToLoadingPage,
         null
         );
 }
コード例 #6
0
        private async void OnExitClick(object sender, EventArgs args)
        {
            bool isOkPressed = await DialogUtils.DisplayDialogAsync(this, _viewModel.CloseDialogViewModel);

            if (isOkPressed)
            {
                LogUtils.LogMessage(LogSeverity.INFO, "The user is returning to Infection Status", null, GetCorrelationId());
                GoToInfectionStatusPage();
            }
        }
コード例 #7
0
        private async void OnCheckedChange(object obj, EventArgs args)
        {
            SwitchCompat switchButton = (SwitchCompat)obj;

            if (!switchButton.Checked && !await DialogUtils.DisplayDialogAsync(this, AreYouSureDialogViewModel))
            {
                switchButton.Checked = true;
            }

            _viewModel.OnCheckedChange(switchButton.Checked);
        }
コード例 #8
0
        private async void ShowAreYouSureToExitDialog()
        {
            bool isOkPressed = await DialogUtils.DisplayDialogAsync(
                this,
                ErrorViewModel.REGISTER_LEAVE_HEADER,
                ErrorViewModel.REGISTER_LEAVE_DESCRIPTION,
                ErrorViewModel.REGISTER_LEAVE_CONFIRM,
                ErrorViewModel.REGISTER_LEAVE_CANCEL);

            if (isOkPressed)
            {
                GoToInfectionStatusPage();
            }
        }
コード例 #9
0
        private async void RegistrationLayoutButton_Click(object sender, EventArgs e)
        {
            if (!await IsRunning())
            {
                await DialogUtils.DisplayDialogAsync(
                    this,
                    _viewModel.ReportingIllDialogViewModel);

                return;
            }

            Intent intent = new Intent(this, typeof(InformationAndConsentActivity));

            StartActivity(intent);
        }
コード例 #10
0
        private async void ShowAreYouSureToExitDialog()
        {
            bool isOkPressed = await DialogUtils.DisplayDialogAsync(
                this,
                ErrorViewModel.REGISTER_LEAVE_HEADER,
                ErrorViewModel.REGISTER_LEAVE_DESCRIPTION,
                ErrorViewModel.REGISTER_LEAVE_CONFIRM,
                ErrorViewModel.REGISTER_LEAVE_CANCEL);

            if (isOkPressed)
            {
                LogUtils.LogMessage(LogSeverity.INFO, "The user is returning to Infection Status", null, GetCorrelationId());
                GoToInfectionStatusPage();
            }
        }
コード例 #11
0
        private async void ResetButtonToggled(object sender, EventArgs e)
        {
            ShowSpinner(true);

            await DialogUtils.DisplayDialogAsync(this,
                                                 new DialogViewModel()
            {
                Title        = ConsentViewModel.CONSENT_REMOVE_TITLE,
                Body         = ConsentViewModel.CONSENT_REMOVE_MESSAGE,
                OkBtnTxt     = ConsentViewModel.CONSENT_OK_BUTTON_TEXT,
                CancelbtnTxt = ConsentViewModel.CONSENT_NO_BUTTON_TEXT
            },
                                                 PerformWithdrawAsync,
                                                 (() => ShowSpinner(false)));
        }
コード例 #12
0
        private async void StartStopButton_Click(object sender, EventArgs e)
        {
            bool isRunning = await _viewModel.IsRunning();

            if (isRunning)
            {
                await DialogUtils.DisplayDialogAsync(
                    this,
                    _viewModel.OffDialogViewModel,
                    StopGoogleAPI);
            }
            else
            {
                await DialogUtils.DisplayDialogAsync(
                    this,
                    _viewModel.OnDialogViewModel,
                    StartGoogleAPI);
            }

            UpdateUI();
        }
コード例 #13
0
            public async void OnCheckedChanged(RadioGroup group, int checkedId)
            {
                switch (checkedId)
                {
                case Resource.Id.settings_general_english:
                    await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel);

                    LocalPreferencesHelper.SetAppLanguage("en");
                    break;

                case Resource.Id.settings_general_bokmal:
                    await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel);

                    LocalPreferencesHelper.SetAppLanguage("nb");
                    break;

                case Resource.Id.settings_general_nynorsk:
                    await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel);

                    LocalPreferencesHelper.SetAppLanguage("nn");
                    break;
                }
                LocalesService.SetInternationalization();
            }
コード例 #14
0
        public void ShowMessageDialog(string title, string message, string okBtn, PlatformDialogServiceArguments platformArguments = null)
        {
            Activity activity = platformArguments?.Context != null && platformArguments.Context is Activity act ? act : Current.Activity;

            DialogUtils.DisplayDialogAsync(activity, title, message, okBtn);
        }
コード例 #15
0
 private void ResetLocalData()
 {
     DeviceUtils.CleanDataFromDevice();
     UpdateText("Device cleaned");
     DialogUtils.DisplayDialogAsync(this, "Local data partially deleted", "Delete successful. You still need to reinstall the app to delete Exposure Notification history and to avoid bugs where the app doesn't know we have exceeded the 'provide keys' quota for the past 24 hours", "OK");
 }
コード例 #16
0
            public async void OnCheckedChanged(RadioGroup group, int checkedId)
            {
                switch (checkedId)
                {
                case Resource.Id.settings_general_english:
                    await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel);

                    LocalPreferencesHelper.SetAppLanguage("en");
                    break;

                case Resource.Id.settings_general_bokmal:
                    await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel);

                    LocalPreferencesHelper.SetAppLanguage("nb");
                    break;

                case Resource.Id.settings_general_nynorsk:
                    await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel);

                    LocalPreferencesHelper.SetAppLanguage("nn");
                    break;

                case Resource.Id.settings_general_polish:
                    await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel);

                    LocalPreferencesHelper.SetAppLanguage("pl");
                    break;

                case Resource.Id.settings_general_somali:
                    await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel);

                    LocalPreferencesHelper.SetAppLanguage("so");
                    break;

                case Resource.Id.settings_general_tigrinya:
                    await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel);

                    LocalPreferencesHelper.SetAppLanguage("ti");
                    break;

                case Resource.Id.settings_general_arabic:
                    await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel);

                    LocalPreferencesHelper.SetAppLanguage("ar");
                    break;

                case Resource.Id.settings_general_urdu:
                    await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel);

                    LocalPreferencesHelper.SetAppLanguage("ur");
                    break;

                case Resource.Id.settings_general_lithuanian:
                    await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel);

                    LocalPreferencesHelper.SetAppLanguage("lt");
                    break;
                }
                LocalesService.SetInternationalization();
                _self._resetViews.ResetViews();
            }