Esempio n. 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();
        }
            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();
            }
Esempio n. 3
0
        private async void OnExitClick(object sender, EventArgs args)
        {
            bool isOkPressed = await DialogUtils.DisplayDialogAsync(this, _viewModel.CloseDialogViewModel);

            if (isOkPressed)
            {
                GoToInfectionStatusPage();
            }
        }
 private void ShowOutdatedGPSDialog()
 {
     DialogUtils.DisplayDialogAsync(
         this,
         "BASE_ERROR_TITLE".Translate(),
         "LAUNCHER_PAGE_GPS_VERSION_DIALOG_MESSAGE_ANDROID".Translate(),
         "ERROR_OK_BTN".Translate()
         );
 }
 private async void ShowAbortDialog()
 {
     await DialogUtils.DisplayDialogAsync(
         this,
         AbortDuringEUConsentViewModel,
         GoToLoadingPage,
         null
         );
 }
Esempio n. 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();
            }
        }
Esempio n. 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);
        }
        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();
            }
        }
Esempio n. 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);
        }
Esempio n. 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();
            }
        }
Esempio n. 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)));
        }
        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();
        }
Esempio n. 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();
            }
Esempio n. 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);
        }
 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");
 }
            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();
            }