Example #1
0
        private void BuildStep1()
        {
            mainText.Text = "get started by \r\n creating an account";
            bottomLayout.Children.Clear();
            bottomLayout.Orientation     = StackOrientation.Vertical;
            bottomLayout.Spacing         = 0;
            bottomLayout.BackgroundColor = Color.White;

            phoneEntry = UIUtils.MakeEntry("Phone", UIUtils.FONT_SFUIDISPLAY_BOLD);
            bottomLayout.Children.Add(phoneEntry);
            bottomLayout.Children.Add(UIUtils.MakeSeparator());

            //addressEntry = UIUtils.MakeEntry("Location/Address", UIUtils.FONT_SFUIDISPLAY_BOLD);
            //bottomLayout.Children.Add(addressEntry);
            //bottomLayout.Children.Add(UIUtils.MakeSeparator());

            var addressACEntry = new AutoCompleteView();

            addressEntry                  = addressACEntry.EntryText;
            addressEntry.FontFamily       = UIUtils.FONT_SFUIDISPLAY_BOLD;
            addressEntry.HeightRequest    = 45;
            addressEntry.FontSize         = 17;
            addressEntry.BackgroundColor  = Color.White;
            addressEntry.Margin           = new Thickness(20, 10, 20, 0);
            addressEntry.Placeholder      = "Location/Address";
            addressEntry.PlaceholderColor = Color.FromHex("787878");
            addressEntry.TextColor        = Color.Black;
            bottomLayout.Children.Add(addressACEntry);
            bottomLayout.Children.Add(UIUtils.MakeSeparator());
            var sh = new PlaceSearchHelper(addressACEntry);

            sh.OnSelected += (o, p) => { lastLocation = p; };

            emailEntry = UIUtils.MakeEntry("Email", UIUtils.FONT_SFUIDISPLAY_BOLD);
            bottomLayout.Children.Add(emailEntry);
            bottomLayout.Children.Add(UIUtils.MakeSeparator());

            pswdEntry            = UIUtils.MakeEntry("Password", UIUtils.FONT_SFUIDISPLAY_BOLD);
            pswdEntry.IsPassword = true;
            bottomLayout.Children.Add(pswdEntry);
            bottomLayout.Children.Add(UIUtils.MakeSeparator());

            fnameEntry = UIUtils.MakeEntry("First Name", UIUtils.FONT_SFUIDISPLAY_BOLD);
            bottomLayout.Children.Add(fnameEntry);
            bottomLayout.Children.Add(UIUtils.MakeSeparator());

            lnameEntry = UIUtils.MakeEntry("Last Name", UIUtils.FONT_SFUIDISPLAY_BOLD);
            bottomLayout.Children.Add(lnameEntry);
            bottomLayout.Children.Add(UIUtils.MakeSeparator());

            var continueButton = UIUtils.MakeButton("CONTINUE", UIUtils.FONT_SFUIDISPLAY_REGULAR);

            continueButton.Clicked += OnContinue;
            continueButton.Margin   = new Thickness(0, 40, 0, 0);
            bottomLayout.Children.Add(continueButton);

            bottomLayout.ForceLayout();
            currentStep = 1;
            MakeEntryVisibleWithKeybord(new Entry[] { phoneEntry, addressEntry, emailEntry, pswdEntry, lnameEntry, fnameEntry });
        }
Example #2
0
        private StackLayout MakeAddressBlock()
        {
            var addressACEntry = new AutoCompleteView();

            addressACEntry.WidthRequest = App.ScreenWidth - 40 - 60;
            addressEntry                  = addressACEntry.EntryText;
            addressEntry.Placeholder      = _order.Mua.Location.Address;
            addressEntry.FontFamily       = UIUtils.FONT_SFUIDISPLAY_LIGHT;
            addressEntry.HeightRequest    = 38;
            addressEntry.FontSize         = 15;
            addressEntry.BackgroundColor  = Color.White;
            addressEntry.PlaceholderColor = Color.FromHex("787878");
            addressEntry.TextColor        = Color.Black;
            addressEntry.IsEnabled        = false;
            var sh = new PlaceSearchHelper(addressACEntry);

            sh.OnSelected += (o, p) => { location = p; };

            changeAddressBtn = new CustomLabel {
                Text              = "CHANGE",
                TextColor         = Props.ButtonColor,
                FontSize          = 15,
                FontFamily        = UIUtils.FONT_BEBAS_REGULAR,
                IsVisible         = false,
                HorizontalOptions = LayoutOptions.EndAndExpand,
                VerticalOptions   = LayoutOptions.Center
            };
            changeAddressBtn.GestureRecognizers.Add(new TapGestureRecognizer(v => { ChangeAddress(); }));
            return(new StackLayout {
                Spacing = 0,
                Margin = new Thickness(20, 0, 20, 0),
                Orientation = StackOrientation.Horizontal,
                VerticalOptions = LayoutOptions.CenterAndExpand,
                Children = { addressACEntry, changeAddressBtn }
            });
        }
Example #3
0
        private void BuildLayout()
        {
            main                 = new StackLayout();
            main.Spacing         = 0;
            main.BackgroundColor = Color.White;

            var header = UIUtils.MakeHeader(this, "You");

            main.Children.Add(header);
            main.Children.Add(UIUtils.MakeSeparator(true));

            profileImage                   = new CircleImage();
            profileImage.Source            = _client is Customer ? _client.CustomerImage : ((MuaArtist)_client).ArtistImage;
            profileImage.HorizontalOptions = LayoutOptions.CenterAndExpand;
            profileImage.HeightRequest     = 100;
            profileImage.Aspect            = Aspect.AspectFill;
            profileImage.WidthRequest      = profileImage.HeightRequest;
            profileImage.Margin            = new Thickness(0, 10, 0, 10);
            profileImage.GestureRecognizers.Add(new TapGestureRecognizer(async v => {
                await TakeImage();
                if (profileImage != null)
                {
                    var source          = ImageSource.FromStream(() => photoFile.Source);
                    profileImage.Source = null;
                    profileImage.Source = source;
                }
            }));
            main.Children.Add(profileImage);
            main.Children.Add(UIUtils.MakeSeparator(true));

            firstName      = UIUtils.MakeEntry("First Name", UIUtils.FONT_SFUIDISPLAY_BOLD);
            firstName.Text = _client.FirstName;
            main.Children.Add(firstName);
            main.Children.Add(UIUtils.MakeSeparator());
            lastName      = UIUtils.MakeEntry("Last Name", UIUtils.FONT_SFUIDISPLAY_BOLD);
            lastName.Text = _client.LastName;
            main.Children.Add(lastName);
            main.Children.Add(UIUtils.MakeSeparator());
            //phoneNumber = UIUtils.MakeEntry("Mobile Phone", UIUtils.FONT_SFUIDISPLAY_BOLD);
            //phoneNumber.Keyboard = Keyboard.Telephone;
            //phoneNumber.Text = _client.PhoneNumber;
            //main.Children.Add(phoneNumber);
            //main.Children.Add(UIUtils.MakeSeparator());

            if (_client is MuaArtist)
            {
                var artist = _client as MuaArtist;
                businessName      = UIUtils.MakeEntry("Business Name", UIUtils.FONT_SFUIDISPLAY_BOLD);
                businessName.Text = artist.BusinessName;
                main.Children.Add(businessName);
                main.Children.Add(UIUtils.MakeSeparator());

                aboutMe      = UIUtils.MakeEntry("About Me", UIUtils.FONT_SFUIDISPLAY_BOLD);
                aboutMe.Text = artist.AboutMe;
                main.Children.Add(aboutMe);
                main.Children.Add(UIUtils.MakeSeparator());

                var addressACEntry = new AutoCompleteView();
                address                  = addressACEntry.EntryText;
                address.Text             = artist.Address;
                address.FontFamily       = UIUtils.FONT_SFUIDISPLAY_BOLD;
                address.HeightRequest    = 45;
                address.FontSize         = 17;
                address.BackgroundColor  = Color.White;
                address.Margin           = new Thickness(20, 10, 20, 0);
                address.Placeholder      = "Location/Address";
                address.PlaceholderColor = Color.FromHex("787878");
                address.TextColor        = Color.Black;
                main.Children.Add(addressACEntry);
                main.Children.Add(UIUtils.MakeSeparator());
                var sh = new PlaceSearchHelper(addressACEntry);
                sh.OnSelected += (o, p) => { lastLocation = p; };
            }

            var saveButton = UIUtils.MakeButton("SAVE", UIUtils.FONT_SFUIDISPLAY_MEDIUM);

            saveButton.VerticalOptions = LayoutOptions.EndAndExpand;
            saveButton.Clicked        += OnSaveButtonClicked;
            main.Children.Add(saveButton);

            root = new RelativeLayout();
            root.Children.Add(main, Constraint.Constant(0), Constraint.Constant(0)
                              , Constraint.RelativeToParent(p => p.Width)
                              , Constraint.RelativeToParent(p => p.Height));

            Content = root;
        }
Example #4
0
        private void BuildLocationLayout(StackLayout main)
        {
            var calendar = new Image();

            calendar.Source        = ImageSource.FromResource("TiroApp.Images.calendar.png");
            calendar.HeightRequest = 20;
            calendar.WidthRequest  = 22;
            var placeBackground = new Image();

            placeBackground.Source        = ImageSource.FromResource("TiroApp.Images.searchBackground.png");
            placeBackground.Aspect        = Aspect.Fill;
            placeBackground.HeightRequest = 44;

            var locationACEntry = new AutoCompleteView();

            locationEntry                  = locationACEntry.EntryText;
            locationEntry.FontFamily       = UIUtils.FONT_SFUIDISPLAY_LIGHT;
            locationEntry.WidthRequest     = 250;
            locationEntry.HeightRequest    = 38;
            locationEntry.FontSize         = 16;
            locationEntry.BackgroundColor  = Color.White;
            locationEntry.Placeholder      = "Use current location";
            locationEntry.PlaceholderColor = Color.Black;
            locationEntry.TextColor        = Color.Black;
            locationEntry.Focused         += (o, a) => { locationEntry.Text = ""; };
            var sh = new PlaceSearchHelper(locationACEntry);

            sh.OnSelected += (o, p) =>
            {
                LocationFilter = new LocationFilter()
                {
                    Lat    = p.Latitude,
                    Lon    = p.Longitude,
                    Radius = RADIUS
                };
                LocationAddress = locationEntry.Text;
            };

            var rl = new RelativeLayout();

            rl.Margin            = new Thickness(0, 10, 0, 10);
            rl.WidthRequest      = Device.OnPlatform(300, 320, 300);
            rl.VerticalOptions   = LayoutOptions.Start;
            rl.HorizontalOptions = LayoutOptions.Center;
            rl.Children.Add(placeBackground, Constraint.Constant(0), Constraint.Constant(0),
                            Constraint.RelativeToParent(p => p.Width), Constraint.Constant(placeBackground.HeightRequest));
            rl.Children.Add(calendar, Constraint.Constant(10), Constraint.Constant(10));
            rl.Children.Add(locationACEntry, Constraint.Constant(40), Constraint.Constant(4));
            //heightConstraint: Constraint.Constant(locationEntry.HeightRequest));

            var useCurrLocation = new CustomLabel()
            {
                HorizontalOptions = LayoutOptions.Center,
                Text                    = "Use Current Location",
                TextColor               = Props.ButtonColor,
                BackgroundColor         = Color.White,
                VerticalOptions         = LayoutOptions.Center,
                HorizontalTextAlignment = TextAlignment.Center,
                FontSize                = 17,
                FontFamily              = UIUtils.FONT_SFUIDISPLAY_LIGHT,
            };

            useCurrLocation.GestureRecognizers.Add(new TapGestureRecognizer(LocationClicked));

            main.Children.Add(useCurrLocation);
            main.Children.Add(rl);
            var separator = UIUtils.MakeSeparator(true);

            separator.VerticalOptions = LayoutOptions.Start;
            main.Children.Add(separator);
        }