Example #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            RegisterUIButton.Layer.BorderWidth = 1.0f;
            RegisterUIButton.Layer.BorderColor = UIColor.FromRGB(.43f, .80f, .79f).CGColor;

            FullNameRegisterTextField.Placeholder = StringResources.register_ui_fullname_label;
            EmailRegisterTextField.Placeholder    = StringResources.common_ui_forms_email_label;
            PasswordRegisterTextField.Placeholder = StringResources.common_ui_forms_password_label;

            var termsContent = string.Format(StringResources.register_ui_terms_label, Config.WEB_URL);

            Terms.AttributedText    = ResearchConsent.BuildFromHTML(termsContent, 14, false);
            Terms.DataDetectorTypes = UIDataDetectorType.Link;

            RegisterUIButton.SetTitle(StringResources.register_ui_submit_button, UIControlState.Normal);

            FullNameRegisterTextField.ShouldReturn += NavigateNext;
            EmailRegisterTextField.ShouldReturn    += NavigateNext;
            PasswordRegisterTextField.ShouldReturn += NavigateNext;
        }
        public override void ViewDidAppear(bool animated)
        {
            UpdateSessionsSource();
            base.ViewDidAppear(animated);
            TabBarController.Title = StringResources.sessions_ui_title;

            var prefs = NSUserDefaults.StandardUserDefaults;

            if (prefs.BoolForKey("SESSION_RECORDED"))
            {
                var session  = Queries.LastInterviewSession;
                var _content = string.Format(
                    StringResources.debriefing_ui_page_first_content,
                    Queries.ProjectById(session.ProjectID).Title,
                    session.ConsentType
                    );

                prefs.SetBool(false, "SESSION_RECORDED");
                var dialog = new MessageDialog().BuildErrorMessageDialog(StringResources.debriefing_ui_page_first_title, "");
                dialog.SetValueForKey(ResearchConsent.BuildFromHTML(_content), new NSString("attributedMessage"));
                PresentViewController(dialog, true, null);
            }
        }
 NSAttributedString BuildHTML(string title, string content) => ResearchConsent.BuildFromHTML($"&bullet; <b>{title}:</b> {content}", 14, false);
Example #4
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            Title = StringResources.consent_gabber_toolbar_title;

            int SelectedProjectID = Convert.ToInt32(NSUserDefaults.StandardUserDefaults.IntForKey("SelectedProjectID"));
            var SelectedProject   = Queries.ProjectById(SelectedProjectID);

            ConversationConsentTitle.Text             = StringResources.consent_gabber_title_control;
            ConversationConsentContent.AttributedText = ResearchConsent.BuildFromHTML(StringResources.consent_gabber_body_control);
            ConversationDecisionTitle.Text            = StringResources.consent_gabber_title_decision;
            ConversationDecisionDes.AttributedText    = ResearchConsent.BuildFromHTML(StringResources.consent_gabber_body_decision);

            var membersContent = string.Format(
                StringResources.consent_gabber_consent_type_members_full,
                SelectedProject.Members.Count,
                SelectedProject.Members.FindAll((obj) => obj.Role == "researcher").Count);

            var privateContent = string.Format(StringResources.consent_gabber_consent_type_private_full, BuildParticipants());

            var items = new List <Consent>
            {
                new Consent {
                    Title    = StringResources.consent_gabber_consent_type_public_brief,
                    Subtitle = ResearchConsent.BuildFromHTML(StringResources.consent_gabber_consent_type_public_full, 14, false)
                },
                new Consent {
                    Title    = StringResources.consent_gabber_consent_type_members_brief,
                    Subtitle = ResearchConsent.BuildFromHTML(membersContent, 14, false)
                },
                new Consent {
                    Title    = StringResources.consent_gabber_consent_type_private_brief,
                    Subtitle = ResearchConsent.BuildFromHTML(privateContent, 14, false)
                }
            };

            // Only show members if the project is private
            if (SelectedProject.IsPublic)
            {
                items.RemoveAt(1);
            }

            var consentVSource = new ConsentViewSource(items);

            consentVSource.ConsentSelected += (int selectedIndex) =>
            {
                var consentOptions = new string[] { "public", "members", "private" };
                ConsentType = consentOptions[selectedIndex];
                ConversationConsentSubmit.Enabled = true;
            };

            ConversationConsentTableView.Source             = consentVSource;
            ConversationConsentTableView.RowHeight          = UITableView.AutomaticDimension;
            ConversationConsentTableView.EstimatedRowHeight = 86f;

            ConversationConsentSubmit.SetTitle(StringResources.consent_gabber_submit, UIControlState.Normal);
            ConversationConsentSubmit.Layer.BorderWidth = 1.0f;
            ConversationConsentSubmit.Layer.BorderColor = UIColor.FromRGB(.43f, .80f, .79f).CGColor;
            ConversationConsentSubmit.Enabled           = false;

            ConversationConsentSubmit.TouchUpInside += delegate {
                NSUserDefaults.StandardUserDefaults.SetString(ConsentType, "SESSION_CONSENT");
            };
        }