Exemplo n.º 1
0
        private void SetDataAndStyleToView()
        {
            // init strings in view
            InitializeAllStrings();

            // set up the background
            //BackgroundImageView2.Image = UIImage.FromBundle("LoginBackground");

            // dissmiss the keyboard when i press return key on email TextField
            EmailTextField.ShouldReturn += (textField) =>
            {
                EmailTextField.ResignFirstResponder();
                PasswordTextField.BecomeFirstResponder();
                return(true);
            };

            // dissmiss the keyboard when i press return key on password TextField
            PasswordTextField.ShouldReturn += (textField) =>
            {
                PasswordTextField.ResignFirstResponder();
                LoginButton_TouchUpInside(null, null);
                return(true);
            };

            // dissmiss the keyboard when i press return key on Name TextField
            FirstNameTextField.ShouldReturn += (textField) =>
            {
                FirstNameTextField.ResignFirstResponder();
                LastNameTextField.BecomeFirstResponder();
                return(true);
            };

            // dissmiss the keyboard when i press return key on FirstName TextField
            LastNameTextField.ShouldReturn += (textField) =>
            {
                LastNameTextField.ResignFirstResponder();
                EmailTextFieldOfRegistration.BecomeFirstResponder();
                return(true);
            };

            // dissmiss the keyboard when i press return key on email TextField
            EmailTextFieldOfRegistration.ShouldReturn += (textField) =>
            {
                EmailTextFieldOfRegistration.ResignFirstResponder();
                PasswordTextFieldOfRegistration.BecomeFirstResponder();
                return(true);
            };

            // dissmiss the keyboard when i press return key on password TextField
            PasswordTextFieldOfRegistration.ShouldReturn += (textField) =>
            {
                PasswordTextFieldOfRegistration.ResignFirstResponder();
                ConfirmPasswordTextField.BecomeFirstResponder();
                return(true);
            };
            PasswordTextFieldOfRegistration.EditingChanged += (o, e) =>
            {
                ErrorMessageLabel.Hidden = true;
            };
            PasswordTextFieldOfRegistration.ShouldBeginEditing += (textField) =>
            {
                if (View.Frame.Y >= 0)
                {
                    bottom = ((float)(RegistrationContainer.Frame.Y + PasswordTextFieldOfRegistration.Frame.Y + PasswordTextFieldOfRegistration.Frame.Height + 10));
                }
                return(true);
            };

            // dissmiss the keyboard when i press return key on Confirm Password TextField
            ConfirmPasswordTextField.ShouldReturn += (textField) =>
            {
                ConfirmPasswordTextField.ResignFirstResponder();
                return(true);
            };
            ConfirmPasswordTextField.EditingChanged += (o, e) =>
            {
                ErrorMessageLabel.Hidden = true;
            };
            ConfirmPasswordTextField.ShouldBeginEditing += (textField) =>
            {
                if (View.Frame.Y >= 0)
                {
                    bottom = ((float)(RegistrationContainer.Frame.Y + ConfirmPasswordTextField.Frame.Y + ConfirmPasswordTextField.Frame.Height + 10));
                }
                return(true);
            };

            // dissmiss the keyboard when i press return key on Confirm Password TextField
            EmailTextFieldOfForgetPassword.ShouldReturn += (textField) =>
            {
                EmailTextFieldOfForgetPassword.ResignFirstResponder();
                return(true);
            };

            EmailTextField.KeyboardType                       = UIKeyboardType.EmailAddress;
            EmailTextField.AutocorrectionType                 = UITextAutocorrectionType.No;
            PasswordTextField.AutocorrectionType              = UITextAutocorrectionType.No;
            FirstNameTextField.ReturnKeyType                  = UIReturnKeyType.Next;
            LastNameTextField.AutocorrectionType              = UITextAutocorrectionType.No;
            LastNameTextField.ReturnKeyType                   = UIReturnKeyType.Next;
            EmailTextFieldOfRegistration.KeyboardType         = UIKeyboardType.EmailAddress;
            EmailTextFieldOfRegistration.AutocorrectionType   = UITextAutocorrectionType.No;
            EmailTextFieldOfRegistration.ReturnKeyType        = UIReturnKeyType.Next;
            PasswordTextFieldOfRegistration.ReturnKeyType     = UIReturnKeyType.Next;
            ConfirmPasswordTextField.ReturnKeyType            = UIReturnKeyType.Next;
            EmailTextFieldOfForgetPassword.KeyboardType       = UIKeyboardType.EmailAddress;
            EmailTextFieldOfForgetPassword.AutocorrectionType = UITextAutocorrectionType.No;

            // set up the rounded corner fot the button
            LoadingIndicator.Hidden         = true;
            LoginButton.Layer.CornerRadius  = 4;
            LoginButton.Layer.MasksToBounds = true;

            RegistrationButton.Layer.CornerRadius  = 4;
            RegistrationButton.Layer.MasksToBounds = true;
            RegistrationButton.Enabled             = false;

            ResetPasswordButton.Layer.CornerRadius  = 4;
            ResetPasswordButton.Layer.MasksToBounds = true;
            ResetPasswordButton.Enabled             = false;

            //DisplayFacebookButton();
            //_facebookButton.Layer.CornerRadius = 4;
            //_facebookButton.Layer.MasksToBounds = true;

            CreateAccountButton.ContentEdgeInsets  = new UIEdgeInsets(5, 0, 5, 5);
            ForgetPasswordButton.ContentEdgeInsets = new UIEdgeInsets(5, 5, 5, 0);

            LoginContainer.Hidden          = false;
            RegistrationContainer.Hidden   = true;
            ForgetPasswordContainer.Hidden = true;
            BackButton.Hidden           = true;
            CreateAccountButton.Hidden  = false;
            ForgetPasswordButton.Hidden = false;
            ErrorMessageLabel.Hidden    = true;
            ErrorMessageLabel.TextColor = UIColor.FromRGB(255, 76, 56);
        }
Exemplo n.º 2
0
        void ReleaseDesignerOutlets()
        {
            if (BackButton != null)
            {
                BackButton.Dispose();
                BackButton = null;
            }

            if (BackgroundImageView != null)
            {
                BackgroundImageView.Dispose();
                BackgroundImageView = null;
            }

            if (ConfirmPasswordTextField != null)
            {
                ConfirmPasswordTextField.Dispose();
                ConfirmPasswordTextField = null;
            }

            if (CreateAccountButton != null)
            {
                CreateAccountButton.Dispose();
                CreateAccountButton = null;
            }

            if (EmailTextField != null)
            {
                EmailTextField.Dispose();
                EmailTextField = null;
            }

            if (EmailTextFieldOfForgetPassword != null)
            {
                EmailTextFieldOfForgetPassword.Dispose();
                EmailTextFieldOfForgetPassword = null;
            }

            if (EmailTextFieldOfRegistration != null)
            {
                EmailTextFieldOfRegistration.Dispose();
                EmailTextFieldOfRegistration = null;
            }

            if (ErrorMessageLabel != null)
            {
                ErrorMessageLabel.Dispose();
                ErrorMessageLabel = null;
            }

            if (FirstNameTextField != null)
            {
                FirstNameTextField.Dispose();
                FirstNameTextField = null;
            }

            if (ForgetPasswordButton != null)
            {
                ForgetPasswordButton.Dispose();
                ForgetPasswordButton = null;
            }

            if (ForgetPasswordContainer != null)
            {
                ForgetPasswordContainer.Dispose();
                ForgetPasswordContainer = null;
            }

            if (LastNameTextField != null)
            {
                LastNameTextField.Dispose();
                LastNameTextField = null;
            }

            if (LoadingIndicator != null)
            {
                LoadingIndicator.Dispose();
                LoadingIndicator = null;
            }

            if (LoginButton != null)
            {
                LoginButton.Dispose();
                LoginButton = null;
            }

            if (LoginContainer != null)
            {
                LoginContainer.Dispose();
                LoginContainer = null;
            }

            if (PasswordTextField != null)
            {
                PasswordTextField.Dispose();
                PasswordTextField = null;
            }

            if (PasswordTextFieldOfRegistration != null)
            {
                PasswordTextFieldOfRegistration.Dispose();
                PasswordTextFieldOfRegistration = null;
            }

            if (RegistrationButton != null)
            {
                RegistrationButton.Dispose();
                RegistrationButton = null;
            }

            if (RegistrationContainer != null)
            {
                RegistrationContainer.Dispose();
                RegistrationContainer = null;
            }

            if (ResetPasswordButton != null)
            {
                ResetPasswordButton.Dispose();
                ResetPasswordButton = null;
            }

            if (WhatIsSeekiosButton != null)
            {
                WhatIsSeekiosButton.Dispose();
                WhatIsSeekiosButton = null;
            }
        }