void SetTexts()
        {
            HeaderLabel.SetAttributedText(SettingsPage2ViewModel.SETTINGS_PAGE_2_HEADER);
            InitLabel(IntroLabel, FontType.FontRegular, SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_INTRO, 16, 20);
            InitLabel(Header1Label, FontType.FontBold, SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_1_TITLE, 16, 20);
            InitLabel(Paragraph1Label1, FontType.FontRegular, SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_1_CONTENT, 16, 20);
            InitLabel(Paragraph1Label2, FontType.FontRegular, SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_1_CONTENT2, 16, 20);
            InitLabel(Header2Label, FontType.FontBold, SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_2_TITLE, 16, 20);
            InitLabel(Paragraph2Label1, FontType.FontRegular, SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_2_CONTENT, 16, 20);
            InitLabel(Paragraph2Label2, FontType.FontRegular, SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_2_CONTENT2, 16, 20);
            InitLabel(Paragraph2Label3, FontType.FontRegular, SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_2_CONTENT3, 16, 20);
            InitLabel(Paragraph2Label4, FontType.FontRegular, SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_2_CONTENT4, 16, 20);
            InitLabel(Header3Label, FontType.FontBold, SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_3_TITLE, 16, 20);
            InitLabel(Paragraph3Label1, FontType.FontRegular, SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_3_CONTENT, 16, 20);
            InitLabel(Header4Label, FontType.FontBold, SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_4_TITLE, 16, 20);
            InitLabel(Paragraph4Label1, FontType.FontRegular, SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_4_CONTENT, 16, 20);
            InitLabel(Paragraph4Label2, FontType.FontRegular, SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_4_CONTENT2, 16, 20);

            HeaderLabel.AccessibilityTraits  = UIAccessibilityTrait.Header;
            Header1Label.AccessibilityTraits = UIAccessibilityTrait.Header;
            Header2Label.AccessibilityTraits = UIAccessibilityTrait.Header;
            Header3Label.AccessibilityTraits = UIAccessibilityTrait.Header;
            Header4Label.AccessibilityTraits = UIAccessibilityTrait.Header;

            NSMutableAttributedString text = new NSMutableAttributedString();

            text.Append(ApplyStylingToText(SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_4_CONTENT3, FontType.FontRegular));
            // Necessary to unify horizontal alignment with the rest of the text on the page
            Paragraph4Label3.TextContainerInset = UIEdgeInsets.Zero;
            Paragraph4Label3.TextContainer.LineFragmentPadding = 0;

            Paragraph4Label3.AccessibilityTraits    = UIAccessibilityTrait.Link;
            Paragraph4Label3.WeakDelegate           = new OpenTextViewUrlInWebviewDelegate(this);
            Paragraph4Label3.AttributedText         = text;
            Paragraph4Label3.WeakLinkTextAttributes =
                new NSDictionary(
                    UIStringAttributeKey.ForegroundColor,
                    ColorHelper.LINK_COLOR,
                    UIStringAttributeKey.UnderlineStyle,
                    new NSNumber(1));

            //Accessibility
            BackButton.AccessibilityLabel            = SettingsViewModel.BACK_BUTTON_ACCESSIBILITY_TEXT;
            HeaderLabel.AccessibilityAttributedLabel = AccessibilityUtils.RemovePoorlySpokenSymbols(SettingsPage2ViewModel.SETTINGS_PAGE_2_HEADER);
            Header1Label.AccessibilityLabel          = AccessibilityUtils.RemovePoorlySpokenSymbolsString(SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_1_TITLE);
            Paragraph1Label1.AccessibilityLabel      = AccessibilityUtils.RemovePoorlySpokenSymbolsString(SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_1_CONTENT);
            Paragraph1Label2.AccessibilityLabel      = AccessibilityUtils.RemovePoorlySpokenSymbolsString(SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_1_CONTENT2);
            Header2Label.AccessibilityLabel          = AccessibilityUtils.RemovePoorlySpokenSymbolsString(SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_2_TITLE);
            Paragraph2Label1.AccessibilityLabel      = AccessibilityUtils.RemovePoorlySpokenSymbolsString(SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_2_CONTENT);
            Paragraph2Label2.AccessibilityLabel      = AccessibilityUtils.RemovePoorlySpokenSymbolsString(SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_2_CONTENT2);
            Paragraph2Label3.AccessibilityLabel      = AccessibilityUtils.RemovePoorlySpokenSymbolsString(SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_2_CONTENT3);
            Paragraph2Label4.AccessibilityLabel      = AccessibilityUtils.RemovePoorlySpokenSymbolsString(SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_2_CONTENT4);
            Header3Label.AccessibilityLabel          = AccessibilityUtils.RemovePoorlySpokenSymbolsString(SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_3_TITLE);
            Paragraph3Label1.AccessibilityLabel      = AccessibilityUtils.RemovePoorlySpokenSymbolsString(SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_3_CONTENT);
            Header4Label.AccessibilityLabel          = AccessibilityUtils.RemovePoorlySpokenSymbolsString(SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_4_TITLE);
            Paragraph4Label1.AccessibilityLabel      = AccessibilityUtils.RemovePoorlySpokenSymbolsString(SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_4_CONTENT);
            Paragraph4Label2.AccessibilityLabel      = AccessibilityUtils.RemovePoorlySpokenSymbolsString(SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_4_CONTENT2);
            Paragraph4Label3.AccessibilityIdentifier = "contentTextIdentifier";
            Paragraph4Label3.IsAccessibilityElement  = true;
        }
Example #2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            InitLabel(Header, FontType.FontBold, SettingsGeneralViewModel.SETTINGS_GENERAL_TITLE, 24, 28);
            InitLabel(HeaderLabel, FontType.FontBold, SettingsGeneralViewModel.SETTINGS_GENERAL_EXPLANATION_ONE, 26, 28);
            InitLabel(ContentLabel, FontType.FontBold, SettingsGeneralViewModel.SETTINGS_GENERAL_MOBILE_DATA_HEADER, 18, 28);
            InitLabel(ContentLabelOne, FontType.FontRegular, SettingsGeneralViewModel.SETTINGS_GENERAL_EXPLANATION_TWO, 16, 28);
            InitLabel(DescriptionLabel, FontType.FontRegular, SettingsGeneralViewModel.SETTINGS_GENERAL_MOBILE_DATA_DESC, 14, 28);
            InitLabel(ChooseLanguageHeaderLbl, FontType.FontRegular, SettingsGeneralViewModel.SETTINGS_GENERAL_CHOOSE_LANGUAGE_HEADER, 16, 28);
            InitLabel(RadioButton1Lbl, FontType.FontBold, SettingsGeneralViewModel.SETTINGS_GENERAL_NB, 16, 28);
            InitLabel(RadioButton2Lbl, FontType.FontBold, SettingsGeneralViewModel.SETTINGS_GENERAL_NN, 16, 28);
            InitLabel(RadioButton3Lbl, FontType.FontBold, SettingsGeneralViewModel.SETTINGS_GENERAL_EN, 16, 28);

            InitLabel(RestartAppLabl, FontType.FontRegular, SettingsGeneralViewModel.SETTINGS_GENERAL_RESTART_REQUIRED_TEXT, 14, 28);
            InitLabel(SmittestopLinkButtionLbl, FontType.FontRegular, SettingsGeneralViewModel.SETTINGS_GENERAL_MORE_INFO_BUTTON_TEXT, 16, 28);

            //Implemented for correct voiceover due to Back button
            BackButton.AccessibilityLabel = SettingsViewModel.SETTINGS_CHILD_PAGE_ACCESSIBILITY_BACK_BUTTON;

            //Implemented for correct voiceover due to last paragraph and link
            SmittestopLinkButtionLbl.AccessibilityLabel =
                SettingsGeneralViewModel.SETTINGS_GENERAL_ACCESSIBILITY_MORE_INFO_BUTTON_TEXT;

            //Implemented for correct voiceover due to smitte|stop, removing pronunciation of lodretstreg
            ContentLabel.AccessibilityAttributedLabel = AccessibilityUtils.RemovePoorlySpokenSymbols(SettingsGeneralViewModel.SETTINGS_GENERAL_MOBILE_DATA_HEADER);

            _viewModel = new SettingsGeneralViewModel();
        }
        async void UpdateUI()
        {
            _areYouInfectedBtn.AccessibilityLabel        = _viewModel.NewRegistrationAccessibilityText;
            _messageViewBtn.AccessibilityAttributedLabel = AccessibilityUtils.RemovePoorlySpokenSymbols(_viewModel.NewMessageAccessibilityText);
            ActivityExplainerLbl.Text = await _viewModel.StatusTxtDescription();

            SetOnOffBtnState(await _viewModel.IsRunning());
            SetStatusContainerState(await _viewModel.IsRunning());
            UpdateNewIndicatorView();
        }
Example #4
0
        public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
        {
            SettingsItemCell cell = tableView.DequeueReusableCell("SettingsItemCell", indexPath) as SettingsItemCell;

            string text = settingItemList[indexPath.Row].Text;

            cell.SetData(text);
            cell.AccessibilityAttributedLabel = AccessibilityUtils.RemovePoorlySpokenSymbols(text);
            return(cell);
        }
Example #5
0
        async void UpdateUI()
        {
            fhiLogo.AccessibilityLabel                   = InfectionStatusViewModel.SMITTESPORING_FHI_LOGO_ACCESSIBILITY;
            appLogo.AccessibilityLabel                   = InfectionStatusViewModel.SMITTESPORING_APP_LOGO_ACCESSIBILITY;
            _areYouInfectedBtn.AccessibilityLabel        = _viewModel.NewRegistrationAccessibilityText;
            _messageViewBtn.AccessibilityAttributedLabel = AccessibilityUtils.RemovePoorlySpokenSymbols(_viewModel.NewMessageAccessibilityText);
            _dailyNumbersButton.AccessibilityLabel       = _viewModel.NewDailyNumbersAccessibilityText;
            ActivityExplainerLbl.Text = await _viewModel.StatusTxtDescription();

            SetOnOffBtnState(await _viewModel.IsRunning());
            SetStatusContainerState(await _viewModel.IsRunning());
            UpdateNewIndicatorView();
        }
        void SetupStyling()
        {
            InitLabel(Header, FontType.FontBold, SettingsGeneralViewModel.SETTINGS_GENERAL_TITLE, 24, 28);
            InitLabel(HeaderLabel, FontType.FontBold, SettingsGeneralViewModel.SETTINGS_GENERAL_EXPLANATION_ONE, 26,
                      28);
            InitLabel(ContentLabel, FontType.FontBold, SettingsGeneralViewModel.SETTINGS_GENERAL_MOBILE_DATA_HEADER, 18,
                      28);
            InitLabel(ContentLabelOne, FontType.FontRegular, SettingsGeneralViewModel.SETTINGS_GENERAL_EXPLANATION_TWO,
                      16, 28);
            InitLabel(DescriptionLabel, FontType.FontRegular,
                      SettingsGeneralViewModel.SETTINGS_GENERAL_MOBILE_DATA_DESC, 14, 28);
            InitLabel(ChooseLanguageHeaderLbl, FontType.FontRegular,
                      SettingsGeneralViewModel.SETTINGS_GENERAL_CHOOSE_LANGUAGE_HEADER, 16, 28);
            InitLabel(BokmalLabel, FontType.FontBold, SettingsGeneralViewModel.SETTINGS_GENERAL_NB, 16, 28);
            InitLabel(NynorskLabel, FontType.FontBold, SettingsGeneralViewModel.SETTINGS_GENERAL_NN, 16, 28);
            InitLabel(EnglishLabel, FontType.FontBold, SettingsGeneralViewModel.SETTINGS_GENERAL_EN, 16, 28);
            InitLabel(LithuanianLabel, FontType.FontBold, SettingsGeneralViewModel.SETTINGS_GENERAL_LT, 16, 28);
            InitLabel(PolishLabel, FontType.FontBold, SettingsGeneralViewModel.SETTINGS_GENERAL_PL, 16, 28);
            InitLabel(SomaliLabel, FontType.FontBold, SettingsGeneralViewModel.SETTINGS_GENERAL_SO, 16, 28);
            InitLabel(TigrinyaLabel, FontType.FontBold, SettingsGeneralViewModel.SETTINGS_GENERAL_TI, 16, 28);
            InitLabel(ArabicLabel, FontType.FontBold, SettingsGeneralViewModel.SETTINGS_GENERAL_AR, 16, 28);
            InitLabel(UrduLabel, FontType.FontBold, SettingsGeneralViewModel.SETTINGS_GENERAL_UR, 16, 28);


            InitLabel(RestartAppLabl, FontType.FontRegular,
                      SettingsGeneralViewModel.SETTINGS_GENERAL_RESTART_REQUIRED_TEXT, 14, 28);
            InitUnderlinedLabel(SmittestopLinkButtonLbl, FontType.FontRegular,
                                SettingsGeneralViewModel.SETTINGS_GENERAL_MORE_INFO_BUTTON_TEXT, 16, 28);

            Header.TextColor = ColorHelper.TEXT_COLOR_ON_BACKGROUND;
            SmittestopLinkButtonLbl.TextColor = ColorHelper.LINK_COLOR;

            Header.AccessibilityTraits = UIAccessibilityTrait.Header;
            ChooseLanguageHeaderLbl.AccessibilityTraits = UIAccessibilityTrait.Header;

            //Implemented for correct voiceover due to Back button
            BackButton.AccessibilityLabel = SettingsViewModel.BACK_BUTTON_ACCESSIBILITY_TEXT;

            //Implemented for correct voiceover due to last paragraph and link
            SmittestopLinkButtonLbl.AccessibilityLabel =
                SettingsGeneralViewModel.SETTINGS_GENERAL_ACCESSIBILITY_MORE_INFO_BUTTON_TEXT;

            //Implemented for correct voiceover due to smitte|stop, removing pronunciation of lodretstreg
            ContentLabel.AccessibilityAttributedLabel =
                AccessibilityUtils.RemovePoorlySpokenSymbols(SettingsGeneralViewModel
                                                             .SETTINGS_GENERAL_MOBILE_DATA_HEADER);
        }
Example #7
0
        void SetTexts()
        {
            string intro       = SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_INTRO;
            string par1Title   = SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_1_TITLE;
            string par1Content = SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_1_CONTENT;
            string par2Title   = SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_2_TITLE;
            string par2Content = SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_2_CONTENT;
            string par3Title   = SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_3_TITLE;
            string par3Content = SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_3_CONTENT;
            string par4Title   = SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_4_TITLE;
            string par4Content = SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_4_CONTENT;

            string contentText = SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_INTRO +
                                 SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_1_TITLE +
                                 SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_1_CONTENT +
                                 SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_2_TITLE +
                                 SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_2_CONTENT +
                                 SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_3_TITLE +
                                 SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_3_CONTENT +
                                 SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_4_TITLE +
                                 SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_4_CONTENT;

            HeaderLabel.SetAttributedText(SettingsPage2ViewModel.SETTINGS_PAGE_2_HEADER);
            ContentText.TextContainerInset = new UIEdgeInsets(0, 20, 20, 40);
            BackButton.AccessibilityLabel  = SettingsViewModel.SETTINGS_CHILD_PAGE_ACCESSIBILITY_BACK_BUTTON;
            InitLabel(UrlLabel, FontType.FontRegular, SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_4_LINK_TEXT, 16, 28);

            NSMutableAttributedString text = new NSMutableAttributedString();

            text.Append(ApplyStylingToText(intro, FontType.FontRegular, 1.28, 16, 22, false));
            text.Append(ApplyStylingToText(par1Title, FontType.FontBold, 1.28, 16, 22, false));
            text.Append(ApplyStylingToText(par1Content, FontType.FontRegular, 1.28, 16, 22, false));
            text.Append(ApplyStylingToText(par2Title, FontType.FontBold, 1.28, 16, 22, false));
            text.Append(ApplyStylingToText(par2Content, FontType.FontRegular, 1.28, 16, 22, false));
            text.Append(ApplyStylingToText(par3Title, FontType.FontBold, 1.28, 16, 22, false));
            text.Append(ApplyStylingToText(par3Content, FontType.FontRegular, 1.28, 16, 22, false));
            text.Append(ApplyStylingToText(par4Title, FontType.FontBold, 1.28, 16, 22, false));
            text.Append(ApplyStylingToText(par4Content, FontType.FontRegular, 1.28, 16, 22, false));
            ContentText.AttributedText = text;

            //Accessibility
            HeaderLabel.AccessibilityAttributedLabel = AccessibilityUtils.RemovePoorlySpokenSymbols(SettingsPage2ViewModel.SETTINGS_PAGE_2_HEADER);
            ContentText.AccessibilityLabel           = AccessibilityUtils.RemovePoorlySpokenSymbolsString(contentText);
            ContentText.AccessibilityIdentifier      = "contentTextIdentifier";
            ContentText.IsAccessibilityElement       = true;
        }
Example #8
0
        void SetTexts()
        {
            string intro       = SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_INTRO;
            string par1Title   = SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_1_TITLE;
            string par1Content = SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_1_CONTENT;
            string par2Title   = SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_2_TITLE;
            string par2Content = SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_2_CONTENT;
            string par3Title   = SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_3_TITLE;
            string par3Content = SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_3_CONTENT;

            string contentText = SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_INTRO +
                                 SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_1_TITLE +
                                 SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_1_CONTENT +
                                 SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_2_TITLE +
                                 SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_2_CONTENT +
                                 SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_3_TITLE +
                                 SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_3_CONTENT;

            HeaderLabel.SetAttributedText(SettingsPage2ViewModel.SETTINGS_PAGE_2_HEADER);
            ContentText.TextContainerInset = new UIEdgeInsets(0, 20, 20, 40);
            BackButton.AccessibilityLabel  = SettingsViewModel.SETTINGS_CHILD_PAGE_ACCESSIBILITY_BACK_BUTTON;

            NSMutableAttributedString text = new NSMutableAttributedString();

            text.Append(ApplyStylingToText(intro, FontType.FontRegular));
            text.Append(ApplyStylingToText(par1Title, FontType.FontBold));
            text.Append(ApplyStylingToText(par1Content, FontType.FontRegular));
            text.Append(ApplyStylingToText(par2Title, FontType.FontBold));
            text.Append(ApplyStylingToText(par2Content, FontType.FontRegular));
            text.Append(ApplyStylingToText(par3Title, FontType.FontBold));
            text.Append(ApplyStylingToText(par3Content, FontType.FontRegular));
            ContentText.WeakDelegate           = new OpenTextViewUrlInWebviewDelegate(this);
            ContentText.AttributedText         = text;
            ContentText.WeakLinkTextAttributes =
                new NSDictionary(
                    UIStringAttributeKey.ForegroundColor,
                    ColorHelper.TEXT_COLOR_ON_BACKGROUND,
                    UIStringAttributeKey.UnderlineStyle,
                    new NSNumber(1));

            //Accessibility
            HeaderLabel.AccessibilityAttributedLabel = AccessibilityUtils.RemovePoorlySpokenSymbols(SettingsPage2ViewModel.SETTINGS_PAGE_2_HEADER);
            ContentText.AccessibilityLabel           = AccessibilityUtils.RemovePoorlySpokenSymbolsString(contentText);
            ContentText.AccessibilityIdentifier      = "contentTextIdentifier";
            ContentText.IsAccessibilityElement       = true;
        }
Example #9
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            string contentText = SettingsPage5ViewModel.SETTINGS_PAGE_5_CONTENT + " " + SettingsPage5ViewModel.SETTINGS_PAGE_5_LINK;

            HeaderLabel.SetAttributedText(SettingsPage5ViewModel.SETTINGS_PAGE_5_HEADER);

            StyleUtil.InitTextViewWithSpacing(ContentText, FontType.FontRegular, contentText, 1.28, 16, 22);

            //ForegroundColor sets the color of the links. UnderlineStyle determins if the link is underlined, 0 without underline 1 with underline.
            ContentText.WeakLinkTextAttributes = new NSDictionary(UIStringAttributeKey.ForegroundColor, ColorHelper.TEXT_COLOR_ON_BACKGROUND, UIStringAttributeKey.UnderlineStyle, new NSNumber(1));

            StyleUtil.InitLabelWithSpacing(BuildVersionLbl, FontType.FontRegular, SettingsPage5ViewModel.GetVersionInfo(), 1.14, 14, 16);
            BackButton.AccessibilityLabel = SettingsViewModel.SETTINGS_CHILD_PAGE_ACCESSIBILITY_BACK_BUTTON;

            ContentText.AccessibilityIdentifier      = "contentTextIdentifier";
            ContentText.IsAccessibilityElement       = true;
            ContentText.AccessibilityAttributedLabel = AccessibilityUtils.RemovePoorlySpokenSymbols(contentText);

            SetupStyling();
        }
 protected void InitSubTitle(UILabel label, string text)
 {
     InitLabel(label, FontType.FontBold, text, 16, 22);
     label.AccessibilityAttributedLabel = AccessibilityUtils.RemovePoorlySpokenSymbols(text);
 }
 protected void InitBoxText(UILabel label, string text)
 {
     InitLabel(label, FontType.FontRegular, text, 16, 20);
     label.AccessibilityAttributedLabel = AccessibilityUtils.RemovePoorlySpokenSymbols(text);
 }
 protected void InitTitle(UILabel label, string text)
 {
     InitLabelWithSpacing(label, FontType.FontBold, text, 1.14, 24, 26);
     label.AccessibilityAttributedLabel = AccessibilityUtils.RemovePoorlySpokenSymbols(text);
 }
Example #13
0
        async void ShowPickerController()
        {
            SetRecursiveInteraction(View, false);
            View.AddSubview(SpinnerMainView);
            // Make sure accessibility is enabled for the whole view
            SpinnerMainView.AccessibilityElementsHidden = false;
            SpinnerMainView.UserInteractionEnabled      = true;

            // Disable accessibility for the subviews to prevent focus stealing
            SpinnerDialogButton.AccessibilityElementsHidden = true;
            SpinnerDialogButton.UserInteractionEnabled      = false;
            Picker.AccessibilityElementsHidden               = true;
            Picker.UserInteractionEnabled                    = false;
            SpinnerDialogTitle.AccessibilityElementsHidden   = true;
            SpinnerDialogTitle.UserInteractionEnabled        = false;
            SpinnerDialogMessage.AccessibilityElementsHidden = true;
            SpinnerDialogMessage.UserInteractionEnabled      = false;

            StyleUtil.InitLabelWithSpacing(
                SpinnerDialogTitle,
                StyleUtil.FontType.FontBold,
                INFECTION_STATUS_PAUSE_DIALOG_TITLE,
                1.14,
                24,
                38,
                true);
            StyleUtil.InitLabelWithSpacing(
                SpinnerDialogMessage,
                StyleUtil.FontType.FontRegular,
                INFECTION_STATUS_PAUSE_DIALOG_MESSAGE,
                1.28,
                16,
                20,
                true);
            SpinnerDialogButton.SetTitle(
                INFECTION_STATUS_PAUSE_DIALOG_OK_BUTTON,
                UIControlState.Normal);

            SpinnerDialogTitle.AccessibilityAttributedLabel =
                AccessibilityUtils.RemovePoorlySpokenSymbols(INFECTION_STATUS_PAUSE_DIALOG_TITLE);
            SpinnerDialogMessage.AccessibilityAttributedLabel =
                AccessibilityUtils.RemovePoorlySpokenSymbols(INFECTION_STATUS_PAUSE_DIALOG_MESSAGE);
            SpinnerDialogButton.AccessibilityAttributedLabel =
                AccessibilityUtils.RemovePoorlySpokenSymbols(INFECTION_STATUS_PAUSE_DIALOG_OK_BUTTON);

            Picker.Model = new HoursPickerModel(
                new List <string> {
                INFECTION_STATUS_PAUSE_DIALOG_OPTION_NO_REMINDER,
                INFECTION_STATUS_PAUSE_DIALOG_OPTION_ONE_HOUR,
                INFECTION_STATUS_PAUSE_DIALOG_OPTION_TWO_HOURS,
                INFECTION_STATUS_PAUSE_DIALOG_OPTION_FOUR_HOURS,
                INFECTION_STATUS_PAUSE_DIALOG_OPTION_EIGHT_HOURS
            });

            SpinnerMainView.Hidden = false;
            SetFocusTo(SpinnerDialogTitle, () =>
            {
                SpinnerDialogButton.AccessibilityElementsHidden = false;
                SpinnerDialogButton.UserInteractionEnabled      = true;
                Picker.AccessibilityElementsHidden               = false;
                Picker.UserInteractionEnabled                    = true;
                SpinnerDialogTitle.AccessibilityElementsHidden   = false;
                SpinnerDialogTitle.UserInteractionEnabled        = true;
                SpinnerDialogMessage.AccessibilityElementsHidden = false;
                SpinnerDialogMessage.UserInteractionEnabled      = true;
            });
        }
Example #14
0
 void SetAccessibility()
 {
     PageTitle.AccessibilityAttributedLabel = AccessibilityUtils.RemovePoorlySpokenSymbols(WelcomeViewModel.WELCOME_PAGE_TWO_TITLE);
     BodyText1.AccessibilityAttributedLabel = AccessibilityUtils.RemovePoorlySpokenSymbols(WelcomeViewModel.WELCOME_PAGE_TWO_BODY_ONE);
 }
Example #15
0
        private void SetStyling()
        {
            // Set background color and corner radius for views
            DailyNumbersView1.BackgroundColor     = ColorHelper.PRIMARY_COLOR;
            DailyNumbersView1.Layer.CornerRadius  = 12;
            DailyNumbersView2.BackgroundColor     = ColorHelper.PRIMARY_COLOR;
            DailyNumbersView2.Layer.CornerRadius  = 12;
            DailyNumbersView3.BackgroundColor     = ColorHelper.PRIMARY_COLOR;
            DailyNumbersView3.Layer.CornerRadius  = 12;
            DailyNumbersView4.BackgroundColor     = ColorHelper.PRIMARY_COLOR;
            DailyNumbersView4.Layer.CornerRadius  = 12;
            DailyNumbersView7.BackgroundColor     = ColorHelper.PRIMARY_COLOR;
            DailyNumbersView7.Layer.CornerRadius  = 12;
            DailyNumbersView8.BackgroundColor     = ColorHelper.PRIMARY_COLOR;
            DailyNumbersView8.Layer.CornerRadius  = 12;
            DailyNumbersView9.BackgroundColor     = ColorHelper.PRIMARY_COLOR;
            DailyNumbersView9.Layer.CornerRadius  = 12;
            DailyNumbersView10.BackgroundColor    = ColorHelper.PRIMARY_COLOR;
            DailyNumbersView10.Layer.CornerRadius = 12;


            // Labels dependable on device width
            double width   = Xamarin.Essentials.DeviceDisplay.MainDisplayInfo.Width;
            int    fontMin = width <= 700 ? 22 : 27;
            int    fontMax = width <= 700 ? 24 : 29;

            StyleUtil.InitLabelWithSpacing(DailyNumbersNumber1Lbl, StyleUtil.FontType.FontBold, ConfirmedCasesToday, 1.14, fontMin, fontMax);
            DailyNumbersNumber1Lbl.TextColor = ColorHelper.TEXT_COLOR_ON_PRIMARY;
            StyleUtil.InitLabelWithSpacing(DailyNumbersNumber3Lbl, StyleUtil.FontType.FontBold, TestsConductedToday, 1.14, fontMin, fontMax);
            DailyNumbersNumber3Lbl.TextColor = ColorHelper.TEXT_COLOR_ON_PRIMARY;
            StyleUtil.InitLabelWithSpacing(DailyNumbersNumber4Lbl, StyleUtil.FontType.FontBold, PatientsAdmittedToday, 1.14, fontMin, fontMax);
            DailyNumbersNumber4Lbl.TextColor = ColorHelper.TEXT_COLOR_ON_PRIMARY;
            StyleUtil.InitLabelWithSpacing(DailyNumbersNumber5Lbl, StyleUtil.FontType.FontBold, NumberOfPositiveTestsResultsLast7Days, 1.14, fontMin, fontMax);
            DailyNumbersNumber5Lbl.TextColor = ColorHelper.TEXT_COLOR_ON_PRIMARY;
            StyleUtil.InitLabelWithSpacing(DailyNumbersNumber6Lbl, StyleUtil.FontType.FontBold, SmittestopDownloadsTotal, 1.14, fontMin, fontMax);
            DailyNumbersNumber6Lbl.TextColor = ColorHelper.TEXT_COLOR_ON_PRIMARY;
            StyleUtil.InitLabelWithSpacing(DailyNumbersNumber7Lbl, StyleUtil.FontType.FontBold, PatientsIntensiveCare, 1.14, fontMin, fontMax);
            DailyNumbersNumber7Lbl.TextColor = ColorHelper.TEXT_COLOR_ON_PRIMARY;
            StyleUtil.InitLabelWithSpacing(DailyNumbersNumber9Lbl, StyleUtil.FontType.FontBold, VaccinationsDoseOneToday, 1.14, fontMin, fontMax);
            DailyNumbersNumber9Lbl.TextColor = ColorHelper.TEXT_COLOR_ON_PRIMARY;
            StyleUtil.InitLabelWithSpacing(DailyNumbersNumber10Lbl, StyleUtil.FontType.FontBold, VaccinationsDoseTwoToday, 1.14, fontMin, fontMax);
            DailyNumbersNumber10Lbl.TextColor = ColorHelper.TEXT_COLOR_ON_PRIMARY;

            // Labels not dependable on device width
            StyleUtil.InitLabelWithSpacing(DailyNumbersTitleOne, StyleUtil.FontType.FontBold, DAILY_NUMBERS_HEADER, 1.14, 30, 36);
            DailyNumbersTitleOne.AccessibilityTraits = UIAccessibilityTrait.Header;

            StyleUtil.InitLabelWithSpacing(DailyNumbersLbl, StyleUtil.FontType.FontBold, DAILY_NUMBERS_TITLE_ONE, 1.14, 20, 36);
            DailyNumbersLbl.AccessibilityTraits = UIAccessibilityTrait.Header;
            SetupSubTextWithLink(LastUpdateStringSubHeader, DailyNumbersOfTheDayTextLbl);
            DailyNumbersOfTheDayTextLbl.WeakDelegate = new OpenTextViewUrlInWebviewDelegate(this);

            StyleUtil.InitLabelWithSpacing(KeyFeature1Lbl, StyleUtil.FontType.FontRegular, KEY_FEATURE_ONE_LABEL, 1.14, 16, 18);
            StyleUtil.InitLabelWithSpacing(TotalDailyNumbersNumber1Lbl, StyleUtil.FontType.FontRegular, ConfirmedCasesTotal, 1.14, 12, 14);
            KeyFeature1Lbl.TextColor = ColorHelper.TEXT_COLOR_ON_PRIMARY;
            TotalDailyNumbersNumber1Lbl.TextColor = ColorHelper.TEXT_COLOR_ON_PRIMARY;

            StyleUtil.InitLabelWithSpacing(TotalDailyNumbersNumber3Lbl, StyleUtil.FontType.FontRegular, TestsConductedTotal, 1.14, 12, 14);
            StyleUtil.InitLabelWithSpacing(KeyFeature3Lbl, StyleUtil.FontType.FontRegular, KEY_FEATURE_THREE_LABEL, 1.14, 16, 18);
            KeyFeature3Lbl.TextColor = ColorHelper.TEXT_COLOR_ON_PRIMARY;
            TotalDailyNumbersNumber3Lbl.TextColor = ColorHelper.TEXT_COLOR_ON_PRIMARY;

            StyleUtil.InitLabelWithSpacing(KeyFeature4Lbl, StyleUtil.FontType.FontRegular, KEY_FEATURE_FOUR_LABEL, 1.14, 16, 18);
            KeyFeature4Lbl.TextColor = ColorHelper.TEXT_COLOR_ON_PRIMARY;

            StyleUtil.InitLabelWithSpacing(KeyFeature6Lbl, StyleUtil.FontType.FontRegular, KEY_FEATURE_SIX_LABEL, 1.14, 16, 18);
            KeyFeature6Lbl.TextColor = ColorHelper.TEXT_COLOR_ON_PRIMARY;

            StyleUtil.InitLabelWithSpacing(KeyFeature5Lbl, StyleUtil.FontType.FontRegular, KEY_FEATURE_FIVE_LABEL, 1.14, 16, 18);
            StyleUtil.InitLabelWithSpacing(TotalDailyNumbersNumber5Lbl, StyleUtil.FontType.FontRegular, NumberOfPositiveTestsResultsTotal, 1.14, 12, 14);
            KeyFeature5Lbl.TextColor = ColorHelper.TEXT_COLOR_ON_PRIMARY;
            TotalDailyNumbersNumber5Lbl.TextColor = ColorHelper.TEXT_COLOR_ON_PRIMARY;

            StyleUtil.InitLabelWithSpacing(KeyFeature7Lbl, StyleUtil.FontType.FontRegular, KEY_FEATURE_SEVEN_LABEL, 1.14, 16, 18);
            KeyFeature7Lbl.TextColor = ColorHelper.TEXT_COLOR_ON_PRIMARY;

            StyleUtil.InitLabelWithSpacing(DailyNumbersTitleTwo, StyleUtil.FontType.FontBold, DAILY_NUMBERS_TITLE_TWO, 1.14, 20, 36);
            SetupSubTextWithLink(LastUpdateStringSubTextTwo, DailyNumbersSubtextTwo);
            DailyNumbersSubtextTwo.WeakDelegate      = new OpenTextViewUrlInWebviewDelegate(this);
            DailyNumbersTitleTwo.AccessibilityTraits = UIAccessibilityTrait.Header;

            StyleUtil.InitLabelWithSpacing(KeyFeature9Lbl, StyleUtil.FontType.FontRegular, KEY_FEATURE_NINE_LABEL, 1.14, 16, 18);
            KeyFeature9Lbl.AccessibilityLabel = KEY_FEATURE_NINE_ACCESSIBILITY_LABEL;
            StyleUtil.InitLabelWithSpacing(TotalDailyNumbersNumber9Lbl, StyleUtil.FontType.FontRegular, VaccinationsDoseOneTotal, 1.14, 12, 14);
            KeyFeature9Lbl.TextColor = ColorHelper.TEXT_COLOR_ON_PRIMARY;
            TotalDailyNumbersNumber9Lbl.TextColor = ColorHelper.TEXT_COLOR_ON_PRIMARY;

            StyleUtil.InitLabelWithSpacing(KeyFeature10Lbl, StyleUtil.FontType.FontRegular, KEY_FEATURE_TEN_LABEL, 1.14, 16, 18);
            KeyFeature10Lbl.AccessibilityLabel = KEY_FEATURE_TEN_ACCESSIBILITY_LABEL;
            StyleUtil.InitLabelWithSpacing(TotalDailyNumbersNumber10Lbl, StyleUtil.FontType.FontRegular, VaccinationsDoseTwoTotal, 1.14, 12, 14);
            KeyFeature10Lbl.TextColor = ColorHelper.TEXT_COLOR_ON_PRIMARY;
            TotalDailyNumbersNumber10Lbl.TextColor = ColorHelper.TEXT_COLOR_ON_PRIMARY;

            StyleUtil.InitLabelWithSpacing(DailyNumbersTitleThree, StyleUtil.FontType.FontBold, DAILY_NUMBERS_TITLE_THREE, 1.14, 20, 36);
            SetupSubTextWithLink(LastUpdateStringSubSubHeader, DailyNumbersSubSubHeader);
            DailyNumbersSubSubHeader.WeakDelegate      = new OpenTextViewUrlInWebviewDelegate(this);
            DailyNumbersTitleThree.AccessibilityTraits = UIAccessibilityTrait.Header;

            //Setting up accessibility grouping
            Statistics_StackView.ShouldGroupAccessibilityChildren              = true;
            Vaccinations_StackView.ShouldGroupAccessibilityChildren            = true;
            Smittestopp_StackView.ShouldGroupAccessibilityChildren             = true;
            ConfirmedCases_StackView.ShouldGroupAccessibilityChildren          = true;
            NumberOfTests_StackView.ShouldGroupAccessibilityChildren           = true;
            PatientsAdmitted_StackView.ShouldGroupAccessibilityChildren        = true;
            TotalDownloads_StackView.ShouldGroupAccessibilityChildren          = true;
            NumberOfPositiveResults_StackView.ShouldGroupAccessibilityChildren = true;
            VaccinationsDose1_StackView.ShouldGroupAccessibilityChildren       = true;
            VaccinationsDose2_StackView.ShouldGroupAccessibilityChildren       = true;

            // Back button styling and accessibility
            BackButton.AccessibilityLabel = BACK_BUTTON_ACCESSIBILITY_TEXT;

            //Implemented for correct voiceover due to smitte|stop, removing pronunciation of lodretstreg
            KeyFeature5Lbl.AccessibilityAttributedLabel = AccessibilityUtils.RemovePoorlySpokenSymbols(KEY_FEATURE_FIVE_LABEL);
        }