예제 #1
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);
        }
        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();
        }
        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());
        }
        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
        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);
        }
        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);
        }
예제 #7
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());
        }
예제 #8
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();
        }
예제 #9
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");
        }
        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);
        }
        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);
        }
예제 #12
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);
        }
        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());
        }
        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;
        }
예제 #15
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;
        }
        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);
        }
예제 #17
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();
        }
예제 #18
0
        void Init()
        {
            ImageButton backButton = FindViewById <ImageButton>(Resource.Id.arrow_back_about);

            backButton.ContentDescription = ViewModels.SettingsViewModel.SETTINGS_CHILD_PAGE_ACCESSIBILITY_BACK_BUTTON;

            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 +
                             $" {SettingsPage5ViewModel.SETTINGS_PAGE_5_LINK}";

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

            hiddenLink.Text = SettingsPage5ViewModel.SETTINGS_PAGE_5_LINK;

            LinkUtil.LinkifyTextView(hiddenLink);
        }
        void Init()
        {
            ImageButton backButton = FindViewById <ImageButton>(Resource.Id.arrow_back);

            backButton.ContentDescription = ViewModels.SettingsViewModel.BACK_BUTTON_ACCESSIBILITY_TEXT;

            _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;

            View rootView = Window.DecorView.RootView;

            rootView.LayoutDirection = LayoutUtils.GetLayoutDirection();
            backButton.SetBackgroundResource(LayoutUtils.GetBackArrow());
        }
        private void Init()
        {
            ImageButton backButton = FindViewById <ImageButton>(Resource.Id.arrow_back_general);

            backButton.ContentDescription = SETTINGS_CHILD_PAGE_ACCESSIBILITY_BACK_BUTTON;

            TextView titleField       = FindViewById <TextView>(Resource.Id.settings_general_title);
            TextView explanationOne   = FindViewById <TextView>(Resource.Id.settings_general_explanation);
            TextView explanationTwo   = FindViewById <TextView>(Resource.Id.settings_general_explanation_two);
            TextView mobileDataHeader = FindViewById <TextView>(Resource.Id.settings_general_mobile_data_header);
            TextView mobileDataDesc   = FindViewById <TextView>(Resource.Id.settings_general_mobile_data_desc);
            TextView languageHeader   = FindViewById <TextView>(Resource.Id.settings_general_select_lang_header);
            TextView languageDesc     = FindViewById <TextView>(Resource.Id.settings_general_select_lang_desc_one);
            TextView languageLink     = FindViewById <TextView>(Resource.Id.settings_general_link);
            TextView linkLayout       = FindViewById <TextView>(Resource.Id.settings_general_link);

            titleField.Text                 = SETTINGS_GENERAL_TITLE;
            explanationOne.Text             = SETTINGS_GENERAL_EXPLANATION_ONE;
            explanationTwo.Text             = SETTINGS_GENERAL_EXPLANATION_TWO;
            mobileDataHeader.Text           = SETTINGS_GENERAL_MOBILE_DATA_HEADER;
            mobileDataDesc.Text             = SETTINGS_GENERAL_MOBILE_DATA_DESC;
            languageHeader.Text             = SETTINGS_GENERAL_CHOOSE_LANGUAGE_HEADER;
            languageDesc.Text               = SETTINGS_GENERAL_RESTART_REQUIRED_TEXT;
            languageLink.Text               = SETTINGS_GENERAL_MORE_INFO_BUTTON_TEXT;
            languageLink.ContentDescription = SETTINGS_GENERAL_ACCESSIBILITY_MORE_INFO_BUTTON_TEXT;

            titleField.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());
            mobileDataHeader.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());
            languageHeader.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());

            linkLayout.Click +=
                new StressUtils.SingleClick(
                    (o, args) => OpenSmitteStopLink()).Run;

            RadioGroup  radioGroup         = FindViewById <RadioGroup>(Resource.Id.settings_general_select_lang_radio_group);
            RadioButton englishRadioButton = FindViewById <RadioButton>(Resource.Id.settings_general_english);
            RadioButton bokmalRadioButton  = FindViewById <RadioButton>(Resource.Id.settings_general_bokmal);
            RadioButton nynorskRadioButton = FindViewById <RadioButton>(Resource.Id.settings_general_nynorsk);


            englishRadioButton.Text = SETTINGS_GENERAL_EN;
            bokmalRadioButton.Text  = SETTINGS_GENERAL_NB;
            nynorskRadioButton.Text = SETTINGS_GENERAL_NN;

            string appLanguage = LocalesService.GetLanguage();

            if (appLanguage == "en")
            {
                englishRadioButton.Checked = true;
            }
            else if (appLanguage == "nn")
            {
                nynorskRadioButton.Checked = true;
            }
            else
            {
                bokmalRadioButton.Checked = true;
            }

            radioGroup.SetOnCheckedChangeListener(new OnCheckedChangeListener(this));

            SwitchCompat switchButton = FindViewById <SwitchCompat>(Resource.Id.settings_general_switch);

            switchButton.Checked        = _viewModel.GetStoredCheckedState();
            switchButton.CheckedChange += OnCheckedChange;

            backButton.Click += new StressUtils.SingleClick((sender, args) => Finish()).Run;
        }
예제 #21
0
        private async void InitLayout()
        {
            View rootView = Window.DecorView.RootView;

            rootView.LayoutDirection = LayoutUtils.GetLayoutDirection();

            // Header
            _toolbarLinearLayout = FindViewById <LinearLayout>(Resource.Id.infection_status_activity_toolbar_layout);
            _statusLinearLayout  = FindViewById <LinearLayout>(Resource.Id.infection_status_activity_status_layout);

            //TextViews
            _activityStatusText        = FindViewById <TextView>(Resource.Id.infection_status_activity_status_textView);
            _activityStatusDescription =
                FindViewById <TextView>(Resource.Id.infection_status_activivity_status_description_textView);
            _dailyNumbersHeader    = FindViewById <TextView>(Resource.Id.infection_status_daily_numbers_text_textView);
            _dailyNumbersSubHeader = FindViewById <TextView>(Resource.Id.infection_status_daily_numbers_updated_textView);
            _messeageHeader        = FindViewById <TextView>(Resource.Id.infection_status_message_text_textView);
            _messageSubHeader      = FindViewById <TextView>(Resource.Id.infection_status_new_message_text_textView);
            _registrationHeader    = FindViewById <TextView>(Resource.Id.infection_status_registration_text_textView);
            _registrationSubheader =
                FindViewById <TextView>(Resource.Id.infection_status_registration_login_text_textView);
            _menuText = FindViewById <TextView>(Resource.Id.infection_status_menu_text_view);
            _menuText.TextAlignment = Android.Views.TextAlignment.ViewEnd;

            //Buttons
            _onOffButton = FindViewById <Button>(Resource.Id.infection_status_on_off_button);
            _dailyNumbersRelativeLayout = FindViewById <RelativeLayout>(Resource.Id.infection_status_daily_numbers_button_relativeLayout);
            _messageRelativeLayout      =
                FindViewById <RelativeLayout>(Resource.Id.infection_status_messages_button_relativeLayout);
            _registrationRelativeLayout =
                FindViewById <RelativeLayout>(Resource.Id.infection_status_registration_button_relativeLayout);
            _menuIcon = FindViewById <ImageButton>(Resource.Id.infection_status_menu_icon_relativeLayout);
            _dailyNumbersCoverButton = FindViewById <Button>(Resource.Id.infection_status_daily_numbers_button_relativeLayout_button);
            _messageCoverButton      =
                FindViewById <Button>(Resource.Id.infection_status_messages_button_relativeLayout_button);
            _registrationCoverButton =
                FindViewById <Button>(Resource.Id.infection_status_registration_button_relativeLayout_button);

            //ImageViews
            _notificationDot = FindViewById <ImageView>(Resource.Id.infection_status_message_bell_imageView);
            _fhiLogo         = FindViewById <ImageView>(Resource.Id.infection_status_app_icon_imageView);
            _appLogo         = FindViewById <ImageView>(Resource.Id.infection_status_app_logo);
            ImageView arrowImageView1 = FindViewById <ImageView>(Resource.Id.infection_status_registration_arrow_imageView);
            ImageView arrowImageView2 = FindViewById <ImageView>(Resource.Id.infection_status_message_arrow_imageView);
            Drawable  arrowImage      = ContextCompat.GetDrawable(this, Resource.Drawable.ic_arrow_right);

            arrowImage.AutoMirrored = true;
            arrowImageView1.SetImageDrawable(arrowImage);
            arrowImageView2.SetImageDrawable(arrowImage);

            //Text initialization
            _activityStatusText.Text        = INFECTION_STATUS_ACTIVE_TEXT;
            _activityStatusDescription.Text = INFECTION_STATUS_ACTIVITY_STATUS_DESCRIPTION_TEXT;
            _dailyNumbersHeader.Text        = INFECTION_STATUS_DAILY_NUMBERS_HEADER_TEXT;
            _dailyNumbersSubHeader.Text     = INFECTION_STATUS_DAILY_NUMBERS_LAST_UPDATED_TEXT;
            _messeageHeader.Text            = INFECTION_STATUS_MESSAGE_HEADER_TEXT;
            _messageSubHeader.Text          = INFECTION_STATUS_MESSAGE_SUBHEADER_TEXT;
            _registrationHeader.Text        = INFECTION_STATUS_REGISTRATION_HEADER_TEXT;
            _registrationSubheader.Text     = INFECTION_STATUS_REGISTRATION_SUBHEADER_TEXT;
            _menuText.Text = INFECTION_STATUS_MENU_TEXT;

            _messeageHeader.TextAlignment        = TextAlignment.ViewStart;
            _messageSubHeader.TextAlignment      = TextAlignment.ViewStart;
            _registrationHeader.TextAlignment    = TextAlignment.ViewStart;
            _registrationSubheader.TextAlignment = TextAlignment.ViewStart;

            //Accessibility
            _messageSubHeader.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());
            _messeageHeader.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());
            _registrationHeader.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());
            _dailyNumbersHeader.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());
            _dailyNumbersSubHeader.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());
            _menuIcon.ContentDescription = INFECTION_STATUS_MENU_ACCESSIBILITY_TEXT;
            _dailyNumbersCoverButton.ContentDescription = $"{INFECTION_STATUS_DAILY_NUMBERS_HEADER_TEXT} {INFECTION_STATUS_DAILY_NUMBERS_LAST_UPDATED_ACCESSIBILITY_TEXT}";
            _messageCoverButton.ContentDescription      =
                $"{INFECTION_STATUS_MESSAGE_HEADER_TEXT} {INFECTION_STATUS_MESSAGE_SUBHEADER_TEXT}";
            _registrationCoverButton.ContentDescription =
                $"{INFECTION_STATUS_REGISTRATION_HEADER_TEXT} {INFECTION_STATUS_REGISTRATION_SUBHEADER_TEXT}";
            _fhiLogo.ContentDescription = SMITTESPORING_FHI_LOGO_ACCESSIBILITY;
            _appLogo.ContentDescription = SMITTESPORING_APP_LOGO_ACCESSIBILITY;

            //Button click events
            _onOffButton.Click += new SingleClick(StartStopButton_Click, 500).Run;
            _dailyNumbersRelativeLayout.Click += new SingleClick(DailyNumbersLayoutButton_Click, 500).Run;
            _dailyNumbersCoverButton.Click    += new SingleClick(DailyNumbersLayoutButton_Click, 500).Run;
            _messageRelativeLayout.Click      += new SingleClick(MessageLayoutButton_Click, 500).Run;
            _messageCoverButton.Click         += new SingleClick(MessageLayoutButton_Click, 500).Run;
            _registrationRelativeLayout.Click += new SingleClick(RegistrationLayoutButton_Click, 500).Run;
            _registrationCoverButton.Click    += new SingleClick(RegistrationLayoutButton_Click, 500).Run;
            _menuIcon.Click += new SingleClick((sender, e) => NavigationHelper.GoToSettingsPage(this), 500).Run;
            _menuText.Click += new SingleClick((sender, e) => NavigationHelper.GoToSettingsPage(this), 500).Run;
            if (!await IsRunning())
            {
                _onOffButton.PerformClick();
            }

            UpdateUI();
            FlightModeHandlerBroadcastReceiver.OnFlightModeChange += UpdateUI;
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.welcome_page_five);

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

            header.Text = ConsentViewModel.WELCOME_PAGE_CONSENT_TITLE;

            Button previousButton = FindViewById <Button>(Resource.Id.welcome_page_five_prev_button);

            previousButton.Click += new SingleClick(PreviousButtonPressed, 500).Run;
            previousButton.Text   = WelcomeViewModel.PREVIOUS_PAGE_BUTTON_TEXT;

            Button nextButton = FindViewById <Button>(Resource.Id.welcome_page_five_button_next);

            nextButton.Click += new SingleClick(NextButtonPressed, 500).Run;
            nextButton.Text   = WelcomeViewModel.NEXT_PAGE_BUTTON_TEXT;

            _switchCustom = FindViewById <SwitchCompat>(Resource.Id.welcome_page_five_switch);
            _switchCustom.CheckedChange     += OnCheckedChange;
            _switchCustom.ContentDescription = ConsentViewModel.SWITCH_ACCESSIBILITY_CONSENT_SWITCH_DESCRIPTOR;

            _consentWarning = FindViewById <LinearLayout>(Resource.Id.welcome_page_five_consent_warning);
            SetConsentWarningShown(false);
            _consentWarningTextView      = FindViewById <TextView>(Resource.Id.welcome_page_five_consent_warning_text);
            _consentWarningTextView.Text = ConsentViewModel.CONSENT_REQUIRED;

            TextView consentTextView = FindViewById <TextView>(Resource.Id.welcome_page_five_switch_text);

            consentTextView.Text     = ConsentViewModel.GIVE_CONSENT_TEXT;
            consentTextView.LabelFor = _switchCustom.Id;

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

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

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

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

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


            RelativeLayout RelativeLayout4 = 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);

            Button policyLinkBtn = 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();

            HeadingAccessibilityDelegate headingAccessibilityDelegate = AccessibilityUtils.GetHeadingAccessibilityDelegate();

            header.SetAccessibilityDelegate(headingAccessibilityDelegate);
            _aboutHeader.SetAccessibilityDelegate(headingAccessibilityDelegate);
            _howitworksHeader.SetAccessibilityDelegate(headingAccessibilityDelegate);
            _samtykkebottomHeader.SetAccessibilityDelegate(headingAccessibilityDelegate);
        }
        private void Init()
        {
            ImageButton backButton = FindViewById <ImageButton>(Resource.Id.arrow_back_general);

            backButton.ContentDescription = BACK_BUTTON_ACCESSIBILITY_TEXT;

            TextView titleField       = FindViewById <TextView>(Resource.Id.settings_general_title);
            TextView explanationOne   = FindViewById <TextView>(Resource.Id.settings_general_explanation);
            TextView explanationTwo   = FindViewById <TextView>(Resource.Id.settings_general_explanation_two);
            TextView mobileDataHeader = FindViewById <TextView>(Resource.Id.settings_general_mobile_data_header);
            TextView mobileDataDesc   = FindViewById <TextView>(Resource.Id.settings_general_mobile_data_desc);
            TextView languageHeader   = FindViewById <TextView>(Resource.Id.settings_general_select_lang_header);
            TextView languageDesc     = FindViewById <TextView>(Resource.Id.settings_general_select_lang_desc_one);
            TextView languageLink     = FindViewById <TextView>(Resource.Id.settings_general_link);
            TextView linkLayout       = FindViewById <TextView>(Resource.Id.settings_general_link);

            titleField.Text                 = SETTINGS_GENERAL_TITLE;
            explanationOne.Text             = SETTINGS_GENERAL_EXPLANATION_ONE;
            explanationTwo.Text             = SETTINGS_GENERAL_EXPLANATION_TWO;
            mobileDataHeader.Text           = SETTINGS_GENERAL_MOBILE_DATA_HEADER;
            mobileDataDesc.Text             = SETTINGS_GENERAL_MOBILE_DATA_DESC;
            languageHeader.Text             = SETTINGS_GENERAL_CHOOSE_LANGUAGE_HEADER;
            languageDesc.Text               = SETTINGS_GENERAL_RESTART_REQUIRED_TEXT;
            languageLink.TextAlignment      = TextAlignment.ViewStart;
            languageLink.ContentDescription = SETTINGS_GENERAL_ACCESSIBILITY_MORE_INFO_BUTTON_TEXT;

            titleField.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());
            mobileDataHeader.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());
            languageHeader.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());

            languageLink.TextFormatted  = HtmlCompat.FromHtml($"<a href=\"{SETTINGS_GENERAL_MORE_INFO_LINK}\">{SETTINGS_GENERAL_MORE_INFO_BUTTON_TEXT}</a>", HtmlCompat.FromHtmlModeLegacy);
            languageLink.MovementMethod = new Android.Text.Method.LinkMovementMethod();

            RadioGroup  radioGroup            = FindViewById <RadioGroup>(Resource.Id.settings_general_select_lang_radio_group);
            RadioButton englishRadioButton    = FindViewById <RadioButton>(Resource.Id.settings_general_english);
            RadioButton bokmalRadioButton     = FindViewById <RadioButton>(Resource.Id.settings_general_bokmal);
            RadioButton nynorskRadioButton    = FindViewById <RadioButton>(Resource.Id.settings_general_nynorsk);
            RadioButton polishRadioButton     = FindViewById <RadioButton>(Resource.Id.settings_general_polish);
            RadioButton somaliRadioButton     = FindViewById <RadioButton>(Resource.Id.settings_general_somali);
            RadioButton tigrinyaRadioButton   = FindViewById <RadioButton>(Resource.Id.settings_general_tigrinya);
            RadioButton arabicRadioButton     = FindViewById <RadioButton>(Resource.Id.settings_general_arabic);
            RadioButton urduRadioButton       = FindViewById <RadioButton>(Resource.Id.settings_general_urdu);
            RadioButton lithuanianRadioButton = FindViewById <RadioButton>(Resource.Id.settings_general_lithuanian);



            englishRadioButton.Text    = SETTINGS_GENERAL_EN;
            bokmalRadioButton.Text     = SETTINGS_GENERAL_NB;
            nynorskRadioButton.Text    = SETTINGS_GENERAL_NN;
            polishRadioButton.Text     = SETTINGS_GENERAL_PL;
            somaliRadioButton.Text     = SETTINGS_GENERAL_SO;
            tigrinyaRadioButton.Text   = SETTINGS_GENERAL_TI;
            arabicRadioButton.Text     = SETTINGS_GENERAL_AR;
            urduRadioButton.Text       = SETTINGS_GENERAL_UR;
            lithuanianRadioButton.Text = SETTINGS_GENERAL_LT;

            string appLanguage = LocalesService.GetLanguage();

            switch (appLanguage)
            {
            case "en":
                englishRadioButton.Checked = true;
                break;

            case "nn":
                nynorskRadioButton.Checked = true;
                break;

            case "pl":
                polishRadioButton.Checked = true;
                break;

            case "so":
                somaliRadioButton.Checked = true;
                break;

            case "ti":
                tigrinyaRadioButton.Checked = true;
                break;

            case "ar":
                arabicRadioButton.Checked = true;
                break;

            case "ur":
                urduRadioButton.Checked = true;
                break;

            case "lt":
                lithuanianRadioButton.Checked = true;
                break;

            default:
                bokmalRadioButton.Checked = true;
                break;
            }

            radioGroup.SetOnCheckedChangeListener(new OnCheckedChangeListener(this));

            SwitchCompat switchButton = FindViewById <SwitchCompat>(Resource.Id.settings_general_switch);

            switchButton.Checked        = _viewModel.GetStoredCheckedState();
            switchButton.CheckedChange += OnCheckedChange;

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

            // Layout direction logic
            View rootView = Window.DecorView.RootView;

            rootView.LayoutDirection = LayoutUtils.GetLayoutDirection();
            backButton.SetBackgroundResource(LayoutUtils.GetBackArrow());
            languageLink.SetCompoundDrawablesRelativeWithIntrinsicBounds(null, null, ContextCompat.GetDrawable(this, LayoutUtils.GetForwardArrow()), null);
        }
예제 #24
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.welcome_page_five);
            View rootView = Window.DecorView.RootView;

            rootView.LayoutDirection = LayoutUtils.GetLayoutDirection();

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

            header.Text = ConsentViewModel.WELCOME_PAGE_CONSENT_TITLE;

            Button previousButton = FindViewById <Button>(Resource.Id.welcome_page_five_prev_button);

            previousButton.Click += new SingleClick(PreviousButtonPressed, 500).Run;
            previousButton.Text   = WelcomeViewModel.PREVIOUS_PAGE_BUTTON_TEXT;

            Button nextButton = FindViewById <Button>(Resource.Id.welcome_page_five_button_next);

            nextButton.Click += new SingleClick(NextButtonPressed, 500).Run;
            nextButton.Text   = WelcomeViewModel.NEXT_PAGE_BUTTON_TEXT;

            _switchCustom = FindViewById <SwitchCompat>(Resource.Id.welcome_page_five_switch);
            _switchCustom.CheckedChange     += OnCheckedChange;
            _switchCustom.ContentDescription = ConsentViewModel.SWITCH_ACCESSIBILITY_CONSENT_SWITCH_DESCRIPTOR;

            _consentWarning = FindViewById <LinearLayout>(Resource.Id.welcome_page_five_consent_warning);
            SetConsentWarningShown(false);
            _consentWarningTextView      = FindViewById <TextView>(Resource.Id.welcome_page_five_consent_warning_text);
            _consentWarningTextView.Text = ConsentViewModel.CONSENT_REQUIRED;

            TextView consentTextView = FindViewById <TextView>(Resource.Id.welcome_page_five_switch_text);

            consentTextView.Text     = ConsentViewModel.GIVE_CONSENT_TEXT;
            consentTextView.LabelFor = _switchCustom.Id;

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

            //HOW IT WORKS
            _howItWorksHeader      = FindViewById <TextView>(Resource.Id.consent1_howitworks_header);
            _howItWorksHeader.Text = ConsentViewModel.CONSENT_TWO_TITLE;
            _howItWorksText1       = FindViewById <TextView>(Resource.Id.consent1_howitworks_text_section1);
            _howItWorksText1.Text  = ConsentViewModel.CONSENT_TWO_PARAGRAPH_SECTION_ONE;
            _howItWorksText2       = FindViewById <TextView>(Resource.Id.consent1_howitworks_text_section2);
            _howItWorksText2.Text  = ConsentViewModel.CONSENT_TWO_PARAGRAPH_SECTION_TWO;
            _howItWorksText3       = FindViewById <TextView>(Resource.Id.consent1_howitworks_text_section3);
            _howItWorksText3.Text  = ConsentViewModel.CONSENT_TWO_PARAGRAPH_SECTION_THREE;

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

            //BEHANDLING AF PERSONOPLYSNINGWER
            _processingofpersonaldataText1      = FindViewById <TextView>(Resource.Id.consent1_processingofpersonaldata_text_section1);
            _processingofpersonaldataText1.Text = ConsentViewModel.CONSENT_FIVE_PARAGRAPH_SECTION_ONE;
            _processingofpersonaldataText2      = FindViewById <TextView>(Resource.Id.consent1_processingofpersonaldata_text_section2);
            _processingofpersonaldataText2.Text = ConsentViewModel.CONSENT_FIVE_PARAGRAPH_SECTION_TWO;
            Linkify.AddLinks(_processingofpersonaldataText2, MatchOptions.EmailAddresses);
            _processingofpersonaldataText3      = FindViewById <TextView>(Resource.Id.consent1_processingofpersonaldata_text_section3);
            _processingofpersonaldataText3.Text = ConsentViewModel.CONSENT_FIVE_PARAGRAPH_SECTION_THREE;

            //PERSONVERNERKLÆRINGEN LINK
            _policyLinkText = FindViewById <TextView>(Resource.Id.consent_paragraph_policy_link);
            _policyLinkText.TextFormatted  = HtmlCompat.FromHtml($"<a href=\"{ConsentViewModel.CONSENT_SEVEN_LINK_URL}\">{ConsentViewModel.CONSENT_SEVEN_LINK_TEXT}</a>", HtmlCompat.FromHtmlModeLegacy);
            _policyLinkText.MovementMethod = new Android.Text.Method.LinkMovementMethod();


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


            RelativeLayout RelativeLayout4    = FindViewById <RelativeLayout>(Resource.Id.consent_paragraph_hvordan_accepterer);
            TextView       contactInformation = RelativeLayout4.FindViewById <TextView>(Resource.Id.consent_page_text);

            contactInformation.TextAlignment = TextAlignment.ViewStart;
            contactInformation.TextFormatted = HtmlCompat.FromHtml(ConsentViewModel.CONSENT_FOUR_PARAGRAPH, HtmlCompat.FromHtmlModeLegacy);
            Linkify.AddLinks(contactInformation, MatchOptions.EmailAddresses | MatchOptions.PhoneNumbers);


            // 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();

            HeadingAccessibilityDelegate headingAccessibilityDelegate = AccessibilityUtils.GetHeadingAccessibilityDelegate();

            header.SetAccessibilityDelegate(headingAccessibilityDelegate);
            _aboutHeader.SetAccessibilityDelegate(headingAccessibilityDelegate);
            _howItWorksHeader.SetAccessibilityDelegate(headingAccessibilityDelegate);
            _samtykkebottomHeader.SetAccessibilityDelegate(headingAccessibilityDelegate);
        }
예제 #25
0
        private void UpdateUI()
        {
            TextView _dailyNumbersHeader = FindViewById <TextView>(Resource.Id.daily_numbers_header_textView);

            _dailyNumbersHeader.Text = DAILY_NUMBERS_HEADER;
            TextView _dailyNumbersSubHeaderStatistics = FindViewById <TextView>(Resource.Id.daily_numbers_statistics_header_textView);

            _dailyNumbersSubHeaderStatistics.Text          = DAILY_NUMBERS_TITLE_ONE;
            _dailyNumbersSubHeaderStatistics.TextAlignment = TextAlignment.ViewStart;
            TextView _dailyNumbersSubTextStatistics  = FindViewById <TextView>(Resource.Id.daily_numbers_statistics_text_textview);
            TextView _dailyNumbersSubTextSmittestopp = FindViewById <TextView>(Resource.Id.daily_numbers_smittestopp_text_textview);

            _dailyNumbersSubTextSmittestopp.TextAlignment = TextAlignment.ViewStart;
            SetupSubTextWithLink(_dailyNumbersSubTextStatistics, LastUpdateStringSubHeader);
            SetupSubTextWithLink(_dailyNumbersSubTextSmittestopp, LastUpdateStringSubSubHeader);

            FindViewById <TextView>(Resource.Id.daily_numbers_infected_header_text).Text = KEY_FEATURE_ONE_LABEL;
            FindViewById <TextView>(Resource.Id.daily_numbers_infected_number_text).Text = ConfirmedCasesToday;
            FindViewById <TextView>(Resource.Id.daily_numbers_infected_total_text).Text  = ConfirmedCasesTotal;

            FindViewById <TextView>(Resource.Id.daily_numbers_tested_header_text).Text = KEY_FEATURE_THREE_LABEL;
            FindViewById <TextView>(Resource.Id.daily_numbers_tested_number_text).Text = TestsConductedToday;
            FindViewById <TextView>(Resource.Id.daily_numbers_tested_total_text).Text  = TestsConductedTotal;

            FindViewById <TextView>(Resource.Id.daily_numbers_hospitalized_header_text).Text = KEY_FEATURE_FOUR_LABEL;
            FindViewById <TextView>(Resource.Id.daily_numbers_hospitalized_number_text).Text = PatientsAdmittedToday;

            FindViewById <TextView>(Resource.Id.daily_numbers_intensive_header_text).Text = KEY_FEATURE_SEVEN_LABEL;
            FindViewById <TextView>(Resource.Id.daily_numbers_intensive_number_text).Text = PatientsIntensiveCare;

            TextView _dailyNumbersSubHeaderVaccinations = FindViewById <TextView>(Resource.Id.daily_numbers_vaccinations_header_textView);

            _dailyNumbersSubHeaderVaccinations.Text = DAILY_NUMBERS_TITLE_TWO;

            TextView _dailyNumbersSubTextVaccinations = FindViewById <TextView>(Resource.Id.daily_numbers_vaccinations_text_textview);

            SetupSubTextWithLink(_dailyNumbersSubTextVaccinations, LastUpdateStringSubTextTwo);

            TextView keyFeatureNineTextView = FindViewById <TextView>(Resource.Id.daily_numbers_vaccination_dose1_header_text);

            keyFeatureNineTextView.Text = KEY_FEATURE_NINE_LABEL;
            keyFeatureNineTextView.ContentDescription = KEY_FEATURE_NINE_ACCESSIBILITY_LABEL;
            FindViewById <TextView>(Resource.Id.daily_numbers_vaccination_dose1_number_text).Text = VaccinationsDoseOneToday;
            FindViewById <TextView>(Resource.Id.daily_numbers_vaccination_dose1_total_text).Text  = VaccinationsDoseOneTotal;

            TextView keyFeatureTenTextView = FindViewById <TextView>(Resource.Id.daily_numbers_vaccination_dose2_header_text);

            keyFeatureTenTextView.Text = KEY_FEATURE_TEN_LABEL;
            keyFeatureTenTextView.ContentDescription = KEY_FEATURE_TEN_ACCESSIBILITY_LABEL;
            FindViewById <TextView>(Resource.Id.daily_numbers_vaccination_dose2_number_text).Text = VaccinationsDoseTwoToday;
            FindViewById <TextView>(Resource.Id.daily_numbers_vaccination_dose2_total_text).Text  = VaccinationsDoseTwoTotal;

            TextView _dailyNumbersSubHeaderSmittestopp = FindViewById <TextView>(Resource.Id.daily_numbers_smittestopp_header_textView);

            _dailyNumbersSubHeaderSmittestopp.Text          = DAILY_NUMBERS_TITLE_THREE;
            _dailyNumbersSubHeaderSmittestopp.TextAlignment = TextAlignment.ViewStart;

            //Added newline for the UI to align.
            FindViewById <TextView>(Resource.Id.daily_numbers_smittestopp_downloads_header_text).Text = $"{KEY_FEATURE_SIX_LABEL} \n";
            FindViewById <TextView>(Resource.Id.daily_numbers_smittestopp_downloads_number_text).Text = SmittestopDownloadsTotal;

            FindViewById <TextView>(Resource.Id.daily_numbers_positive_shared_header_text).Text = KEY_FEATURE_FIVE_LABEL;
            FindViewById <TextView>(Resource.Id.daily_numbers_positive_shared_number_text).Text = NumberOfPositiveTestsResultsLast7Days;
            FindViewById <TextView>(Resource.Id.daily_numbers_positive_shared_total_text).Text  = NumberOfPositiveTestsResultsTotal;

            // CONTENT DESCRIPTIONS OF HEADERS
            _dailyNumbersHeader.ContentDescription = DAILY_NUMBERS_HEADER.ToLower();
            _dailyNumbersSubHeaderStatistics.ContentDescription   = DAILY_NUMBERS_TITLE_ONE.ToLower();
            _dailyNumbersSubHeaderVaccinations.ContentDescription = DAILY_NUMBERS_TITLE_TWO.ToLower();
            _dailyNumbersSubHeaderSmittestopp.ContentDescription  = DAILY_NUMBERS_TITLE_THREE.ToLower();
            _dailyNumbersHeader.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());
            _dailyNumbersSubHeaderStatistics.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());
            _dailyNumbersSubHeaderVaccinations.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());
            _dailyNumbersSubHeaderSmittestopp.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());
        }
예제 #26
0
        private async void InitLayout()
        {
            // Header
            _toolbarLinearLayout = FindViewById <LinearLayout>(Resource.Id.infection_status_activity_toolbar_layout);
            _statusLinearLayout  = FindViewById <LinearLayout>(Resource.Id.infection_status_activity_status_layout);

            //TextViews
            _activityStatusText        = FindViewById <TextView>(Resource.Id.infection_status_activity_status_textView);
            _activityStatusDescription =
                FindViewById <TextView>(Resource.Id.infection_status_activivity_status_description_textView);
            _messeageHeader        = FindViewById <TextView>(Resource.Id.infection_status_message_text_textView);
            _messageSubHeader      = FindViewById <TextView>(Resource.Id.infection_status_new_message_text_textView);
            _registrationHeader    = FindViewById <TextView>(Resource.Id.infection_status_registration_text_textView);
            _registrationSubheader =
                FindViewById <TextView>(Resource.Id.infection_status_registration_login_text_textView);
            _menuText = FindViewById <TextView>(Resource.Id.infection_status_menu_text_view);

            //Buttons
            _onOffButton           = FindViewById <Button>(Resource.Id.infection_status_on_off_button);
            _messageRelativeLayout =
                FindViewById <RelativeLayout>(Resource.Id.infection_status_messages_button_relativeLayout);
            _registrationRelativeLayout =
                FindViewById <RelativeLayout>(Resource.Id.infection_status_registration_button_relativeLayout);
            _menuIcon           = FindViewById <ImageButton>(Resource.Id.infection_status_menu_icon_relativeLayout);
            _messageCoverButton =
                FindViewById <Button>(Resource.Id.infection_status_messages_button_relativeLayout_button);
            _registrationCoverButton =
                FindViewById <Button>(Resource.Id.infection_status_registration_button_relativeLayout_button);

            //ImageViews
            _notificationDot = FindViewById <ImageView>(Resource.Id.infection_status_message_bell_imageView);
            _fhiLogo         = FindViewById <ImageView>(Resource.Id.infection_status_app_icon_imageView);
            _appLogo         = FindViewById <ImageView>(Resource.Id.infection_status_app_logo);

            //Text initialization
            _activityStatusText.Text        = INFECTION_STATUS_ACTIVE_TEXT;
            _activityStatusDescription.Text = INFECTION_STATUS_ACTIVITY_STATUS_DESCRIPTION_TEXT;
            _messeageHeader.Text            = INFECTION_STATUS_MESSAGE_HEADER_TEXT;
            _messageSubHeader.Text          = INFECTION_STATUS_MESSAGE_SUBHEADER_TEXT;
            _registrationHeader.Text        = INFECTION_STATUS_REGISTRATION_HEADER_TEXT;
            _registrationSubheader.Text     = INFECTION_STATUS_REGISTRATION_SUBHEADER_TEXT;
            _menuText.Text = INFECTION_STATUS_MENU_TEXT;

            //Accessibility
            _messageSubHeader.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());
            _messeageHeader.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());
            _registrationHeader.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate());
            _menuIcon.ContentDescription           = INFECTION_STATUS_MENU_ACCESSIBILITY_TEXT;
            _messageCoverButton.ContentDescription =
                $"{INFECTION_STATUS_MESSAGE_HEADER_TEXT} {INFECTION_STATUS_MESSAGE_SUBHEADER_TEXT}";
            _registrationCoverButton.ContentDescription =
                $"{INFECTION_STATUS_REGISTRATION_HEADER_TEXT} {INFECTION_STATUS_REGISTRATION_SUBHEADER_TEXT}";
            _fhiLogo.ContentDescription = SMITTESPORING_FHI_LOGO_ACCESSIBILITY;
            _appLogo.ContentDescription = SMITTESPORING_APP_LOGO_ACCESSIBILITY;

            //Button click events
            _onOffButton.Click                += new SingleClick(StartStopButton_Click, 500).Run;
            _messageRelativeLayout.Click      += new SingleClick(MessageLayoutButton_Click, 500).Run;
            _messageCoverButton.Click         += new SingleClick(MessageLayoutButton_Click, 500).Run;
            _registrationRelativeLayout.Click += new SingleClick(RegistrationLayoutButton_Click, 500).Run;
            _registrationCoverButton.Click    += new SingleClick(RegistrationLayoutButton_Click, 500).Run;
            _menuIcon.Click += new SingleClick((sender, e) => NavigationHelper.GoToSettingsPage(this), 500).Run;
            _menuText.Click += new SingleClick((sender, e) => NavigationHelper.GoToSettingsPage(this), 500).Run;
            if (!await IsRunning())
            {
                _onOffButton.PerformClick();
            }

            UpdateUI();
            FlightModeHandlerBroadcastReceiver.OnFlightModeChange += UpdateUI;
        }
예제 #27
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);
            TextView       contactInformation = RelativeLayout4.FindViewById <TextView>(Resource.Id.consent_page_text);

            contactInformation.TextAlignment = TextAlignment.ViewStart;
            contactInformation.TextFormatted = HtmlCompat.FromHtml(ConsentViewModel.CONSENT_FOUR_PARAGRAPH, HtmlCompat.FromHtmlModeLegacy);
            Linkify.AddLinks(contactInformation, MatchOptions.EmailAddresses | MatchOptions.PhoneNumbers);

            //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;
            _howitworksText3       = view.FindViewById <TextView>(Resource.Id.consent1_howitworks_text_section3);
            _howitworksText3.Text  = ConsentViewModel.CONSENT_TWO_PARAGRAPH_SECTION_THREE;

            //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
            _processingofpersonaldataText1      = view.FindViewById <TextView>(Resource.Id.consent1_processingofpersonaldata_text_section1);
            _processingofpersonaldataText1.Text = ConsentViewModel.CONSENT_FIVE_PARAGRAPH_SECTION_ONE;
            _processingofpersonaldataText2      = view.FindViewById <TextView>(Resource.Id.consent1_processingofpersonaldata_text_section2);
            _processingofpersonaldataText2.Text = ConsentViewModel.CONSENT_FIVE_PARAGRAPH_SECTION_TWO;
            Linkify.AddLinks(_processingofpersonaldataText2, MatchOptions.EmailAddresses);
            _processingofpersonaldataText3      = view.FindViewById <TextView>(Resource.Id.consent1_processingofpersonaldata_text_section3);
            _processingofpersonaldataText3.Text = ConsentViewModel.CONSENT_FIVE_PARAGRAPH_SECTION_THREE;

            //PERSONVERNERKLÆRINGEN LINK
            _policyLinkText = view.FindViewById <TextView>(Resource.Id.consent_paragraph_policy_link);
            _policyLinkText.TextFormatted  = HtmlCompat.FromHtml($"<a href=\"{ConsentViewModel.CONSENT_SEVEN_LINK_URL}\">{ConsentViewModel.CONSENT_SEVEN_LINK_TEXT}</a>", HtmlCompat.FromHtmlModeLegacy);
            _policyLinkText.MovementMethod = new Android.Text.Method.LinkMovementMethod();

            //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;


            // 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);
        }