Exemple #1
0
        public ResetPasswordView()
        {
            entEmail = new EntryExtension {
                Placeholder = "E-mail*",
                Keyboard    = Keyboard.Email
            };

            Button btnLogin = new Button {
                Text = "Восстановить", HeightRequest = Utils.GetSize(43)
            };

            btnLogin.Clicked += (s, e) => {
                activityIndicator.IsRunning = true;
                ClickReset(s, entEmail.textBox.Text);
            };

            Label lblMessage = new Label {
                TextColor = ApplicationStyle.PlaceholderColor,
                FontSize  = Utils.GetSize(10),
                Text      = "Укажите ваш емейл при регистрации и мы вышлем на него пароль"
            };

            StackLayout layoutButton = new StackLayout {
                Spacing  = 18,
                Padding  = new Thickness(8, 10),
                Children =
                {
                    lblMessage,
                    btnLogin,
                }
            };

            activityIndicator = new ActivityIndicator
            {
                Color           = Device.OnPlatform(Color.Black, Color.Gray, Color.Default),
                VerticalOptions = LayoutOptions.CenterAndExpand
            };
            layoutMain = new StackLayout {
                Spacing  = 0,
                Children =
                {
                    entEmail,
                    layoutButton,
                    activityIndicator
                }
            };
            Content = layoutMain;
        }
Exemple #2
0
        public AuthorizationView()
        {
            entEmail = new EntryExtension {
                Placeholder = "E-mail*",
                Keyboard    = Keyboard.Email,
            };

            entPassword = new MyEntry {
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                Placeholder       = "Пароль*",
                IsPassword        = true,
            };
            TapGestureRecognizer tapLayout = new TapGestureRecognizer();

            tapLayout.Tapped += (sender, e) => { entPassword.Focus(); };
            this.GestureRecognizers.Add(tapLayout);

            Button btnResetPassword = new Button {
                TextColor       = ApplicationStyle.GreenColor,
                BackgroundColor = Color.Transparent,
                FontSize        = Utils.GetSize(14),
                Text            = "Забыли?"
            };

            btnResetPassword.Clicked += OnClickReset;

            StackLayout layoutPassword = new StackLayout {
                HeightRequest     = Utils.GetSize(43),
                Padding           = new Thickness(8, 0),
                HorizontalOptions = LayoutOptions.FillAndExpand,
                Orientation       = StackOrientation.Horizontal,
                Children          =
                {
                    entPassword,
                    btnResetPassword,
                }
            };

            StackLayout layoutBlockPassword = new StackLayout {
                Spacing  = 0,
                Children =
                {
                    layoutPassword,
                    new BoxView()
                }
            };


            btnLogin = new Button {
                Text = "Войти", HeightRequest = Utils.GetSize(43)
            };
            btnLogin.Clicked += (s, e) => {
                activityIndicator.IsRunning = true;
                ClickLogin(s, entEmail.textBox.Text, entPassword.Text);
            };

            Button btnGoToRegitration = new Button {
                Text            = "Зарегистрироваться",
                TextColor       = ApplicationStyle.LabelColor,
                BackgroundColor = Color.White,
                HeightRequest   = Utils.GetSize(43)
            };

            btnGoToRegitration.Clicked += (sender, e) => {
                RegitrationClick(this, null);
            };
            StackLayout layoutButton = new StackLayout {
                Spacing  = 0,
                Padding  = new Thickness(8, 18),
                Children =
                {
                    btnLogin,
                    btnGoToRegitration
                }
            };

            activityIndicator = new ActivityIndicator
            {
                Color           = Device.OnPlatform(Color.Black, Color.Gray, Color.Default),
                VerticalOptions = LayoutOptions.CenterAndExpand
            };

            layoutMain = new StackLayout {
                Spacing  = 0,
                Children =
                {
                    entEmail,
                    layoutBlockPassword,
                    layoutButton,
                    activityIndicator
                }
            };

            Content = layoutMain;
        }
        public PersonalDataView(List <Zone> zoneList, bool isRegistration)
        {
//			Content = new MyEntry { Placeholder = "sdffsdfsdfds", BackgroundColor = Color.Red, VerticalOptions = LayoutOptions.Start };
//			BackgroundColor = Color.Red;
//			return;


//			(Forms.Context as Android.App.Activity).Window.SetSoftInputMode(Android.Views.SoftInput.AdjustNothing );

            VerticalOptions = LayoutOptions.Start;



            IsClippedToBounds = true;

            IsRegistration = isRegistration;
            ZoneList       = zoneList;
            OnePage.bottomView.IsVisible = false;

            if (zoneList != null)
            {
                countriesList = zoneList.Select(l => l.Countries).Distinct().ToList <Country>();
            }

            entFirstname = new EntryExtension {
                Placeholder = "Имя"
            };
            entFirstname.textBox.TextChanged += EditStringTextBox;
            entFirstname.textBox.SetBinding(MyEntry.TextProperty, "Address.Firstname");
//			entFirstname.Focused += (sender, e) => {
//				this.HeightRequest = 200;
//			};

            #region MyRegion

            entLastname = new EntryExtension {
                Placeholder = "Фамилия"
            };
            entLastname.textBox.TextChanged += EditStringTextBox;
            entLastname.textBox.SetBinding(MyEntry.TextProperty, "Address.Lastname");

            pickerGender = new PickerExtension {
                Placeholder = "Пол"
            };
            foreach (string value in gender.Values)
            {
                pickerGender.textBox.Items.Add(value);
            }

            entPhone = new EntryExtension {
                Placeholder = "Телефон"
            };
            entPhone.textBox.TextChanged += EditPhoneTextBox;
            entPhone.textBox.Keyboard     = Keyboard.Numeric;
            entPhone.textBox.SetBinding(MyEntry.TextProperty, "Phone");

            entStreet = new EntryExtension {
                Placeholder = "Улица"
            };
            //entStreet.textBox.TextChanged += EditStringTextBox;
            entStreet.textBox.SetBinding(MyEntry.TextProperty, "Address.Street");

            entPostCode = new EntryExtension {
                Placeholder = "Почтовый индекс"
            };
            entPostCode.textBox.TextChanged += EditNumberTextBox;
            entPostCode.textBox.Keyboard     = Keyboard.Numeric;
            entPostCode.textBox.SetBinding(MyEntry.TextProperty, "Address.PostCode");

            entCity = new EntryExtension {
                Placeholder = "Город"
            };
            entCity.textBox.TextChanged += EditStringTextBox;
            entCity.textBox.SetBinding(MyEntry.TextProperty, "Address.City");


            pickerCountry = new PickerExtension {
                Placeholder = "Страна",
            };
            pickerCountry.textBox.SelectedIndexChanged += OnSelectCountry;
            if (countriesList != null)
            {
                foreach (Country item in countriesList)
                {
                    pickerCountry.textBox.Items.Add(item.Name);
                }
            }

            pickerZone = new PickerExtension {
                Placeholder = "Регион",
            };

            lblPassport = new Label {
                Text              = "Паспортные данные",
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                HorizontalOptions = LayoutOptions.Center,
            };
            StackLayout titlePassportLayout = new StackLayout {
                BackgroundColor = ApplicationStyle.LineColor,
                HeightRequest   = Utils.GetSize(22),
                Padding         = new Thickness(8, 0),
                Children        =
                {
                    lblPassport
                }
            };

            entPasportSeria = new EntryExtension {
                Placeholder = "Серия"
            };
            entPasportSeria.textBox.TextChanged += EditNumberTextBox;
            entPasportSeria.textBox.Keyboard     = Keyboard.Numeric;
            entPasportSeria.textBox.SetBinding(MyEntry.TextProperty, "Address.PasportSeria");

            entPasportNomer = new EntryExtension {
                Placeholder = "Номер"
            };
            entPasportNomer.textBox.TextChanged += EditNumberTextBox;
            entPasportNomer.textBox.Keyboard     = Keyboard.Numeric;
            entPasportNomer.textBox.SetBinding(MyEntry.TextProperty, "Address.PasportNomer");

            entPasportKemVidan = new EntryExtension {
                Placeholder = "Кем выдан"
            };
            entPasportKemVidan.textBox.SetBinding(MyEntry.TextProperty, "Address.PasportKemVidan");

            datePickerPasportKogdaVidan = new DatePickerExtension {
                Format = "D", Placeholder = "Когда выдан"
            };

            entEmail = new EntryExtension {
                Placeholder = "E-mail", Keyboard = Keyboard.Email
            };
            entEmail.textBox.Keyboard = Keyboard.Email;
            entEmail.textBox.SetBinding(MyEntry.TextProperty, "Email");

            entPassword1 = new EntryExtension {
                Placeholder = "Пароль", IsPassword = true
            };
            entPassword1.textBox.SetBinding(MyEntry.TextProperty, "Password");

            entPassword2 = new EntryExtension {
                Placeholder = "Повторите пароль", IsPassword = true
            };
            entPassword2.textBox.SetBinding(MyEntry.TextProperty, "Password");


            StackLayout titleLoginLayout = new StackLayout {
                BackgroundColor = ApplicationStyle.LineColor,
                HeightRequest   = Utils.GetSize(22),
                Padding         = new Thickness(8, 0),
            };

            Button btnSave = new Button()
            {
                HeightRequest = Utils.GetSize(43)
            };
            if (isRegistration)
            {
                btnSave.Text = "Зарегистрироваться";
            }
            else
            {
                btnSave.Text = "Зарегистрироваться";
            }

            StackLayout layoutSave = new StackLayout {
                Padding  = new Thickness(8, 16),
                Children =
                {
                    btnSave
                }
            };
            btnSave.Clicked += SaveData;

            mainLayout = new StackLayout {
                Spacing  = 0,
                Children =
                {
                    entFirstname,
                    entLastname,
                    pickerGender,
                    entPhone,
                    entStreet,
                    entPostCode,
                    entCity,
                    pickerCountry,
                    pickerZone,
                    titlePassportLayout,
                    entPasportSeria,
                    entPasportNomer,
                    entPasportKemVidan,
                    datePickerPasportKogdaVidan,
                    titleLoginLayout,
                    entEmail,
                    entPassword1,
                    entPassword2,
                    layoutSave,
                    new StackLayout {
                        HeightRequest = 300
                    }
                }
            };
            Content = mainLayout;
            #endregion


            foreach (var item in mainLayout.Children)
            {
                EntryExtension ent = item as EntryExtension;
                if (ent == null)
                {
                    continue;
                }

                //ent.TextFocuced += OnTextFocused;
                //ent.TextUnFocuced += OnTextUnFocused;
            }
        }