Exemple #1
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            if (container == null)
            {
                // Currently in a layout without a container, so no reason to create our view.
                return(null);
            }

            View view = inflater.Inflate(Resource.Layout.Register, container, false);

            view.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BackgroundColor));
            view.SetOnTouchListener(this);

            ScrollView = view.FindViewById <ScrollView>(Resource.Id.scroll_background);

            RelativeLayout layoutView = view.FindViewById <RelativeLayout>(Resource.Id.scroll_linear_background);

            ProgressBarBlocker                         = view.FindViewById <RelativeLayout>(Resource.Id.progressBarBlocker);
            ProgressBarBlocker.Visibility              = ViewStates.Gone;
            ProgressBarBlocker.LayoutParameters        = new RelativeLayout.LayoutParams(0, 0);
            ProgressBarBlocker.LayoutParameters.Width  = NavbarFragment.GetFullDisplayWidth( );
            ProgressBarBlocker.LayoutParameters.Height = this.Resources.DisplayMetrics.HeightPixels;

            ResultView = new UIResultView(layoutView, new System.Drawing.RectangleF(0, 0, NavbarFragment.GetFullDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels), OnResultViewDone);

            RelativeLayout navBar = view.FindViewById <RelativeLayout>(Resource.Id.navbar_relative_layout);

            navBar.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BackgroundColor));


            // setup the username
            UserNameLayer = view.FindViewById <RelativeLayout>(Resource.Id.username_background);
            ControlStyling.StyleBGLayer(UserNameLayer);

            UserNameText = UserNameLayer.FindViewById <EditText>(Resource.Id.userNameText);
            ControlStyling.StyleTextField(UserNameText, RegisterStrings.UsernamePlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            UserNameBGColor         = ControlStylingConfig.BG_Layer_Color;
            UserNameText.InputType |= InputTypes.TextFlagCapWords;

            View borderView = UserNameLayer.FindViewById <View>(Resource.Id.username_border);

            borderView.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BG_Layer_BorderColor));

            // password
            PasswordLayer = view.FindViewById <RelativeLayout>(Resource.Id.password_background);
            ControlStyling.StyleBGLayer(PasswordLayer);

            PasswordText            = PasswordLayer.FindViewById <EditText>(Resource.Id.passwordText);
            PasswordText.InputType |= InputTypes.TextVariationPassword;
            ControlStyling.StyleTextField(PasswordText, RegisterStrings.PasswordPlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            PasswordBGColor = ControlStylingConfig.BG_Layer_Color;

            borderView = PasswordLayer.FindViewById <View>(Resource.Id.password_border);
            borderView.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BG_Layer_BorderColor));



            ConfirmPasswordLayer = view.FindViewById <RelativeLayout>(Resource.Id.confirmPassword_background);
            ControlStyling.StyleBGLayer(ConfirmPasswordLayer);

            ConfirmPasswordText            = ConfirmPasswordLayer.FindViewById <EditText>(Resource.Id.confirmPasswordText);
            ConfirmPasswordText.InputType |= InputTypes.TextVariationPassword;
            ControlStyling.StyleTextField(ConfirmPasswordText, RegisterStrings.ConfirmPasswordPlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            ConfirmPasswordBGColor = ControlStylingConfig.BG_Layer_Color;



            // setup the name section
            NickNameLayer = view.FindViewById <RelativeLayout>(Resource.Id.firstname_background);
            ControlStyling.StyleBGLayer(NickNameLayer);

            NickNameText = NickNameLayer.FindViewById <EditText>(Resource.Id.nickNameText);
            ControlStyling.StyleTextField(NickNameText, RegisterStrings.NickNamePlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            NickNameBGColor         = ControlStylingConfig.BG_Layer_Color;
            NickNameText.InputType |= InputTypes.TextFlagCapWords;

            borderView = NickNameLayer.FindViewById <View>(Resource.Id.middle_border);
            borderView.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BG_Layer_BorderColor));

            LastNameLayer = view.FindViewById <RelativeLayout>(Resource.Id.lastname_background);
            ControlStyling.StyleBGLayer(LastNameLayer);

            LastNameText = LastNameLayer.FindViewById <EditText>(Resource.Id.lastNameText);
            ControlStyling.StyleTextField(LastNameText, RegisterStrings.LastNamePlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            LastNameBGColor         = ControlStylingConfig.BG_Layer_Color;
            LastNameText.InputType |= InputTypes.TextFlagCapWords;


            // setup the cell phone section
            CellPhoneLayer = view.FindViewById <RelativeLayout>(Resource.Id.cellphone_background);
            ControlStyling.StyleBGLayer(CellPhoneLayer);

            CellPhoneText = CellPhoneLayer.FindViewById <EditText>(Resource.Id.cellPhoneText);
            ControlStyling.StyleTextField(CellPhoneText, RegisterStrings.CellPhonePlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            CellPhoneText.AddTextChangedListener(new PhoneNumberFormattingTextWatcher());


            // email layer
            EmailLayer = view.FindViewById <RelativeLayout>(Resource.Id.email_background);
            ControlStyling.StyleBGLayer(EmailLayer);

            borderView = EmailLayer.FindViewById <View>(Resource.Id.middle_border);
            borderView.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BG_Layer_BorderColor));

            EmailText = EmailLayer.FindViewById <EditText>(Resource.Id.emailAddressText);
            ControlStyling.StyleTextField(EmailText, RegisterStrings.EmailPlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            EmailBGColor = ControlStylingConfig.BG_Layer_Color;


            // Register button
            RegisterButton = view.FindViewById <Button>(Resource.Id.registerButton);
            ControlStyling.StyleButton(RegisterButton, RegisterStrings.RegisterButton, ControlStylingConfig.Font_Regular, ControlStylingConfig.Small_FontSize);

            CancelButton = view.FindViewById <Button>(Resource.Id.cancelButton);
            ControlStyling.StyleButton(CancelButton, GeneralStrings.Cancel, ControlStylingConfig.Font_Regular, ControlStylingConfig.Small_FontSize);
            CancelButton.Background = null;

            RegisterButton.Click += (object sender, EventArgs e) =>
            {
                RegisterUser( );
            };

            CancelButton.Click += (object sender, EventArgs e) =>
            {
                // Since they made changes, confirm they want to save them.
                AlertDialog.Builder builder = new AlertDialog.Builder(Activity);
                builder.SetTitle(RegisterStrings.ConfirmCancelReg);

                Java.Lang.ICharSequence [] strings = new Java.Lang.ICharSequence[]
                {
                    new Java.Lang.String(GeneralStrings.Yes),
                    new Java.Lang.String(GeneralStrings.No)
                };

                builder.SetItems(strings, delegate(object s, DialogClickEventArgs clickArgs)
                {
                    Rock.Mobile.Threading.Util.PerformOnUIThread(delegate
                    {
                        switch (clickArgs.Which)
                        {
                        case 0: SpringboardParent.ModalFragmentDone(null); break;

                        case 1: break;
                        }
                    });
                });

                builder.Show( );
            };

            return(view);
        }
Exemple #2
0
        public void Create(object masterView, RectangleF frame)
        {
            View = PlatformView.Create( );
            View.BackgroundColor = ControlStylingConfig.BackgroundColor;
            View.AddAsSubview(masterView);

            GroupTitle = PlatformLabel.Create( );
            GroupTitle.AddAsSubview(masterView);
            GroupTitle.SetFont(ControlStylingConfig.Font_Bold, ControlStylingConfig.Large_FontSize);
            GroupTitle.TextColor     = ControlStylingConfig.TextField_ActiveTextColor;
            GroupTitle.TextAlignment = TextAlignment.Center;

            /*GroupDetailsLayer = PlatformView.Create( );
             * GroupDetailsLayer.AddAsSubview( masterView );
             * GroupDetailsLayer.BackgroundColor = ControlStylingConfig.BG_Layer_Color;
             * GroupDetailsLayer.BorderColor = ControlStylingConfig.BG_Layer_BorderColor;
             * GroupDetailsLayer.BorderWidth = ControlStylingConfig.BG_Layer_BorderWidth;*/

            GroupDetails = PlatformLabel.Create( );
            GroupDetails.AddAsSubview(masterView);
            GroupDetails.SetFont(ControlStylingConfig.Font_Light, ControlStylingConfig.Medium_FontSize);
            GroupDetails.TextColor = ControlStylingConfig.TextField_ActiveTextColor;


            // Name Info
            FirstNameLayer = PlatformView.Create( );
            FirstNameLayer.AddAsSubview(masterView);
            FirstNameLayer.BackgroundColor = ControlStylingConfig.BG_Layer_Color;
            FirstNameLayer.BorderColor     = ControlStylingConfig.BG_Layer_BorderColor;
            FirstNameLayer.BorderWidth     = ControlStylingConfig.BG_Layer_BorderWidth;

            FirstName = PlatformTextField.Create( );
            FirstName.AddAsSubview(masterView);
            FirstName.SetFont(ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            FirstName.PlaceholderTextColor   = ControlStylingConfig.TextField_PlaceholderTextColor;
            FirstName.Placeholder            = ConnectStrings.JoinGroup_FirstNamePlaceholder;
            FirstName.TextColor              = ControlStylingConfig.TextField_ActiveTextColor;
            FirstName.KeyboardAppearance     = KeyboardAppearanceStyle.Dark;
            FirstName.AutoCapitalizationType = AutoCapitalizationType.Words;
            FirstName.AutoCorrectionType     = AutoCorrectionType.No;


            LastNameLayer = PlatformView.Create( );
            LastNameLayer.AddAsSubview(masterView);
            LastNameLayer.BackgroundColor = ControlStylingConfig.BG_Layer_Color;
            LastNameLayer.BorderColor     = ControlStylingConfig.BG_Layer_BorderColor;
            LastNameLayer.BorderWidth     = ControlStylingConfig.BG_Layer_BorderWidth;

            LastName = PlatformTextField.Create( );
            LastName.AddAsSubview(masterView);
            LastName.SetFont(ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            LastName.PlaceholderTextColor   = ControlStylingConfig.TextField_PlaceholderTextColor;
            LastName.Placeholder            = ConnectStrings.JoinGroup_LastNamePlaceholder;
            LastName.TextColor              = ControlStylingConfig.TextField_ActiveTextColor;
            LastName.KeyboardAppearance     = KeyboardAppearanceStyle.Dark;
            LastName.AutoCapitalizationType = AutoCapitalizationType.Words;
            LastName.AutoCorrectionType     = AutoCorrectionType.No;

            SpouseNameLayer = PlatformView.Create( );
            SpouseNameLayer.AddAsSubview(masterView);
            SpouseNameLayer.BackgroundColor = ControlStylingConfig.BG_Layer_Color;
            SpouseNameLayer.BorderColor     = ControlStylingConfig.BG_Layer_BorderColor;
            SpouseNameLayer.BorderWidth     = ControlStylingConfig.BG_Layer_BorderWidth;

            SpouseName = PlatformTextField.Create( );
            SpouseName.AddAsSubview(masterView);
            SpouseName.SetFont(ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            SpouseName.PlaceholderTextColor   = ControlStylingConfig.TextField_PlaceholderTextColor;
            SpouseName.Placeholder            = ConnectStrings.JoinGroup_SpouseNamePlaceholder;
            SpouseName.TextColor              = ControlStylingConfig.TextField_ActiveTextColor;
            SpouseName.KeyboardAppearance     = KeyboardAppearanceStyle.Dark;
            SpouseName.AutoCapitalizationType = AutoCapitalizationType.Words;
            SpouseName.AutoCorrectionType     = AutoCorrectionType.No;

            // Contact Info
            EmailLayer = PlatformView.Create( );
            EmailLayer.AddAsSubview(masterView);
            EmailLayer.BackgroundColor = ControlStylingConfig.BG_Layer_Color;
            EmailLayer.BorderColor     = ControlStylingConfig.BG_Layer_BorderColor;
            EmailLayer.BorderWidth     = ControlStylingConfig.BG_Layer_BorderWidth;

            Email = PlatformTextField.Create( );
            Email.AddAsSubview(masterView);
            Email.SetFont(ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            Email.PlaceholderTextColor   = ControlStylingConfig.TextField_PlaceholderTextColor;
            Email.Placeholder            = ConnectStrings.JoinGroup_EmailPlaceholder;
            Email.TextColor              = ControlStylingConfig.TextField_ActiveTextColor;
            Email.KeyboardAppearance     = KeyboardAppearanceStyle.Dark;
            Email.AutoCapitalizationType = AutoCapitalizationType.None;
            Email.AutoCorrectionType     = AutoCorrectionType.No;

            CellPhoneLayer = PlatformView.Create( );
            CellPhoneLayer.AddAsSubview(masterView);
            CellPhoneLayer.BackgroundColor = ControlStylingConfig.BG_Layer_Color;
            CellPhoneLayer.BorderColor     = ControlStylingConfig.BG_Layer_BorderColor;
            CellPhoneLayer.BorderWidth     = ControlStylingConfig.BG_Layer_BorderWidth;

            CellPhone = PlatformTextField.Create( );
            CellPhone.AddAsSubview(masterView);
            CellPhone.SetFont(ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            CellPhone.PlaceholderTextColor   = ControlStylingConfig.TextField_PlaceholderTextColor;
            CellPhone.Placeholder            = ConnectStrings.JoinGroup_CellPhonePlaceholder;
            CellPhone.TextColor              = ControlStylingConfig.TextField_ActiveTextColor;
            CellPhone.KeyboardAppearance     = KeyboardAppearanceStyle.Dark;
            CellPhone.AutoCapitalizationType = AutoCapitalizationType.None;
            CellPhone.AutoCorrectionType     = AutoCorrectionType.No;


            // Join Button
            JoinButton = PlatformButton.Create( );
            JoinButton.AddAsSubview(masterView);
            JoinButton.ClickEvent      = JoinClicked;
            JoinButton.BackgroundColor = ControlStylingConfig.Button_BGColor;
            JoinButton.TextColor       = ControlStylingConfig.Button_TextColor;
            JoinButton.CornerRadius    = ControlStylingConfig.Button_CornerRadius;
            JoinButton.Text            = ConnectStrings.JoinGroup_JoinButtonLabel;
            JoinButton.SizeToFit( );
            JoinButton.UserInteractionEnabled = true;

            // Create our results view overlay
            ResultView = new UIResultView(masterView, View.Frame, OnResultViewDone);

            // Create our blocker view
            BlockerView = new UIBlockerView(masterView, View.Frame);
        }