void SetTexts()
        {
            InitTitle(TitleLabel, ConsentViewModel.WELCOME_PAGE_CONSENT_TITLE);
            InitSubTitle(About_header, ConsentViewModel.CONSENT_ONE_TITLE);
            InitBodyText(About_section1, ConsentViewModel.CONSENT_ONE_PARAGRAPH_SECTION_ONE);
            InitBodyText(About_section2, ConsentViewModel.CONSENT_ONE_PARAGRAPH_SECTION_TWO);
            InitSubTitle(HowItWorks_header, ConsentViewModel.CONSENT_TWO_TITLE);
            InitBodyText(HowItWorks_section1, ConsentViewModel.CONSENT_TWO_PARAGRAPH_SECTION_ONE);
            InitBodyText(HowItWorks_section2, ConsentViewModel.CONSENT_TWO_PARAGRAPH_SECTION_TWO);
            InitBodyText(Samtykke_section1, ConsentViewModel.CONSENT_THREE_PARAGRAPH_SECTION_ONE);
            InitBodyText(Samtykke_section2, ConsentViewModel.CONSENT_THREE_PARAGRAPH_SECTION_TWO);
            InitBodyText(ContactInformation_section, ConsentViewModel.CONSENT_FOUR_PARAGRAPH);
            InitBodyText(MoreInformation_section, ConsentViewModel.CONSENT_FIVE_PARAGRAPH);
            InitSubTitle(SamtykkeBottom_header, ConsentViewModel.CONSENT_SIX_TITLE);
            InitBodyText(SamtykkeBottom_section, ConsentViewModel.CONSENT_SIX_PARAGRAPH, FontType.FontItalic);
            InitButtonStyling(NextBtn, WelcomeViewModel.NEXT_PAGE_BUTTON_TEXT);
            InitButtonSecondaryStyling(BackBtn, WelcomeViewModel.PREVIOUS_PAGE_BUTTON_TEXT);

            WarningLbl.Font = StyleUtil.Font(FontType.FontBold, 22, 24);
            WarningLbl.Text = ConsentViewModel.CONSENT_REQUIRED;

            AcceptSwitchBtn.AccessibilityLabel   = ConsentViewModel.SWITCH_ACCESSIBILITY_CONSENT_SWITCH_DESCRIPTOR;
            AcceptTextLbl.IsAccessibilityElement = false;
            AcceptTextLbl.Font = StyleUtil.Font(FontType.FontMedium, 18, 20);
            AcceptTextLbl.Text = ConsentViewModel.GIVE_CONSENT_TEXT;

            ActivityIndicator.AccessibilityElementsHidden = true;
        }
        void SetupEncounterAndInfectedButtons()
        {
            MessageView.Subviews[0].Layer.CornerRadius        = 12;
            MessageView.Subviews[0].Layer.BorderWidth         = 1;
            MessageView.Subviews[0].Layer.BorderColor         = ColorHelper.PRIMARY_COLOR.CGColor;
            AreYouInfectetView.Subviews[0].Layer.CornerRadius = 12;
            AreYouInfectetView.Subviews[0].Layer.BorderWidth  = 1;
            AreYouInfectetView.Subviews[0].Layer.BorderColor  = ColorHelper.PRIMARY_COLOR.CGColor;

            MessageLbl.Font         = StyleUtil.Font(StyleUtil.FontType.FontBold, 18, 22);
            MessageLbl.Text         = InfectionStatusViewModel.INFECTION_STATUS_MESSAGE_HEADER_TEXT;
            NewRegistrationLbl.Font = StyleUtil.Font(StyleUtil.FontType.FontRegular, 14, 18);
            NewRegistrationLbl.Text = _viewModel.NewMessageSubheaderTxt;

            AreYouInfectetLbl.Font   = StyleUtil.Font(StyleUtil.FontType.FontBold, 18, 22);
            AreYouInfectetLbl.Text   = InfectionStatusViewModel.INFECTION_STATUS_REGISTRATION_HEADER_TEXT;
            LogInAndRegisterLbl.Font = StyleUtil.Font(StyleUtil.FontType.FontRegular, 14, 18);
            LogInAndRegisterLbl.Text = InfectionStatusViewModel.INFECTION_STATUS_REGISTRATION_SUBHEADER_TEXT;

            // We take the fairly complicated UIViews from the storyboard and embed them into UIButtons
            _messageViewBtn = new UIButton();
            _messageViewBtn.TranslatesAutoresizingMaskIntoConstraints = false;
            StyleUtil.EmbedViewInsideButton(MessageView, _messageViewBtn);

            _areYouInfectedBtn = new UIButton();
            _areYouInfectedBtn.TranslatesAutoresizingMaskIntoConstraints = false;
            StyleUtil.EmbedViewInsideButton(AreYouInfectetView, _areYouInfectedBtn);
        }
Ejemplo n.º 3
0
        void SetTexts()
        {
            InitTitle(TitleLabel, ConsentViewModel.WELCOME_PAGE_CONSENT_TITLE);
            InitSubTitle(Header1Lbl, ConsentViewModel.CONSENT_ONE_TITLE);
            InitBodyText(Paragraph1Lbl, ConsentViewModel.CONSENT_ONE_PARAGRAPH);
            InitSubTitle(Header2Lbl, ConsentViewModel.CONSENT_TWO_TITLE);
            InitBodyText(Paragraph2Lbl, ConsentViewModel.CONSENT_TWO_PARAGRAPH);
            InitSubTitle(Header3Lbl, ConsentViewModel.CONSENT_THREE_TITLE);
            InitBodyText(Paragraph3Lbl, ConsentViewModel.CONSENT_THREE_PARAGRAPH);
            InitSubTitle(Header4Lbl, ConsentViewModel.CONSENT_FOUR_TITLE);
            InitBodyText(Paragraph4Lbl, ConsentViewModel.CONSENT_FOUR_PARAGRAPH);
            InitSubTitle(Header5Lbl, ConsentViewModel.CONSENT_FIVE_TITLE);
            InitBodyText(Paragraph5Lbl, ConsentViewModel.CONSENT_FIVE_PARAGRAPH);
            InitSubTitle(Header6Lbl, ConsentViewModel.CONSENT_SIX_TITLE);
            InitBodyText(Paragraph6Lbl, ConsentViewModel.CONSENT_SIX_PARAGRAPH);
            InitSubTitle(Header7Lbl, ConsentViewModel.CONSENT_SEVEN_TITLE);
            InitBodyText(Paragraph7Lbl, ConsentViewModel.CONSENT_SEVEN_PARAGRAPH);
            InitSubTitle(Header8Lbl, ConsentViewModel.CONSENT_EIGHT_TITLE);
            InitBodyText(Paragraph8Lbl, ConsentViewModel.CONSENT_EIGHT_PARAGRAPH);
            InitSubTitle(Header9Lbl, ConsentViewModel.CONSENT_NINE_TITLE);
            InitBodyText(Paragraph9Lbl, ConsentViewModel.CONSENT_NINE_PARAGRAPH);
            InitButtonStyling(NextBtn, WelcomeViewModel.NEXT_PAGE_BUTTON_TEXT);
            InitButtonSecondaryStyling(BackBtn, WelcomeViewModel.PREVIOUS_PAGE_BUTTON_TEXT);

            WarningLbl.Font = StyleUtil.Font(FontType.FontRegular, 18, 24);
            WarningLbl.Text = ConsentViewModel.CONSENT_REQUIRED;

            AcceptSwitchBtn.AccessibilityLabel   = ConsentViewModel.SWITCH_ACCESSIBILITY_CONSENT_SWITCH_DESCRIPTOR;
            AcceptTextLbl.IsAccessibilityElement = false;
            AcceptTextLbl.Text = ConsentViewModel.GIVE_CONSENT_TEXT;

            ActivityIndicator.AccessibilityElementsHidden = true;
        }
Ejemplo n.º 4
0
        void SetupTextAndStyling()
        {
            TextContainerView.Layer.CornerRadius = 12;
            TextLabel.Text = _displayText;
            TextLabel.Font = StyleUtil.Font(StyleUtil.FontType.FontRegular, 17);

            CloseBtn.SetTitle(_buttonText, UIControlState.Normal);
            CloseBtn.Font = StyleUtil.Font(StyleUtil.FontType.FontBold, 17);

            _stylingAlreadySet = true;
        }
Ejemplo n.º 5
0
        void SetupStyling()
        {
            ActivityExplainerLbl.Font   = StyleUtil.Font(StyleUtil.FontType.FontMedium, 18, 22);
            ActivityExplainerLbl.Text   = InfectionStatusViewModel.INFECTION_STATUS_ACTIVITY_STATUS_DESCRIPTION_TEXT;
            MenuIcon.AccessibilityLabel = InfectionStatusViewModel.INFECTION_STATUS_MENU_ACCESSIBILITY_TEXT;
            MenuLabel.Text = InfectionStatusViewModel.INFECTION_STATUS_MENU_TEXT;
            MenuLabel.Font = StyleUtil.Font(StyleUtil.FontType.FontRegular, 18f, 18f);
            MenuIcon.SizeToFit();
            StatusText.Font             = StyleUtil.Font(StyleUtil.FontType.FontBold, 16f, 20f);
            OnOffBtn.Font               = StyleUtil.Font(StyleUtil.FontType.FontBold, 22f, 28f);
            OnOffBtn.ContentEdgeInsets  = new UIEdgeInsets(12, 12, 12, 12);
            OnOffBtn.Layer.CornerRadius = 8;

            SetupEncounterAndInfectedButtons();
        }
        private void SetupStyling()
        {
            ErrorTitleLabel.Font      = StyleUtil.Font(StyleUtil.FontType.FontBold, 32, 36);
            ErrorTitleLabel.Text      = ErrorTitle;
            ErrorTitleLabel.TextColor = ColorHelper.TEXT_COLOR_ON_BACKGROUND;

            ErrorTitleLabel.AccessibilityTraits = UIAccessibilityTrait.Header;

            NSAttributedStringDocumentAttributes documentAttributes = new NSAttributedStringDocumentAttributes
            {
                DocumentType   = NSDocumentType.HTML,
                StringEncoding = NSStringEncoding.UTF8
            };
            NSError            error            = null;
            NSAttributedString attributedString = new NSAttributedString(
                NSData.FromString(ErrorMessage, NSStringEncoding.UTF8),
                documentAttributes,
                ref error);

            if (error != null)
            {
                Debug.Print(error.LocalizedDescription);
            }
            ErrorMessageLabel.AttributedText = attributedString;
            ErrorMessageLabel.Font           = StyleUtil.Font(StyleUtil.FontType.FontRegular, 20, 24);
            ErrorMessageLabel.Editable       = false;
            ErrorMessageLabel.Selectable     = true;
            ErrorMessageLabel.TextColor      = ColorHelper.TEXT_COLOR_ON_BACKGROUND;

            StyleUtil.InitButtonStyling(OkButton, ErrorViewModel.REGISTER_ERROR_DISMISS);

            BackButton.AccessibilityLabel = ErrorViewModel.REGISTER_ERROR_ACCESSIBILITY_CLOSE_BUTTON_TEXT;
            BackButton.TintColor          = ColorHelper.PRIMARY_COLOR;

            ErrorTitleLabel.IsAccessibilityElement   = ErrorTitle != "";
            ErrorMessageLabel.IsAccessibilityElement = ErrorMessage != "";

            if (ErrorTitleLabel.IsAccessibilityElement && ErrorTitle == ErrorViewModel.REGISTER_ERROR_TOOMANYTRIES_HEADER)
            {
                ErrorTitleLabel.AccessibilityLabel = ErrorViewModel.REGISTER_ERROR_ACCESSIBILITY_TOOMANYTRIES_HEADER;
            }

            if (ErrorMessageLabel.IsAccessibilityElement && ErrorMessage == ErrorViewModel.REGISTER_ERROR_TOOMANYTRIES_DESCRIPTION)
            {
                ErrorMessageLabel.AccessibilityLabel = ErrorViewModel.REGISTER_ERROR_ACCESSIBILITY_TOOMANYTRIES_DESCRIPTION;
            }
        }
Ejemplo n.º 7
0
        void SetupStyling()
        {
            NewIndicatorView.Layer.CornerRadius = NewIndicatorView.Layer.Frame.Height / 2;
            ActivityExplainerLbl.Font           = StyleUtil.Font(StyleUtil.FontType.FontMedium, 18, 22);
            ActivityExplainerLbl.Text           = InfectionStatusViewModel.INFECTION_STATUS_ACTIVITY_STATUS_DESCRIPTION_TEXT;
            MenuIcon.AccessibilityLabel         = InfectionStatusViewModel.INFECTION_STATUS_MENU_ACCESSIBILITY_TEXT;
            MenuIcon.TitleEdgeInsets            = new UIEdgeInsets(0, -8, 0, 0);
            MenuIcon.SetTitle(InfectionStatusViewModel.INFECTION_STATUS_MENU_TEXT, UIControlState.Normal);
            MenuIcon.Font = StyleUtil.Font(StyleUtil.FontType.FontRegular, 18f, 18f);
            MenuIcon.SizeToFit();
            StyleUtil.InitLabel(StatusHeader, StyleUtil.FontType.FontBold, InfectionStatusViewModel.INFECTION_STATUS_PAGE_TITLE, 22f, 26f);
            StatusText.Font             = StyleUtil.Font(StyleUtil.FontType.FontRegular, 16f, 20f);
            OnOffBtn.Font               = StyleUtil.Font(StyleUtil.FontType.FontBold, 22f, 28f);
            OnOffBtn.ContentEdgeInsets  = new UIEdgeInsets(12, 12, 12, 12);
            OnOffBtn.Layer.CornerRadius = 8;

            SetupEncounterAndInfectedButtons();
        }
Ejemplo n.º 8
0
        private void SetupStyling()
        {
            ErrorTitleLabel.Font      = StyleUtil.Font(StyleUtil.FontType.FontBold, 32, 36);
            ErrorTitleLabel.Text      = ErrorTitle;
            ErrorTitleLabel.TextColor = ColorHelper.TEXT_COLOR_ON_BACKGROUND;

            // Ensure the linespacing is set correctly to the UITextView ErrorMessageLabel.
            var AttributedErrorMessage             = new NSMutableAttributedString(ErrorMessage);
            NSMutableParagraphStyle paragraphStyle = new NSMutableParagraphStyle();

            paragraphStyle.LineSpacing = 0;
            AttributedErrorMessage.AddAttribute(UIStringAttributeKey.ParagraphStyle, paragraphStyle, new NSRange(0, ErrorMessage.Length));

            ErrorMessageLabel.AttributedText = AttributedErrorMessage;
            ErrorMessageLabel.Font           = StyleUtil.Font(StyleUtil.FontType.FontRegular, 20, 24);
            ErrorMessageLabel.Editable       = false;
            ErrorMessageLabel.Selectable     = true;
            ErrorMessageLabel.TextColor      = ColorHelper.TEXT_COLOR_ON_BACKGROUND;

            StyleUtil.InitButtonStyling(OkButton, ErrorViewModel.REGISTER_ERROR_DISMISS);

            BackButton.AccessibilityLabel = ErrorViewModel.REGISTER_ERROR_ACCESSIBILITY_CLOSE_BUTTON_TEXT;
            BackButton.TintColor          = ColorHelper.PRIMARY_COLOR;

            ErrorTitleLabel.IsAccessibilityElement   = ErrorTitle == "" ? false : true;
            ErrorMessageLabel.IsAccessibilityElement = ErrorMessage == "" ? false : true;

            if (ErrorTitleLabel.IsAccessibilityElement == true && ErrorTitle == ErrorViewModel.REGISTER_ERROR_TOOMANYTRIES_HEADER)
            {
                ErrorTitleLabel.AccessibilityLabel = ErrorViewModel.REGISTER_ERROR_ACCESSIBILITY_TOOMANYTRIES_HEADER;
            }

            if (ErrorMessageLabel.IsAccessibilityElement == true && ErrorMessage == ErrorViewModel.REGISTER_ERROR_TOOMANYTRIES_DESCRIPTION)
            {
                ErrorMessageLabel.AccessibilityLabel = ErrorViewModel.REGISTER_ERROR_ACCESSIBILITY_TOOMANYTRIES_DESCRIPTION;
            }
        }
 public override void AwakeFromNib()
 {
     TextLbl.Font      = StyleUtil.Font(StyleUtil.FontType.FontBold, 24, 34);
     TextLbl.TextColor = ColorHelper.TEXT_COLOR_ON_BACKGROUND;
 }