コード例 #1
0
        void Init()
        {
            ImageButton backButton = FindViewById <ImageButton>(Resource.Id.arrow_back_about);

            backButton.ContentDescription = ViewModels.SettingsViewModel.BACK_BUTTON_ACCESSIBILITY_TEXT;

            TextView titleField = FindViewById <TextView>(Resource.Id.settings_about_title);
            TextView textField  = FindViewById <TextView>(Resource.Id.settings_about_text);
            TextView hiddenLink = FindViewById <TextView>(Resource.Id.settings_about_link);

            FindViewById <TextView>(Resource.Id.settings_about_version_info_textview).Text = ViewModels.SettingsPage5ViewModel.GetVersionInfo();

            titleField.Text = SettingsPage5ViewModel.SETTINGS_PAGE_5_HEADER;
            titleField.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());
            textField.Text = SettingsPage5ViewModel.SETTINGS_PAGE_5_CONTENT +
                             $"\n {SettingsPage5ViewModel.SETTINGS_PAGE_5_LINK}";
            textField.TextAlignment = TextAlignment.ViewStart;

            backButton.Click += new SingleClick((sender, args) => Finish()).Run;

            hiddenLink.Text = SettingsPage5ViewModel.SETTINGS_PAGE_5_LINK;

            LinkUtil.LinkifyTextView(hiddenLink);

            TextView accessibilityStatementLink = FindViewById <TextView>(Resource.Id.accessibility_statement_btn);

            accessibilityStatementLink.TextFormatted  = HtmlCompat.FromHtml($"<a href=\"{SettingsPage5ViewModel.SETTINGS_PAGE_5_ACCESSIBILITY_STATEMENT_BUTTON_URL}\">{SettingsPage5ViewModel.SETTINGS_PAGE_5_ACCESSIBILITY_STATEMENT_BUTTON_TEXT}</a>", HtmlCompat.FromHtmlModeLegacy);
            accessibilityStatementLink.MovementMethod = new Android.Text.Method.LinkMovementMethod();

            View rootView = Window.DecorView.RootView;

            rootView.LayoutDirection = LayoutUtils.GetLayoutDirection();
            backButton.SetBackgroundResource(LayoutUtils.GetBackArrow());
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

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

            if (error != null)
            {
                LogUtils.LogMessage(Enums.LogSeverity.ERROR, error.LocalizedDescription);
            }

            //Ensuring text is resiezed correctly when font size is increased
            StyleUtil.InitLabekWithSpacingAndHTMLFormatting(
                TextLabel, StyleUtil.FontType.FontBold, attributedString, 1.28, 24, 30, UITextAlignment.Center);
            TextLabel.TextColor = ColorHelper.TEXT_COLOR_ON_BACKGROUND;

            StyleUtil.InitButtonStyling(AppStoreLinkButton, ForceUpdateViewModel.FORCE_UPDATE_BUTTON_APPSTORE_IOS);
            AppStoreLinkButton.AccessibilityTraits = UIAccessibilityTrait.Link;

            FhiLogo.AccessibilityLabel   = ForceUpdateViewModel.SMITTESPORING_FHI_LOGO_ACCESSIBILITY;
            TextLabel.AccessibilityLabel = AccessibilityUtils.RemovePoorlySpokenSymbolsString(ForceUpdateViewModel.FORCE_UPDATE_MESSAGE);
        }
コード例 #3
0
 void SetOnOffBtnState(bool isRunning)
 {
     if (isRunning)
     {
         string accessibilityText = InfectionStatusViewModel.INFECTION_STATUS_STOP_BUTTON_ACCESSIBILITY_TEXT;
         string buttonText        = InfectionStatusViewModel.INFECTION_STATUS_STOP_BUTTON_TEXT;
         OnOffBtn.AccessibilityLabel = AccessibilityUtils.RemovePoorlySpokenSymbolsString(accessibilityText);
         OnOffBtn.BackgroundColor    = UIColor.Clear;
         OnOffBtn.Layer.BorderColor  = ColorHelper.PRIMARY_COLOR.CGColor;
         OnOffBtn.Layer.BorderWidth  = 1;
         OnOffBtn.SetTitleColor(ColorHelper.PRIMARY_COLOR, UIControlState.Normal);
         OnOffBtn.SetTitle(buttonText, UIControlState.Normal);
     }
     else
     {
         string accessibilityText = InfectionStatusViewModel.INFECTION_STATUS_START_BUTTON_ACCESSIBILITY_TEXT;
         string buttonText        = InfectionStatusViewModel.INFECTION_STATUS_START_BUTTON_TEXT;
         OnOffBtn.AccessibilityLabel = AccessibilityUtils.RemovePoorlySpokenSymbolsString(accessibilityText);
         OnOffBtn.BackgroundColor    = ColorHelper.PRIMARY_COLOR;
         OnOffBtn.Layer.BorderColor  = UIColor.Clear.CGColor;
         OnOffBtn.Layer.BorderWidth  = 0;
         OnOffBtn.SetTitleColor(ColorHelper.TEXT_COLOR_ON_PRIMARY, UIControlState.Normal);
         OnOffBtn.SetTitle(buttonText, UIControlState.Normal);
     }
 }
コード例 #4
0
        private void Init()
        {
            _questionnaireViewModel = new QuestionnaireViewModel();

            TextView questionnaireTitle = FindViewById <TextView>(Resource.Id.questionnaire_title);

            questionnaireTitle.Text = REGISTER_QUESTIONAIRE_HEADER;
            questionnaireTitle.ContentDescription = REGISTER_QUESTIONAIRE_HEADER;
            questionnaireTitle.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());

            TextView questionnaireSubtitle = FindViewById <TextView>(Resource.Id.questionnaire_subtitle);
            ISpanned questionnaireSubtitleTextFormatted =
                HtmlCompat.FromHtml(REGISTER_QUESTIONAIRE_SYMPTOMONSET_TEXT, HtmlCompat.FromHtmlModeLegacy);

            questionnaireSubtitle.TextFormatted = questionnaireSubtitleTextFormatted;
            questionnaireSubtitle.ContentDescriptionFormatted = questionnaireSubtitleTextFormatted;

            _questionnaireButton      = FindViewById <Button>(Resource.Id.questionnaire_button);
            _questionnaireButton.Text = REGISTER_QUESTIONAIRE_NEXT;
            _questionnaireButton.ContentDescription = REGISTER_QUESTIONAIRE_NEXT;
            _questionnaireButton.Click += OnNextButtonClick;

            _infoButton = FindViewById <ImageButton>(Resource.Id.questionnaire_info_button);
            _infoButton.ContentDescription = REGISTER_QUESTIONAIRE_ACCESSIBILITY_DATE_INFO_BUTTON;
            _infoButton.Click += OnInfoButtonPressed;

            _closeButton = FindViewById <Button>(Resource.Id.close_cross_btn);
            _closeButton.ContentDescription = SettingsViewModel.SETTINGS_ITEM_ACCESSIBILITY_CLOSE_BUTTON;
            _closeButton.Click +=
                new SingleClick((o, ev) => ShowAreYouSureToExitDialog()).Run;

            LogUtils.LogMessage(LogSeverity.INFO, "The user is seeing the Questionnaire page");

            PrepareRadioButtons();
        }
コード例 #5
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View     view        = inflater.Inflate(Resource.Layout.welcome_page_three, container, false);
            TextView bodyOne     = view.FindViewById <TextView>(Resource.Id.welcome_page_three_body_one);
            TextView bodyTwo     = view.FindViewById <TextView>(Resource.Id.welcome_page_three_body_two);
            TextView header      = view.FindViewById <TextView>(Resource.Id.welcome_page_three_title);
            TextView infoBoxBody = view.FindViewById <TextView>(Resource.Id.welcome_page_three_infobox_body);

            bodyOne.Text     = WelcomeViewModel.WELCOME_PAGE_THREE_BODY_ONE;
            bodyTwo.Text     = WelcomeViewModel.WELCOME_PAGE_THREE_BODY_TWO;
            header.Text      = WelcomeViewModel.WELCOME_PAGE_THREE_TITLE;
            infoBoxBody.Text = WelcomeViewModel.WELCOME_PAGE_THREE_INFOBOX_BODY;

            header.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());

            infoBoxBody.ContentDescription = WelcomeViewModel.WELCOME_PAGE_THREE_INFOBOX_BODY;

            view.LayoutDirection = LayoutUtils.GetLayoutDirection();
            Button arrowBack = view.FindViewById <Button>(Resource.Id.arrow_back);

            arrowBack.SetBackgroundResource(LayoutUtils.GetBackArrow());

            WelcomePageTools.SetArrowVisibility(view);

            return(view);
        }
        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;
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.welcome_what_is_new);

            TextView title = FindViewById <TextView>(Resource.Id.welcome_what_is_new_title);

            title.Text = WELCOME_PAGE_WHATS_NEW_TITLE;
            title.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());

            SetBulletText(Resource.Id.bullet_one, WELCOME_PAGE_WHATS_NEW_BULLET_ONE);
            SetBulletText(Resource.Id.bullet_two, WELCOME_PAGE_WHATS_NEW_BULLET_TWO);

            Button   button = FindViewById <Button>(Resource.Id.ok_button);
            TextView footer = FindViewById <TextView>(Resource.Id.footer);

            button.Text = WELCOME_PAGE_WHATS_NEW_BUTTON;
            footer.Text = WELCOME_PAGE_WHATS_NEW_FOOTER;

            button.Click += new StressUtils.SingleClick((o, args) =>
            {
                OnboardingStatusHelper.Status = ConsentsHelper.GetStatusDependingOnRelease();
                NavigationHelper.GoToResultPageAndClearTop(this);
            }).Run;

            View rootView = Window.DecorView.RootView;

            rootView.LayoutDirection = LayoutUtils.GetLayoutDirection();
        }
コード例 #8
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();
        }
コード例 #9
0
        private async void Init()
        {
            MessagesViewModel.SubscribeMessages(this, ClearAndAddNewMessages);

            _messagesList        = FindViewById <ListView>(Resource.Id.messages_list);
            _noItemsTextView     = FindViewById <TextView>(Resource.Id.no_items_description);
            _lastUpdatedTextView = FindViewById <TextView>(Resource.Id.last_updated);

            _messagesList.Divider       = null;
            _messagesList.DividerHeight = 0;


            TextView title = FindViewById <TextView>(Resource.Id.messages_page_title);

            title.Text = MessagesViewModel.MESSAGES_HEADER;
            title.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());

            string headerText     = MessagesViewModel.MESSAGES_NO_ITEMS_TITLE;
            int    unreadMessages = (await MessageUtils.GetAllUnreadMessages()).Count;
            int    messages       = (await MessageUtils.GetMessages()).Count;

            if (unreadMessages > 0)
            {
                headerText = MessagesViewModel.MESSAGES_NEW_MESSAGES_HEADER;
            }
            else if (messages > 0)
            {
                headerText = MessagesViewModel.MESSAGES_NO_NEW_MESSAGES_HEADER;
            }

            TextView subheader = FindViewById <TextView>(Resource.Id.messages_page_sub_header);

            subheader.Text = headerText;
            subheader.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());

            string lastUpdatedString = MessagesViewModel.LastUpdateString;

            if (lastUpdatedString == "")
            {
                _lastUpdatedTextView.Visibility = ViewStates.Gone;
            }
            else
            {
                _lastUpdatedTextView.Visibility = ViewStates.Visible;
                _lastUpdatedTextView.Text       = MessagesViewModel.LastUpdateString;
            }

            _noItemsTextView.Text = MessagesViewModel.MESSAGES_NO_ITEMS_DESCRIPTION;

            _closeButton        = FindViewById <ImageView>(Resource.Id.arrow_back);
            _closeButton.Click += new StressUtils.SingleClick(OnCloseBtnClicked).Run;
            _closeButton.ContentDescription = MessagesViewModel.MESSAGES_ACCESSIBILITY_CLOSE_BUTTON;

            _adapterMessages                  = new MessagesAdapter(this, new MessageItemViewModel[0]);
            _messagesList.Adapter             = _adapterMessages;
            _messagesList.OnItemClickListener = new ItemClickListener(_adapterMessages);
            ShowList(false);
        }
コード例 #10
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.consent_settings_page_body, container, false);

            RelativeLayout RelativeLayout4 = view.FindViewById <RelativeLayout>(Resource.Id.consent_paragraph_hvordan_accepterer);

            RelativeLayout4.FindViewById <TextView>(Resource.Id.consent_page_text).TextFormatted = HtmlCompat.FromHtml(ConsentViewModel.CONSENT_FOUR_PARAGRAPH, HtmlCompat.FromHtmlModeLegacy);

            //ABOUT
            _aboutHeader      = view.FindViewById <TextView>(Resource.Id.consent1_about_header);
            _aboutHeader.Text = ConsentViewModel.CONSENT_ONE_TITLE;
            _aboutText1       = view.FindViewById <TextView>(Resource.Id.consent1_about_text_section1);
            _aboutText1.Text  = ConsentViewModel.CONSENT_ONE_PARAGRAPH_SECTION_ONE;
            _aboutText2       = view.FindViewById <TextView>(Resource.Id.consent1_about_text_section2);
            _aboutText2.Text  = ConsentViewModel.CONSENT_ONE_PARAGRAPH_SECTION_TWO;

            //HOW IT WORKS
            _howitworksHeader      = view.FindViewById <TextView>(Resource.Id.consent1_howitworks_header);
            _howitworksHeader.Text = ConsentViewModel.CONSENT_TWO_TITLE;
            _howitworksText1       = view.FindViewById <TextView>(Resource.Id.consent1_howitworks_text_section1);
            _howitworksText1.Text  = ConsentViewModel.CONSENT_TWO_PARAGRAPH_SECTION_ONE;
            _howitworksText2       = view.FindViewById <TextView>(Resource.Id.consent1_howitworks_text_section2);
            _howitworksText2.Text  = ConsentViewModel.CONSENT_TWO_PARAGRAPH_SECTION_TWO;

            //SAMTYKKE
            _samtykkeText1      = view.FindViewById <TextView>(Resource.Id.consent1_samtykke_text_section1);
            _samtykkeText1.Text = ConsentViewModel.CONSENT_THREE_PARAGRAPH_SECTION_ONE;
            _samtykkeText2      = view.FindViewById <TextView>(Resource.Id.consent1_samtykke_text_section2);
            _samtykkeText2.Text = ConsentViewModel.CONSENT_THREE_PARAGRAPH_SECTION_TWO;

            //BEHANDLING AF PERSONOPLYSNINGWER
            _behandlingafpersonoplysningerText      = view.FindViewById <TextView>(Resource.Id.consent1_behandlingafpersonopl_text);
            _behandlingafpersonoplysningerText.Text = ConsentViewModel.CONSENT_FIVE_PARAGRAPH;

            //SAMTYKKE, BOTTOM
            _samtykkebottomHeader      = view.FindViewById <TextView>(Resource.Id.consent1_samtykkebottom_header);
            _samtykkebottomHeader.Text = ConsentViewModel.CONSENT_SIX_TITLE;
            _samtykkebottomText        = view.FindViewById <TextView>(Resource.Id.consent1_samtykkebottom_text);
            _samtykkebottomText.Text   = ConsentViewModel.CONSENT_SIX_PARAGRAPH;


            Button policyLinkBtn = view.FindViewById <Button>(Resource.Id.consent_paragraph_policy_btn);

            policyLinkBtn.Text   = ConsentViewModel.CONSENT_SEVEN_BUTTON_TEXT;
            policyLinkBtn.Click += PolicyLinkBtn_Click;

            // CONTENT DESCRIPTIONS OF HEADER
            _aboutHeader.ContentDescription          = ConsentViewModel.CONSENT_ONE_TITLE.ToLower();
            _howitworksHeader.ContentDescription     = ConsentViewModel.CONSENT_TWO_TITLE.ToLower();
            _samtykkebottomHeader.ContentDescription = ConsentViewModel.CONSENT_SIX_TITLE.ToLower();
            _aboutHeader.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());
            _howitworksHeader.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());
            _samtykkebottomHeader.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());


            return(view);
        }
コード例 #11
0
        public void OnActivityCreated(Activity activity, Bundle savedInstanceState)
        {
            AccessibilityUtils.AdjustFontScale(activity);

            MessagingCenter.Subscribe <object>(
                activity,
                MessagingCenterKeys.KEY_FORCE_UPDATE,
                o => OnForceUpdate(activity));
        }
コード例 #12
0
        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();
        }
コード例 #13
0
 void UpdateNewIndicatorView()
 {
     InvokeOnMainThread(() =>
     {
         NewIndicatorView.Hidden            = !_viewModel.ShowNewMessageIcon;
         MessageIcon.Image                  = _viewModel.ShowNewMessageIcon ? UIImage.FromBundle("notification_active") : UIImage.FromBundle("notification_inactive");
         NewRegistrationLbl.Text            = _viewModel.NewMessageSubheaderTxt;
         _messageViewBtn.AccessibilityLabel = AccessibilityUtils.RemovePoorlySpokenSymbolsString(_viewModel.NewMessageAccessibilityText);
     });
 }
コード例 #14
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);
        }
コード例 #15
0
        void Init()
        {
            ImageButton backButton = FindViewById <ImageButton>(Resource.Id.arrow_back);

            backButton.ContentDescription = SettingsViewModel.BACK_BUTTON_ACCESSIBILITY_TEXT;

            TextView titleField          = FindViewById <TextView>(Resource.Id.settings_how_it_works_title);
            TextView intro               = FindViewById <TextView>(Resource.Id.settings_how_it_works_intro);
            TextView heading1            = FindViewById <TextView>(Resource.Id.settings_how_it_works_heading1);
            TextView paragraph1textView1 = FindViewById <TextView>(Resource.Id.settings_how_it_works_paragraph1textView1);
            TextView paragraph1textView2 = FindViewById <TextView>(Resource.Id.settings_how_it_works_paragraph1textView2);
            TextView heading2            = FindViewById <TextView>(Resource.Id.settings_how_it_works_heading2);
            TextView paragraph2textView1 = FindViewById <TextView>(Resource.Id.settings_how_it_works_paragraph2textView1);
            TextView paragraph2textView2 = FindViewById <TextView>(Resource.Id.settings_how_it_works_paragraph2textView2);
            TextView paragraph2textView3 = FindViewById <TextView>(Resource.Id.settings_how_it_works_paragraph2textView3);
            TextView paragraph2textView4 = FindViewById <TextView>(Resource.Id.settings_how_it_works_paragraph2textView4);
            TextView heading3            = FindViewById <TextView>(Resource.Id.settings_how_it_works_heading3);
            TextView paragraph3textView1 = FindViewById <TextView>(Resource.Id.settings_how_it_works_paragraph3textView1);
            TextView heading4            = FindViewById <TextView>(Resource.Id.settings_how_it_works_heading4);
            TextView paragraph4textView1 = FindViewById <TextView>(Resource.Id.settings_how_it_works_paragraph4textView1);
            TextView paragraph4textView2 = FindViewById <TextView>(Resource.Id.settings_how_it_works_paragraph4textView2);
            TextView paragraph4textView3 = FindViewById <TextView>(Resource.Id.settings_how_it_works_paragraph4textView3);

            titleField.Text          = SettingsPage2ViewModel.SETTINGS_PAGE_2_HEADER;
            intro.Text               = SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_INTRO;
            heading1.Text            = SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_1_TITLE;
            paragraph1textView1.Text = SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_1_CONTENT;
            paragraph1textView2.Text = SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_1_CONTENT2;
            heading2.Text            = SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_2_TITLE;
            paragraph2textView1.Text = SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_2_CONTENT;
            paragraph2textView2.Text = SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_2_CONTENT2;
            paragraph2textView3.Text = SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_2_CONTENT3;
            paragraph2textView4.Text = SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_2_CONTENT4;
            heading3.Text            = SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_3_TITLE;
            paragraph3textView1.Text = SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_3_CONTENT;
            heading4.Text            = SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_4_TITLE;
            paragraph4textView1.Text = SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_4_CONTENT;
            paragraph4textView2.Text = SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_4_CONTENT2;

            paragraph4textView3.TextFormatted = HtmlCompat.FromHtml(SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT_TEXT_PARAGRAPH_4_CONTENT3,
                                                                    HtmlCompat.FromHtmlModeLegacy);

            titleField.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());

            LinkUtil.LinkifyTextView(paragraph4textView3);
            FormatLink(paragraph4textView3);

            backButton.Click += new SingleClick((sender, args) => Finish()).Run;

            View rootView = Window.DecorView.RootView;

            rootView.LayoutDirection = LayoutUtils.GetLayoutDirection();
            backButton.SetBackgroundResource(LayoutUtils.GetBackArrow());
        }
        void SetAccessibility()
        {
            TitleLbl.AccessibilityTraits      = UIAccessibilityTrait.Header;
            ListExplainLbl.AccessibilityLabel = AccessibilityUtils.RemovePoorlySpokenSymbolsString(QuestionnaireCountriesViewModel.COUNTRY_QUESTIONAIRE_FOOTER);
            CloseButton.AccessibilityLabel    = QuestionnaireViewModel.REGISTER_QUESTIONAIRE_ACCESSIBILITY_CLOSE_BUTTON_TEXT;

            if (UIAccessibility.IsVoiceOverRunning)
            {
                this.SetAccessibilityElements(NSArray.FromNSObjects(ScrollView, NextBtn, CloseButton));
                PostAccessibilityNotificationAndReenableElement(CloseButton, TitleLbl);
            }
        }
コード例 #17
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();
        }
コード例 #18
0
        void Init()
        {
            Bundle textFieldsBundle = Intent.Extras;
            string titleText        = textFieldsBundle.GetString("title");
            string descriptionText  = textFieldsBundle.GetString("description");
            string buttonText       = textFieldsBundle.GetString("button");

            TextView subtitleTextView = FindViewById <TextView>(Resource.Id.error_subtitle);

            if (textFieldsBundle.ContainsKey("subtitle"))
            {
                string subtitleText = textFieldsBundle.GetString("subtitle");
                subtitleTextView.Text = subtitleText;
                subtitleTextView.ContentDescription = subtitleText;
                subtitleTextView.Visibility         = ViewStates.Visible;
            }
            else
            {
                subtitleTextView.Visibility = ViewStates.Gone;
            }

            TextView errorTitle = FindViewById <TextView>(Resource.Id.error_title);

            errorTitle.Text = titleText;
            errorTitle.ContentDescription = titleText;
            errorTitle.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());

            TextView errorDescription     = FindViewById <TextView>(Resource.Id.error_description);
            ISpanned formattedDescription = HtmlCompat.FromHtml(descriptionText, HtmlCompat.FromHtmlModeLegacy);

            errorDescription.TextFormatted = formattedDescription;
            errorDescription.ContentDescriptionFormatted = formattedDescription;
            errorDescription.MovementMethod = Android.Text.Method.LinkMovementMethod.Instance;

            ViewGroup close = FindViewById <ViewGroup>(Resource.Id.close_cross_btn);

            close.Click += new SingleClick((o, ev) => {
                NavigationHelper.GoToResultPageAndClearTop(this);
            }).Run;
            close.ContentDescription = SettingsViewModel.SETTINGS_ITEM_ACCESSIBILITY_CLOSE_BUTTON;
            Button button = FindViewById <Button>(Resource.Id.error_button);

            button.Text = buttonText;
            button.ContentDescription = buttonText;
            button.Click += new SingleClick((o, ev) => {
                NavigationHelper.GoToResultPageAndClearTop(this);
            }).Run;

            this.Title = textFieldsBundle.GetString("title");
        }
コード例 #19
0
        private async void InitView()
        {
            SetContentView(Resource.Layout.questionnaire_countries);

            _title        = FindViewById <TextView>(Resource.Id.countries_title);
            _subtitle     = FindViewById <TextView>(Resource.Id.countries_subtitle);
            _footer       = FindViewById <TextView>(Resource.Id.questionnaire_countries_footer);
            _nextButton   = FindViewById <Button>(Resource.Id.countries_button);
            _recyclerView = FindViewById <RecyclerView>(Resource.Id.countries_list);
            _progressBar  = FindViewById <ProgressBar>(Resource.Id.progress_bar);
            _closeButton  = FindViewById <Button>(Resource.Id.close_cross_btn);

            //Accessibility
            _closeButton.ContentDescription = InformationAndConsentViewModel.CLOSE_BUTTON_ACCESSIBILITY_LABEL;
            _title.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());

            _closeButton.Click += new StressUtils.SingleClick(OnExitClick).Run;
            _nextButton.Click  += new StressUtils.SingleClick(OnNextButtonClick).Run;

            _title.Text      = QuestionnaireCountriesViewModel.COUNTRY_QUESTIONAIRE_HEADER_TEXT;
            _subtitle.Text   = QuestionnaireCountriesViewModel.COUNTRY_QUESTIONAIRE_INFORMATION_TEXT;
            _footer.Text     = QuestionnaireCountriesViewModel.COUNTRY_QUESTIONAIRE_FOOTER;
            _nextButton.Text = QuestionnaireCountriesViewModel.COUNTRY_QUESTIONAIRE_BUTTON_TEXT;

            RunOnUiThread(() => ShowSpinner(true));

            _countries.AddRange(
                await _viewModel.GetListOfCountriesAsync() ??
                new List <CountryDetailsViewModel>());

            if (!_countries.Any())
            {
                RunOnUiThread(() => ShowSpinner(false));
                OnServerError();
                return;
            }
            RunOnUiThread(() => ShowSpinner(false));

            QuestionnaireCountriesSelectionAdapter adapter = new QuestionnaireCountriesSelectionAdapter(_countries);

            LinearLayoutManager layoutManager = new LinearLayoutManager(this);

            _recyclerView.SetLayoutManager(layoutManager);

            _recyclerView.SetAdapter(adapter);

            View rootView = Window.DecorView.RootView;

            rootView.LayoutDirection = LayoutUtils.GetLayoutDirection();
        }
        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);
        }
        void InitLayout()
        {
            View rootView = Window.DecorView.RootView;

            rootView.LayoutDirection = LayoutUtils.GetLayoutDirection();

            //Buttons
            _closeButton    = FindViewById <ViewGroup>(Resource.Id.close_cross_btn);
            _idPortenButton = FindViewById <Button>(Resource.Id.information_consent_idporten_button);

            //TextViews
            _header = FindViewById <TextView>(Resource.Id.information_consent_header_textView);
            _consentDescriptionText = FindViewById <TextView>(Resource.Id.information_consent_contentDescription_textView);
            _lookupHeader           = FindViewById <TextView>(Resource.Id.information_consent_lookup_header_textview);
            _lookupText             = FindViewById <TextView>(Resource.Id.information_consent_lookup_text_textview);
            _notificationHeader     = FindViewById <TextView>(Resource.Id.information_consent_notification_header_textview);
            _notificationText       = FindViewById <TextView>(Resource.Id.information_consent_notification_text_textview);
            _beAwareText            = FindViewById <TextView>(Resource.Id.information_consent_beAware_text_textview);
            _consentExplanationText = FindViewById <TextView>(Resource.Id.information_consent_explanation_text_textview);

            //Text initialization
            _idPortenButton.Text = InformationAndConsentViewModel.INFORMATION_CONSENT_ID_PORTEN_BUTTON_TEXT;
            _header.Text         = InformationAndConsentViewModel.INFORMATION_CONSENT_HEADER_TEXT;
            _consentDescriptionText.TextFormatted = HtmlCompat.FromHtml($"{InformationAndConsentViewModel.INFOCONSENT_DESCRIPTION}", HtmlCompat.FromHtmlModeLegacy);
            _lookupHeader.Text           = InformationAndConsentViewModel.INFOCONSENT_LOOKUP_HEADER;
            _lookupText.Text             = InformationAndConsentViewModel.INFOCONSENT_LOOKUP_TEXT;
            _notificationHeader.Text     = InformationAndConsentViewModel.INFOCONSENT_NOTIFICATION_HEADER;
            _notificationText.Text       = InformationAndConsentViewModel.INFOCONSENT_NOTIFICATION_TEXT;
            _beAwareText.Text            = InformationAndConsentViewModel.INFOCONSENT_CONSENT_BEAWARE_TEXT;
            _consentExplanationText.Text = InformationAndConsentViewModel.INFOCONSENT_CONSENT_EXPLANATION_TEXT;

            _lookupHeader.TextAlignment       = TextAlignment.ViewStart;
            _notificationHeader.TextAlignment = TextAlignment.ViewStart;

            ////Accessibility
            _closeButton.ContentDescription = InformationAndConsentViewModel.CLOSE_BUTTON_ACCESSIBILITY_LABEL;
            _header.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());
            _lookupHeader.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());
            _notificationHeader.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());

            //Button click events
            _closeButton.Click    += new SingleClick((sender, e) => Finish(), 500).Run;
            _idPortenButton.Click += new SingleClick(LogInWithIDPortenButton_Click, 500).Run;

            //Progress bar
            _progressBar = FindViewById <ProgressBar>(Resource.Id.information_consent_progress_bar);
        }
コード例 #22
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;
        }
コード例 #23
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;
        }
コード例 #24
0
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            View     view  = convertView ?? _context.LayoutInflater.Inflate(Resource.Layout.messages_list_element, null);
            TextView title = view.FindViewById <TextView>(Resource.Id.messages_item_title);

            title.Text = _items[position].Title.Translate();
            title.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());
            view.FindViewById <TextView>(Resource.Id.new_item).Text                  = MessagesViewModel.MESSAGES_NEW_ITEM;
            view.FindViewById <TextView>(Resource.Id.messages_item_date).Text        = _items[position].DayAndMonthString;
            view.FindViewById <TextView>(Resource.Id.messages_item_description).Text = MessageItemViewModel.MESSAGES_RECOMMENDATIONS;
            view.FindViewById <LinearLayout>(Resource.Id.dot_layout).Visibility      =
                _items[position].IsRead
                    ? ViewStates.Gone
                    : ViewStates.Visible;

            return(view);
        }
コード例 #25
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View     view    = inflater.Inflate(Resource.Layout.welcome_page_one, container, false);
            TextView bodyOne = view.FindViewById <TextView>(Resource.Id.welcome_page_one_body_one);
            TextView bodyTwo = view.FindViewById <TextView>(Resource.Id.welcome_page_one_body_two);
            TextView header  = view.FindViewById <TextView>(Resource.Id.welcome_page_one_title);

            bodyOne.Text = WelcomeViewModel.WELCOME_PAGE_ONE_BODY_ONE;
            bodyTwo.Text = WelcomeViewModel.WELCOME_PAGE_ONE_BODY_TWO;
            header.Text  = WelcomeViewModel.WELCOME_PAGE_ONE_TITLE;

            header.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());

            WelcomePageTools.SetArrowVisibility(view);

            return(view);
        }
コード例 #26
0
        void Init()
        {
            View rootView = Window.DecorView.RootView;

            rootView.LayoutDirection = LayoutUtils.GetLayoutDirection();

            ImageButton backButton = FindViewById <ImageButton>(Resource.Id.arrow_back_help);

            backButton.ContentDescription = ViewModels.SettingsViewModel.BACK_BUTTON_ACCESSIBILITY_TEXT;

            TextView textField  = FindViewById <TextView>(Resource.Id.settings_help_text);
            TextView titleField = FindViewById <TextView>(Resource.Id.settings_help_title);

            titleField.Text = HEADER;
            titleField.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());
            textField.TextAlignment = TextAlignment.ViewStart;
            textField.TextFormatted =
                HtmlCompat.FromHtml($"{CONTENT_TEXT_BEFORE_SUPPORT_LINK} <a href=\"{SUPPORT_LINK}\">{SUPPORT_LINK_SHOWN_TEXT}</a><br><br>"

                                    /* Note:
                                     * This functionality is not planned for release 1.0. Kept for future use.
                                     *                      //$"{EMAIL_TEXT} <a href=\"mailto:{EMAIL}\">{EMAIL}</a> {PHONE_NUM_Text} <a href=\"tel:{PHONE_NUM}\">{PHONE_NUM}</a>.<br><br>" +
                                     *                      //$"{PHONE_OPEN_TEXT}<br><br>" +
                                     *                      //$"{PHONE_OPEN_MON_THU}<br>" +
                                     *                      //$"{PHONE_OPEN_FRE}<br><br>" +
                                     *                      //$"{PHONE_OPEN_SAT_SUN_HOLY}"
                                     */
                                    , HtmlCompat.FromHtmlModeLegacy);
            textField.ContentDescriptionFormatted =
                HtmlCompat.FromHtml($"{CONTENT_TEXT_BEFORE_SUPPORT_LINK} <a href=\"https://{SUPPORT_LINK}\">{SUPPORT_LINK_SHOWN_TEXT}</a><br><br>"

                                    /* Note:
                                     * This functionality is not planned for release 1.0. Kept for future use.
                                     *                      //$"{EMAIL_TEXT} <a href=\"mailto:{EMAIL}\">{EMAIL}</a> {PHONE_NUM_Text} <a href=\"tel:{PHONE_NUM}\">{PHONE_NUM_ACCESSIBILITY}</a>.<br><br>" +
                                     *                      //$"{PHONE_OPEN_TEXT}<br><br>" +
                                     *                      //$"{PHONE_OPEN_MON_THU_ACCESSIBILITY}<br>" +
                                     *                      //$"{PHONE_OPEN_FRE_ACCESSIBILITY}<br><br>" +
                                     *                      //$"{PHONE_OPEN_SAT_SUN_HOLY}"
                                     */
                                    , HtmlCompat.FromHtmlModeLegacy);
            textField.MovementMethod = LinkMovementMethod.Instance;
            backButton.Click        += new SingleClick((sender, args) => Finish()).Run;

            backButton.SetBackgroundResource(LayoutUtils.GetBackArrow());
        }
コード例 #27
0
        void Init()
        {
            ImageButton backButton = FindViewById <ImageButton>(Resource.Id.arrow_back);

            backButton.ContentDescription = SettingsViewModel.SETTINGS_CHILD_PAGE_ACCESSIBILITY_BACK_BUTTON;

            TextView textField  = FindViewById <TextView>(Resource.Id.settings_how_it_works_text);
            TextView titleField = FindViewById <TextView>(Resource.Id.settings_how_it_works_title);

            titleField.Text = SettingsPage2ViewModel.SETTINGS_PAGE_2_HEADER;
            titleField.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());
            textField.TextFormatted = HtmlCompat.FromHtml(SettingsPage2ViewModel.SETTINGS_PAGE_2_CONTENT,
                                                          HtmlCompat.FromHtmlModeLegacy);
            LinkUtil.LinkifyTextView(textField);
            FormatLink(textField);

            backButton.Click += new SingleClick((sender, args) => Finish()).Run;
        }
コード例 #28
0
        void Init()
        {
            ImageButton backButton = FindViewById <ImageButton>(Resource.Id.arrow_back);

            backButton.ContentDescription = ViewModels.SettingsViewModel.SETTINGS_CHILD_PAGE_ACCESSIBILITY_BACK_BUTTON;

            _resetConsentsButton = FindViewById <Button>(Resource.Id.buttonResetConsents);
            _progressBar         = FindViewById <ProgressBar>(Resource.Id.consentActivityIndicator);

            TextView header = FindViewById <TextView>(Resource.Id.welcome_page_five_title);

            header.Text = ConsentViewModel.WELCOME_PAGE_CONSENT_TITLE;
            header.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());

            _resetConsentsButton.Text   = ConsentViewModel.WITHDRAW_CONSENT_BUTTON_TEXT;
            backButton.Click           += new SingleClick((sender, args) => Finish()).Run;
            _resetConsentsButton.Click += new SingleClick(ResetButtonToggled).Run;
        }
コード例 #29
0
        private void Init()
        {
            _closeButton = FindViewById <Button>(Resource.Id.close_cross_btn);
            _closeButton.ContentDescription = REGISTER_QUESTIONAIRE_ACCESSIBILITY_CLOSE_BUTTON_TEXT;
            _closeButton.Click +=
                new SingleClick((o, ev) => GoToInfectionStatusActivity()).Run;

            TextView registeredTitle       = FindViewById <TextView>(Resource.Id.registered_title);
            TextView registeredTickText    = FindViewById <TextView>(Resource.Id.registered_tick_text);
            TextView registeredDescription = FindViewById <TextView>(Resource.Id.registered_description);
            TextView recipeHeader          = FindViewById <TextView>(Resource.Id.recipe_header);
            TextView recipeSmallText       = FindViewById <TextView>(Resource.Id.recipe_small_text);

            registeredTitle.Text       = REGISTER_QUESTIONAIRE_RECEIPT_HEADER;
            registeredTickText.Text    = REGISTER_QUESTIONAIRE_RECEIPT_TEXT;
            registeredDescription.Text = REGISTER_QUESTIONAIRE_RECEIPT_DESCRIPTION;
            recipeHeader.Text          = REGISTER_QUESTIONAIRE_RECEIPT_INNER_HEADER;
            recipeSmallText.Text       = REGISTER_QUESTIONAIRE_RECEIPT_INNER_READ_MORE;

            registeredTitle.ContentDescription = REGISTER_QUESTIONAIRE_RECEIPT_HEADER;
            registeredTitle.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());
            registeredTickText.ContentDescription    = REGISTER_QUESTIONAIRE_RECEIPT_TEXT;
            registeredDescription.ContentDescription = REGISTER_QUESTIONAIRE_RECEIPT_DESCRIPTION;
            recipeHeader.ContentDescription          = REGISTER_QUESTIONAIRE_RECEIPT_INNER_HEADER;
            recipeHeader.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());
            recipeSmallText.ContentDescription = REGISTER_QUESTIONAIRE_RECEIPT_INNER_READ_MORE;

            Button button = FindViewById <Button>(Resource.Id.registered_button);

            button.Text = REGISTER_QUESTIONAIRE_RECEIPT_DISMISS;
            button.ContentDescription = REGISTER_QUESTIONAIRE_RECEIPT_DISMISS;
            button.Click += new SingleClick((o, ev) => GoToInfectionStatusActivity()).Run;

            FindViewById <ConstraintLayout>(Resource.Id.explanation_link).Click +=
                async(sender, args) =>
                await CommonServiceLocator.ServiceLocator.Current.GetInstance <IBrowser>()
                .OpenAsync(
                    REGISTER_QUESTIONAIRE_RECEIPT_LINK,
                    BrowserLaunchMode.SystemPreferred);

            LogUtils.LogMessage(LogSeverity.INFO, "The user has successfully shared their keys", null, GetCorrelationId());
            UpdateCorrelationId(null);
        }
コード例 #30
0
        private void Init()
        {
            // Generate and set correlation id for current authentication flow
            UpdateCorrelationId(LogUtils.GenerateCorrelationId());

            _questionnaireViewModel = new QuestionnaireViewModel();

            TextView questionnaireTitle = FindViewById <TextView>(Resource.Id.questionnaire_title);

            questionnaireTitle.Text = REGISTER_QUESTIONAIRE_HEADER;
            questionnaireTitle.ContentDescription = REGISTER_QUESTIONAIRE_HEADER;
            questionnaireTitle.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());

            TextView questionnaireSubtitle = FindViewById <TextView>(Resource.Id.questionnaire_subtitle);
            ISpanned questionnaireSubtitleTextFormatted =
                HtmlCompat.FromHtml(REGISTER_QUESTIONAIRE_SYMPTOMONSET_TEXT, HtmlCompat.FromHtmlModeLegacy);

            questionnaireSubtitle.TextFormatted = questionnaireSubtitleTextFormatted;
            questionnaireSubtitle.ContentDescriptionFormatted = questionnaireSubtitleTextFormatted;

            _questionnaireButton      = FindViewById <Button>(Resource.Id.questionnaire_button);
            _questionnaireButton.Text = REGISTER_QUESTIONAIRE_NEXT;
            _questionnaireButton.ContentDescription = REGISTER_QUESTIONAIRE_NEXT;
            _questionnaireButton.Click += OnNextButtonClick;

            _infoButton = FindViewById <ImageButton>(Resource.Id.questionnaire_info_button);
            _infoButton.ContentDescription = REGISTER_QUESTIONAIRE_ACCESSIBILITY_DATE_INFO_BUTTON;
            _infoButton.Click += OnInfoButtonPressed;

            _closeButton = FindViewById <Button>(Resource.Id.close_cross_btn);
            _closeButton.ContentDescription = SettingsViewModel.SETTINGS_ITEM_ACCESSIBILITY_CLOSE_BUTTON;
            _closeButton.Click +=
                new SingleClick((o, ev) => ShowAreYouSureToExitDialog()).Run;

            PrepareRadioButtons();

            View rootView = Window.DecorView.RootView;

            rootView.LayoutDirection = LayoutUtils.GetLayoutDirection();
        }