示例#1
0
        public SearchesTemplate()
        {
            var searchImageWidth  = 20;
            var searchImageHeight = 20;

            var searchLabelHeadingSize = MainPage.PageHeight / 45.636;

            var searchLabelDetailSize = MainPage.PageHeight / 60.636;
            var searchOffset          = 5;

            searchImage = new AppImage
            {
                WidthRequest  = searchImageWidth,
                HeightRequest = searchImageHeight,
                Source        = "clock_gray",
            };

            searchLabelHeading = new AppLabel
            {
                FontSize = searchLabelHeadingSize,
            };

            searchLabelHeading.SetBinding(AppLabel.TextProperty, "searchHeading");

            searchLabelDetail = new AppLabel
            {
                FontSize = searchLabelDetailSize,
                Opacity  = 0.5,
            };

            searchLabelDetail.SetBinding(AppLabel.TextProperty, "searchDetail");

            searchDetailContent = new StackLayout
            {
                VerticalOptions = LayoutOptions.StartAndExpand,
                Spacing         = 0,
                Children        =
                {
                    searchLabelHeading, searchLabelDetail
                }
            };

            var searchLeftOffset = MainPage.PageHeight / 67.342;


            searchFinalContent = new StackLayout
            {
                Padding     = new Thickness(searchLeftOffset, searchOffset, 0, 0),
                Orientation = StackOrientation.Horizontal,
                Children    =
                {
                    searchImage, searchDetailContent
                }
            };

            View = searchFinalContent;
        }
示例#2
0
        private void SetLines()
        {
            AppLabel multiLineLabel = (AppLabel)Element;

            if (multiLineLabel != null && multiLineLabel.Lines != -1)
            {
                Control.SetSingleLine(false);
                Control.SetLines(multiLineLabel.Lines);
            }
        }
示例#3
0
        protected override View CreateContent()
        {
            var searchBarHeight       = MainPage.PageHeight * 0.07;
            var peopleListHeight      = MainPage.PageHeight * 0.15;
            var currentLocationHeight = MainPage.PageHeight * 0.06;
            var placesHeight          = MainPage.PageHeight * 0.20;
            var morePlacesHeight      = MainPage.PageHeight * 0.34;



            var searchImageSize         = MainPage.PageHeight / 25.001;
            var searchContentleftOffset = MainPage.PageHeight / 68.342;
            var searchContenttopOffset  = MainPage.PageHeight / 17.855;

            var addPeopleLabelFontSize    = MainPage.PageHeight / 60.6364;
            var addPeopleImageWidthHeight = MainPage.PageHeight / 18.5;
            var addPeopleConytentWidth    = MainPage.PageHeight / 6.8342;
            // var peopleListHeight = 130;

            var currentLocationImageWidthHeight        = MainPage.PageHeight / 30.171;
            var currentLocationLabelSize               = MainPage.PageHeight / 45.636;
            var currentLocationContentDetailLeftOffset = MainPage.PageHeight / 38.342;
            var currentLocationContentLeftRightOffset  = MainPage.PageHeight / 68.342;

            var placesLabelFontSize = MainPage.PageHeight / 45.636;
            var placesImageWidth    = MainPage.PageHeight / 30.171;
            var placesImageHeight   = MainPage.PageHeight / 30.171;
            var placesOffset        = MainPage.PageHeight / 38.342;

            var placesContentOffset = MainPage.PageHeight / 68.342;

            var searchImageWidth  = MainPage.PageHeight / 30.171;
            var searchImageHeight = MainPage.PageHeight / 30.171;
            var searchOffset      = MainPage.PageHeight / 68.342;

            var morePlacesSearchOffset = MainPage.PageHeight / 32.345;


            #region Page Background
            this.BackgroundColor = Color.LightGray;
            this.Opacity         = 1.0;


            #endregion


            #region Сontent

            #region SearchBar

            var searchEntry = new AppSearchEntryEditor
            {
                ImageSize         = searchImageSize,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                Placeholder       = "Search People and Places",
                WidthRequest      = 280,
                VerticalOptions   = LayoutOptions.CenterAndExpand,
            };


            searchPeopleContent = new StackLayout
            {
                Margin          = new Thickness(searchContentleftOffset, searchContenttopOffset, 10, 0),
                BackgroundColor = Color.White,
                HeightRequest   = searchBarHeight,
                Children        =
                {
                    searchEntry
                }
            };


            #endregion



            #region People List
            var addPeopleLabel = new AppLabel
            {
                FontSize = addPeopleLabelFontSize,
                Text     = "Add People",
                HorizontalTextAlignment = TextAlignment.Center,
                VerticalTextAlignment   = TextAlignment.End,
            };



            var addPeopleImage = new AppImageCommand
            {
                Source        = "plus_gray",
                WidthRequest  = addPeopleImageWidthHeight,
                HeightRequest = addPeopleImageWidthHeight,
            };

            addPeopleImage.SetBinding(AppImageCommand.CommandProperty, "AddPeopleCommand");



            var addPeopleContent = new StackLayout
            {
                HorizontalOptions = LayoutOptions.Start,
                VerticalOptions   = LayoutOptions.Center,
                WidthRequest      = addPeopleConytentWidth,
                Children          =
                {
                    addPeopleImage, addPeopleLabel
                }
            };

            var dataHScroll2 = new HScrollViewCell2Data[] {
                new HScrollViewCell2Data {
                    name = "jamie luna", profileImage = "default_user", strokeColor = Color.Red
                },
                new HScrollViewCell2Data {
                    name = "barde luna", profileImage = "default_user", strokeColor = Color.Yellow
                },
                new HScrollViewCell2Data {
                    name = "gerald luna", profileImage = "default_user"
                },
                new HScrollViewCell2Data {
                    name = "jamie luna", profileImage = "default_user"
                },
                new HScrollViewCell2Data {
                    name = "gerald luna", profileImage = "default_user"
                },
                new HScrollViewCell2Data {
                    name = "barde luna", profileImage = "default_user"
                },
            };



            HorizontalScrollLayout peopleList = new HorizontalScrollLayout
            {
                ItemSource    = dataHScroll2,
                ItemTemplate  = new DataTemplate(typeof(HScrollViewCell2)),
                HeightRequest = 130,
                //WidthRequest = 170,
                SelectionBackGroundColor = Color.FromHex("#0040FF"),
                MultiSelection           = false,
            };



            peopleListContent = new StackLayout
            {
                BackgroundColor = Color.White,
                HeightRequest   = peopleListHeight,
                Orientation     = StackOrientation.Horizontal,
                Children        =
                {
                    addPeopleContent, peopleList
                }
            };



            #endregion


            #region CurrentLocation


            currentLocationImage = new AppImageCommand
            {
                Source        = "map_gray",
                HeightRequest = currentLocationImageWidthHeight,
                WidthRequest  = currentLocationImageWidthHeight,
            };

            currentLocationImage.SetBinding(AppImageCommand.CommandProperty, "CurrentLocationCommand");

            currentLocationLabel = new AppLabel
            {
                Text = "Current Location",
                VerticalTextAlignment = TextAlignment.Center,
                FontSize = currentLocationLabelSize,
            };



            currentLocationContentDetails = new StackLayout
            {
                Orientation     = StackOrientation.Horizontal,
                VerticalOptions = LayoutOptions.CenterAndExpand,
                Padding         = new Thickness(currentLocationContentDetailLeftOffset, 0, 0, 0),
                Children        =
                {
                    currentLocationImage, currentLocationLabel
                }
            };


            currentLocationContent = new StackLayout
            {
                Margin          = new Thickness(currentLocationContentLeftRightOffset, 0, currentLocationContentLeftRightOffset, 0),
                BackgroundColor = Color.White,
                HeightRequest   = currentLocationHeight,
                Children        =
                {
                    currentLocationContentDetails
                }
            };

            #endregion

            #region  Places

            schoolImage = new AppImage
            {
                Source        = "star_gray",
                HeightRequest = placesImageHeight,
                WidthRequest  = placesImageHeight,
            };

            schoolLabel = new AppLabel
            {
                Text = "School",
                VerticalTextAlignment = TextAlignment.Center,
                FontSize = placesLabelFontSize,
            };

            schoolContent = new StackLayout
            {
                Orientation = StackOrientation.Horizontal,
                Children    =
                {
                    schoolImage, schoolLabel
                }
            };

            homeLabel = new AppLabel
            {
                Text = "Home",
                VerticalTextAlignment = TextAlignment.Center,
                FontSize = placesLabelFontSize,
            };

            homeImage = new AppImage
            {
                Source        = "star_gray",
                HeightRequest = placesImageHeight,
                WidthRequest  = placesImageWidth,
            };

            homeContent = new StackLayout
            {
                Orientation = StackOrientation.Horizontal,
                Children    =
                {
                    homeImage, homeLabel
                }
            };

            workLabel = new AppLabel
            {
                Text = "Work",
                VerticalTextAlignment = TextAlignment.Center,
                FontSize = placesLabelFontSize,
            };

            workImage = new AppImage
            {
                Source        = "star_gray",
                HeightRequest = placesImageHeight,
                WidthRequest  = placesImageWidth,
            };

            workContent = new StackLayout
            {
                Orientation = StackOrientation.Horizontal,
                Children    =
                {
                    workImage, workLabel
                }
            };


            moreStarredPlacesLabel = new AppTextCommand
            {
                Text = "More Starred Places",
                VerticalTextAlignment = TextAlignment.Center,
                FontSize = placesLabelFontSize,
            };

            moreStarredPlacesLabel.SetBinding(AppCommand.TextProperty, new Binding("MoreStarredPlaces", BindingMode.OneWay, null, null, null, AppLanguages.CurrentLanguage));

            moreStarredPlacesLabel.SetBinding(AppTextCommand.CommandProperty, "MoreStarredPlacesCommand");



            moreStarredPlacesImage = new AppImage
            {
                Source        = "star_gray",
                HeightRequest = placesImageHeight,
                WidthRequest  = placesImageWidth,
            };

            moreStarredPlacesContent = new StackLayout
            {
                Orientation = StackOrientation.Horizontal,
                Children    =
                {
                    moreStarredPlacesImage, moreStarredPlacesLabel
                }
            };


            placesWrapperContent = new StackLayout
            {
                Padding  = new Thickness(placesOffset, placesContentOffset, 0, 0),
                Children =
                {
                    schoolContent, homeContent, workContent, moreStarredPlacesContent
                }
            };

            placesContent = new StackLayout
            {
                Margin          = new Thickness(placesContentOffset, 0, placesContentOffset, 0),
                BackgroundColor = Color.White,
                HeightRequest   = placesHeight,
                Children        =
                {
                    placesWrapperContent
                }
            };

            #endregion


            #region Search



            searchListView = new ListView
            {
                Margin         = new Thickness(searchOffset, 0, searchOffset, 0),
                HasUnevenRows  = true,
                ItemTemplate   = new DataTemplate(typeof(SearchesTemplate)),
                ItemsSource    = SearchData.GetData(),
                SeparatorColor = Color.White,
            };

            searchListView.HasUnevenRows = true;



            morePreviousSerchesImage = new AppImage
            {
                Source        = "clock_gray",
                WidthRequest  = searchImageWidth,
                HeightRequest = searchImageHeight,
            };

            morePreviousSearchesLabel = new AppTextCommand
            {
                Text = "More Previous Searches"
            };

            morePreviousSearchesLabel.SetBinding(AppTextCommand.CommandProperty, "MoreStarredPlacesCommand");

            morePreviousSearchesContent = new StackLayout
            {
                Padding     = new Thickness(morePlacesSearchOffset, 0, 0, searchOffset),
                Orientation = StackOrientation.Horizontal,
                Children    =
                {
                    morePreviousSerchesImage, morePreviousSearchesLabel
                }
            };



            searchContent = new StackLayout
            {
                Margin          = new Thickness(searchOffset, 0, searchOffset, 0),
                BackgroundColor = Color.White,
                HeightRequest   = morePlacesHeight,
                Children        =
                {
                    searchListView, morePreviousSearchesContent
                }
            };



            #endregion

            finalContent = new StackLayout
            {
                Spacing = searchOffset,

                Children =
                {
                    searchPeopleContent, peopleListContent, currentLocationContent, placesContent, searchContent
                }
            };


            #endregion



            _scroll = new ScrollView
            {
                HorizontalOptions = LayoutOptions.Fill,
                VerticalOptions   = LayoutOptions.Fill,
                Content           = finalContent
            };

            return(_scroll);
        }
示例#4
0
        protected override View CreateContent()
        {
            var logoWidth     = MainPage.PageWidth / 4.4366;
            var logoHeight    = MainPage.PageHeight / 7.3297;
            var logoTopOffset = MainPage.PageHeight / 6.0636;

            var welcomeTextOffset = MainPage.PageHeight / 17.1026;

            var emailHeight    = MainPage.PageHeight / 7.0211;
            var passwordHeight = MainPage.PageHeight / 8.2346;

            var errorHeight       = MainPage.PageHeight / 12.5849;
            var errorBottomOffset = MainPage.PageHeight / 60.6363;
            var forgotTopOffset   = MainPage.PageHeight / 95.2857;
            var signUpTopOffset   = MainPage.PageHeight / 11.9107;

            var textFontSize      = MainPage.PageHeight / 60.6364;
            var entryFontSize     = MainPage.PageHeight / 39.2353;
            var signUpFontSize    = MainPage.PageHeight / 55.5833;
            var horizontalPadding = MainPage.PageWidth / 7.8125;

            var color            = Color.White;
            var placeholderColor = Color.White;
            var errorColor       = Color.White; // Color.FromHex("#E27A73");
            var commandColor     = Color.FromHex("#61A8A1");

            var imageSize   = MainPage.PageWidth / 17.0455;
            var imageOffset = imageSize / 2;

            #region Logo
            var logo = new Image
            {
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.Start,
                WidthRequest      = logoWidth,
                HeightRequest     = logoHeight,
                Source            = "logo"
            };

            var logoContent = new ContentView
            {
                HorizontalOptions = LayoutOptions.Fill,
                VerticalOptions   = LayoutOptions.Start,
                Padding           = new Thickness(0, logoTopOffset, 0, 0),
                Content           = logo
            };
            #endregion

            #region Welcome
            var welcome = new AppLabel
            {
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.Start,
                AppFont           = AppFonts.Quicksand,
                FontSize          = MainPage.PageHeight / 39.2353,
                TextColor         = Color.White
            };
            welcome.SetBinding(AppLabel.TextProperty, new Binding("LoginPanelWelcomeText", BindingMode.OneWay, null, null, null, AppLanguages.CurrentLanguage));

            var welcomeContent = new ContentView
            {
                HorizontalOptions = LayoutOptions.Fill,
                VerticalOptions   = LayoutOptions.Start,
                Padding           = new Thickness(0, welcomeTextOffset, 0, 0),
                Content           = welcome
            };
            #endregion

            #region Сontent
            #region Email
            _email = new AppEntryEditor
            {
                HorizontalOptions = LayoutOptions.Fill,
                VerticalOptions   = LayoutOptions.Fill,
                HeightRequest     = emailHeight,
                AppFont           = AppFonts.Quicksand,
                FontSize          = entryFontSize,
                TextColor         = color,
                ErrorTextColor    = errorColor,
                PlaceholderColor  = placeholderColor,
                ImageSource       = "email_white",
                ErrorImageSource  = "email_red",
                ImageSize         = imageSize,
                ImageOffset       = imageOffset,
                Keyboard          = Keyboard.Email
            };
            _email.SetBinding(AppEntryEditor.TextProperty, "Email", BindingMode.TwoWay);
            _email.SetBinding(AppEntryEditor.PlaceholderProperty, new Binding("LoginPanelEmailPlaceholderText", BindingMode.OneWay, null, null, null, AppLanguages.CurrentLanguage));
            _email.SetBinding(AppEntryEditor.IsErrorProperty, "IsErrorEmail");
            #endregion

            #region Password
            _password = new AppEntryEditor
            {
                HorizontalOptions = LayoutOptions.Fill,
                VerticalOptions   = LayoutOptions.Fill,
                HeightRequest     = passwordHeight,
                AppFont           = AppFonts.Quicksand,
                FontSize          = entryFontSize,
                TextColor         = color,
                ErrorTextColor    = errorColor,
                PlaceholderColor  = placeholderColor,
                ImageSource       = "lock_white",
                ErrorImageSource  = "lock_red",
                ImageSize         = imageSize,
                ImageOffset       = imageOffset,
                Keyboard          = Keyboard.Default,
                IsPassword        = true
            };
            _password.SetBinding(AppEntryEditor.TextProperty, "Password", BindingMode.TwoWay);
            _password.SetBinding(AppEntryEditor.PlaceholderProperty, new Binding("LoginPanelPasswordPlaceholderText", BindingMode.OneWay, null, null, null, AppLanguages.CurrentLanguage));
            _password.SetBinding(AppEntryEditor.IsErrorProperty, "IsErrorPassword");
            #endregion

            #region Error
            var error = new AppLabel
            {
                HorizontalOptions       = LayoutOptions.Center,
                VerticalOptions         = LayoutOptions.End,
                HorizontalTextAlignment = TextAlignment.Center,
                AppFont   = AppFonts.Quicksand,
                FontSize  = MainPage.PageHeight / 39.2353,
                TextColor = errorColor
            };
            error.SetBinding(AppLabel.TextProperty, "ErrorText");
            error.SetBinding(AppLabel.IsVisibleProperty, "IsError");

            var errorContent = new ContentView
            {
                HorizontalOptions = LayoutOptions.Fill,
                VerticalOptions   = LayoutOptions.Start,
                HeightRequest     = errorHeight,
                Padding           = new Thickness(0, 0, 0, errorBottomOffset),
                Content           = error
            };
            #endregion

            #region LogIn
            _logIn = new AppButton
            {
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.Start,
                WidthRequest      = MainPage.PageWidth / 1.2458,
                HeightRequest     = MainPage.PageHeight / 11.7018,
                FontSize          = MainPage.PageHeight / 39.2353
            };
            _logIn.SetBinding(AppButton.TextProperty, new Binding("LoginPanelLogInButtonText", BindingMode.OneWay, null, null, null, AppLanguages.CurrentLanguage));
            _logIn.SetBinding(AppButton.CommandProperty, "LogInCommand");

            var logInContent = new ContentView
            {
                HorizontalOptions = LayoutOptions.Fill,
                VerticalOptions   = LayoutOptions.Start,
                Content           = _logIn
            };
            #endregion

            #region Forgot Password
            var forgot = new AppCommand
            {
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.Start,
                AppFont           = AppFonts.Quicksand,
                IsUnderline       = true,
                FontSize          = 14,
                TextColor         = commandColor,
                DisableTextColor  = commandColor
            };
            forgot.SetBinding(AppCommand.TextProperty, new Binding("LoginPanelForgotCommandText", BindingMode.OneWay, null, null, null, AppLanguages.CurrentLanguage));
            forgot.SetBinding(AppCommand.CommandProperty, "ForgotCommand");

            var forgotContent = new ContentView
            {
                HorizontalOptions = LayoutOptions.Fill,
                VerticalOptions   = LayoutOptions.Start,
                Padding           = new Thickness(0, forgotTopOffset, 0, 0),
                Content           = forgot
            };
            #endregion

            #region SignUp
            var signUp = new AppCommand
            {
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.Start,
                AppFont           = AppFonts.Quicksand,
                IsUnderline       = true,
                FontSize          = 14,
                TextColor         = commandColor,
                DisableTextColor  = commandColor
            };
            signUp.SetBinding(AppCommand.TextProperty, new Binding("LoginPanelSignUpCommandText", BindingMode.OneWay, null, null, null, AppLanguages.CurrentLanguage));
            signUp.SetBinding(AppCommand.CommandProperty, "SignUpCommand");

            var signUpContent = new ContentView
            {
                HorizontalOptions = LayoutOptions.Fill,
                VerticalOptions   = LayoutOptions.Start,
                Padding           = new Thickness(0, signUpTopOffset, 0, 0),
                Content           = signUp
            };
            #endregion

            var content = new Grid
            {
                HorizontalOptions = LayoutOptions.Fill,
                VerticalOptions   = LayoutOptions.Start,
                Padding           = new Thickness(horizontalPadding, 0, horizontalPadding, 0),
                RowSpacing        = 0,
                ColumnSpacing     = 0,
                RowDefinitions    =
                {
                    new RowDefinition {
                        Height = new GridLength(1, GridUnitType.Auto)
                    },
                    new RowDefinition {
                        Height = new GridLength(1, GridUnitType.Auto)
                    },
                    new RowDefinition {
                        Height = new GridLength(1, GridUnitType.Auto)
                    },
                    new RowDefinition {
                        Height = new GridLength(1, GridUnitType.Auto)
                    },
                    new RowDefinition {
                        Height = new GridLength(1, GridUnitType.Auto)
                    },
                    new RowDefinition {
                        Height = new GridLength(1, GridUnitType.Auto)
                    }
                }
            };
            content.Children.Add(_email, 0, 0);
            content.Children.Add(_password, 0, 1);
            content.Children.Add(errorContent, 0, 2);
            content.Children.Add(logInContent, 0, 3);
            content.Children.Add(forgotContent, 0, 4);
            content.Children.Add(signUpContent, 0, 5);
            #endregion

            var grid = new Grid
            {
                HorizontalOptions = LayoutOptions.Fill,
                VerticalOptions   = LayoutOptions.Start,
                RowSpacing        = 0,
                ColumnSpacing     = 0,
                RowDefinitions    =
                {
                    new RowDefinition {
                        Height = new GridLength(1, GridUnitType.Auto)
                    },
                    new RowDefinition {
                        Height = new GridLength(1, GridUnitType.Auto)
                    },
                    new RowDefinition {
                        Height = new GridLength(1, GridUnitType.Auto)
                    }
                }
            };
            grid.Children.Add(logoContent, 0, 0);
            grid.Children.Add(welcomeContent, 0, 1);
            grid.Children.Add(content, 0, 2);

            _email.Completed += (sender, args) => {
                _password.SetFocus();
            };

            _password.Completed += (sender, args) => {
                if ((_logIn.Command != null) && (_logIn.Command.CanExecute(_logIn.CommandParameter)))
                {
                    _logIn.Command.Execute(_logIn.CommandParameter);
                }
            };

            _scroll = new ScrollView
            {
                HorizontalOptions = LayoutOptions.Fill,
                VerticalOptions   = LayoutOptions.Fill,
                Content           = grid
            };

            return(_scroll);
        }
        protected override View CreateContent()
        {
            this.BackgroundColor = Color.White;


            var navigationContentHeight = MainPage.PageHeight * 0.1;
            var mainLabelContentHeight  = MainPage.PageHeight * 0.3;
            var placesContentHeight     = MainPage.PageHeight * 0.38;
            var bottomMenuHeight        = MainPage.PageHeight * 0.18;


            var navigationTopOffset     = MainPage.PageHeight / 68.342;
            var navigationLabelFontSize = MainPage.PageHeight / 56.951;
            var arrowWidth  = MainPage.PageHeight / 34.171;
            var arrowHeight = MainPage.PageHeight / 34.171;

            var plusWidth         = MainPage.PageHeight / 34.171;
            var plusHeight        = MainPage.PageHeight / 34.171;
            var navigationPadding = MainPage.PageHeight / 68.342;


            var mainLabelFontSize  = MainPage.PageHeight / 45.561;
            var mainLabelTopOffset = MainPage.PageHeight / 68.342;
            var mainLabelPadding   = MainPage.PageHeight / 34.171;


            var placesListLabelFontSize = MainPage.PageHeight / 45.561;
            var placesListTopOffset     = MainPage.PageHeight / 34.171;

            var placesListImageHeight = MainPage.PageHeight / 45.561;
            var placesListImageWidth  = MainPage.PageHeight / 45.561;
            var placesListFontSize    = MainPage.PageHeight / 45.561;


            var bottomMenuIconHeight       = MainPage.PageHeight * 0.13;
            var bottomMenuIconWidth        = MainPage.PageWidth * 0.25;
            var bottomMenuIconBottomOffset = MainPage.PageHeight / 136.684;

            var bottomMenuImageHeight    = MainPage.PageHeight / 22.780;
            var bottomMenuImageWidth     = MainPage.PageWidth * 0.10;
            var bottomMenuImageTopOffset = MainPage.PageHeight * 0.03;

            var bottomMenuContentTopOffset = -MainPage.PageHeight * 0.09;

            var bottomMenuBackgroundImageHeight = MainPage.PageHeight * 0.10;
            var bottomMenuBackgroundImageWidth  = MainPage.PageWidth * 0.70;



            #region TopNavigationBar


            var arrow = new AppImageCommand
            {
                WidthRequest  = arrowWidth,
                HeightRequest = arrowHeight,
                Source        = "back"
            };

            arrow.SetBinding(AppImageCommand.CommandProperty, "BackCommand");

            var arrowContent = new ContentView
            {
                HorizontalOptions = LayoutOptions.StartAndExpand,
                VerticalOptions   = LayoutOptions.End,

                //Padding = new Thickness(0, navigationTopOffset, 0, 0),
                Content = arrow
            };

            var navigationLabel = new AppLabel
            {
                AppFont               = AppFonts.Quicksand,
                FontSize              = navigationLabelFontSize,
                TextColor             = Color.White,
                VerticalTextAlignment = TextAlignment.Center
            };
            navigationLabel.SetBinding(AppLabel.TextProperty, new Binding("StarredPlacesNavigationTitleText", BindingMode.OneWay, null, null, null, AppLanguages.CurrentLanguage));


            var navigationLabelContent = new ContentView
            {
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                VerticalOptions   = LayoutOptions.End,

                //Padding = new Thickness(0, navigationTopOffset, 0, 0),
                Content = navigationLabel
            };

            var plus = new AppImageCommand
            {
                WidthRequest  = plusWidth,
                HeightRequest = plusHeight,
                Source        = "plus_gray"
            };

            plus.SetBinding(AppImageCommand.CommandProperty, "plusCommand");

            var plusContent = new ContentView
            {
                HorizontalOptions = LayoutOptions.EndAndExpand,
                //Padding = new Thickness(0, navigationTopOffset, 0, 0),
                Content         = plus,
                VerticalOptions = LayoutOptions.End,
            };

            var navigationContent = new StackLayout
            {
                BackgroundColor = Color.FromHex("#1BA4A8"),
                HeightRequest   = navigationContentHeight,
                Padding         = new Thickness(0, 0, 0, navigationPadding),
                Orientation     = StackOrientation.Horizontal,

                //Margin = new Thickness(0, 20, 0, 0),
                Children =
                {
                    arrowContent, navigationLabelContent, plusContent
                }
            };


            #endregion

            #region MainText

            var mainLabel = new AppLabel
            {
                HorizontalOptions       = LayoutOptions.Center,
                VerticalOptions         = LayoutOptions.CenterAndExpand,
                HorizontalTextAlignment = TextAlignment.Center,
                AppFont   = AppFonts.Quicksand,
                FontSize  = mainLabelFontSize,
                TextColor = Color.White
            };
            mainLabel.SetBinding(AppLabel.TextProperty, new Binding("StarredPlacesMainText", BindingMode.OneWay, null, null, null, AppLanguages.CurrentLanguage));


            var mainLabelContent = new StackLayout
            {
                BackgroundColor = Color.FromHex("#32848B"),
                HeightRequest   = mainLabelContentHeight,

                Padding  = new Thickness(mainLabelPadding, 0, mainLabelPadding, 0),
                Children =
                {
                    mainLabel
                }
            };


            #endregion



            #region Places List

            var placeListLabel = new AppLabel
            {
                HorizontalOptions = LayoutOptions.Start,
                VerticalOptions   = LayoutOptions.Start,
                AppFont           = AppFonts.Quicksand,
                FontSize          = placesListLabelFontSize,
            };
            placeListLabel.SetBinding(AppLabel.TextProperty, new Binding("StarredPlacesListTitleText", BindingMode.OneWay, null, null, null, AppLanguages.CurrentLanguage));


            var placeListContent = new StackLayout
            {
                HeightRequest = 20,
                //Padding = new Thickness(10, 0, 0, 0),
                Children =
                {
                    placeListLabel
                }
            };

            var schoolImage = new AppImage
            {
                Source        = "star_gray",
                HeightRequest = placesListImageHeight,
                WidthRequest  = placesListImageWidth,
            };

            var schoolLabel = new AppLabel
            {
                Text = "School",
                VerticalTextAlignment = TextAlignment.Center,
                FontSize = placesListFontSize,
            };

            var schoolContent = new StackLayout
            {
                Orientation = StackOrientation.Horizontal,
                Children    =
                {
                    schoolImage, schoolLabel
                }
            };

            var homeLabel = new AppLabel
            {
                Text = "Home",
                VerticalTextAlignment = TextAlignment.Center,
                FontSize = placesListFontSize,
            };

            var homeImage = new AppImage
            {
                Source        = "star_gray",
                HeightRequest = placesListImageHeight,
                WidthRequest  = placesListImageWidth,
            };

            var homeContent = new StackLayout
            {
                Orientation = StackOrientation.Horizontal,
                Children    =
                {
                    homeImage, homeLabel
                }
            };

            var workLabel = new AppLabel
            {
                Text = "Work",
                VerticalTextAlignment = TextAlignment.Center,
                FontSize = placesListFontSize,
            };

            var workImage = new AppImage
            {
                Source        = "star_gray",
                HeightRequest = placesListImageHeight,
                WidthRequest  = placesListImageWidth,
            };

            var workContent = new StackLayout
            {
                Orientation = StackOrientation.Horizontal,
                Children    =
                {
                    workImage, workLabel
                }
            };



            var addStarredPlacesLabel = new AppLabel
            {
                VerticalTextAlignment = TextAlignment.Center,
                FontSize = placesListLabelFontSize,

                AppFont = AppFonts.Quicksand,
            };
            addStarredPlacesLabel.SetBinding(AppLabel.TextProperty, new Binding("AddStarredPlacesLabel", BindingMode.OneWay, null, null, null, AppLanguages.CurrentLanguage));



            var addStarredPlacesImage = new AppImageCommand
            {
                Source        = "plus_gray",
                HeightRequest = placesListImageHeight,
                WidthRequest  = placesListImageWidth,
            };

            addStarredPlacesImage.SetBinding(AppImageCommand.CommandProperty, "AddStarredPlacesCommand");

            var addStarredPlacesContent = new StackLayout
            {
                Orientation = StackOrientation.Horizontal,
                Children    =
                {
                    addStarredPlacesImage, addStarredPlacesLabel
                }
            };


            var placesWrapperContent = new StackLayout
            {
                BackgroundColor = Color.White,

                Children =
                {
                    placeListContent, schoolContent, homeContent, workContent, addStarredPlacesContent
                }
            };

            var placesContent = new StackLayout
            {
                Padding = new Thickness(placesListTopOffset, placesListTopOffset, 0, 0),

                HeightRequest = placesContentHeight,
                Children      =
                {
                    placesWrapperContent
                }
            };


            #endregion



            #region  Bottom menu


            var icon = new AppImage
            {
                Source        = "emergency",
                HeightRequest = bottomMenuIconHeight,
                WidthRequest  = bottomMenuIconWidth,
            };

            var iconContent = new StackLayout
            {
                Padding           = new Thickness(0, 0, 0, bottomMenuIconBottomOffset),
                HorizontalOptions = LayoutOptions.Start,
                Orientation       = StackOrientation.Horizontal,
                Children          =
                {
                    icon
                }
            };

            var group = new AppImageCommand
            {
                Source        = "profile_gray",
                HeightRequest = bottomMenuImageHeight,
                WidthRequest  = bottomMenuImageWidth,
            };

            group.SetBinding(AppImageCommand.CommandProperty, "profileCommand");

            var groupContent = new StackLayout
            {
                VerticalOptions = LayoutOptions.EndAndExpand,
                Children        =
                {
                    group
                }
            };


            var location = new AppImageCommand
            {
                Source        = "home",
                HeightRequest = bottomMenuImageHeight,
                WidthRequest  = bottomMenuImageWidth,
            };

            location.SetBinding(AppImageCommand.CommandProperty, "locationCommand");

            var locationContent = new StackLayout
            {
                VerticalOptions = LayoutOptions.EndAndExpand,
                Children        =
                {
                    location
                }
            };

            var notification = new AppImageCommand
            {
                Source        = "bell_gray",
                HeightRequest = bottomMenuImageHeight,
                WidthRequest  = bottomMenuImageWidth,
            };

            notification.SetBinding(AppImageCommand.CommandProperty, "notificationCommand");

            var notificationContent = new StackLayout
            {
                VerticalOptions = LayoutOptions.EndAndExpand,
                Children        =
                {
                    notification
                }
            };

            var menuIcon = new AppImageCommand
            {
                Source        = "account_green",
                HeightRequest = bottomMenuImageHeight,

                WidthRequest = bottomMenuImageWidth,
            };

            menuIcon.SetBinding(AppImageCommand.CommandProperty, "menuCommand");

            var menuIconContent = new StackLayout
            {
                VerticalOptions = LayoutOptions.EndAndExpand,
                Children        =
                {
                    menuIcon
                }
            };

            var menuBackground = new Image
            {
                Aspect = Aspect.Fill,

                HeightRequest = bottomMenuBackgroundImageHeight,
                Source        = "Menu_Background"
            };

            var menuBackgroundContent = new StackLayout
            {
                VerticalOptions = LayoutOptions.EndAndExpand,
                Children        =
                {
                    menuBackground
                }
            };

            var bottomMenuContent = new StackLayout
            {
                Spacing           = 40,
                Padding           = new Thickness(0, 0, 10, 10),
                HorizontalOptions = LayoutOptions.EndAndExpand,
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                Orientation       = StackOrientation.Horizontal,
                HeightRequest     = bottomMenuHeight,
                Children          =
                {
                    groupContent, locationContent, notificationContent, menuIconContent
                }
            };

            var menuContent = new Grid
            {
                HeightRequest = 50,
                WidthRequest  = 360,

                HorizontalOptions = LayoutOptions.Fill,
                VerticalOptions   = LayoutOptions.End,
                RowSpacing        = 0,
                ColumnSpacing     = 0
            };
            menuContent.Children.Add(menuBackground);
            menuContent.Children.Add(bottomMenuContent);



            var menuContentFinal = new StackLayout
            {
                Spacing = -43,

                VerticalOptions = LayoutOptions.End,
                Orientation     = StackOrientation.Horizontal,
                Children        =
                {
                    iconContent, menuContent
                }
            };

            #endregion


            #region  Places



            var finalContent = new StackLayout
            {
                VerticalOptions = LayoutOptions.End,
                Spacing         = 0,
                Children        =
                {
                    navigationContent, mainLabelContent, placesContent, menuContentFinal
                }
            };


            #endregion



            _scroll = new ScrollView
            {
                HorizontalOptions = LayoutOptions.Fill,
                VerticalOptions   = LayoutOptions.Fill,
                Content           = finalContent
            };

            return(_scroll);
        }
示例#6
0
        protected override View CreateContent()
        {
            var logoWidth     = MainPage.PageWidth / 4.4366;
            var logoHeight    = MainPage.PageHeight / 7.3297;
            var logoTopOffset = MainPage.PageHeight / 6.0636;

            var welcomeTextOffset = MainPage.PageHeight / 17.1026;

            var buttonsOffset = MainPage.PageHeight / 6.2925;

            var facebookSize    = MainPage.PageHeight / 26.6800;
            var facebookHOffset = MainPage.PageWidth / 5.0000;

            #region Logo
            var logo = new Image
            {
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.Start,
                WidthRequest      = logoWidth,
                HeightRequest     = logoHeight,
                Source            = "logo"
            };

            var logoContent = new ContentView
            {
                HorizontalOptions = LayoutOptions.Fill,
                VerticalOptions   = LayoutOptions.Start,
                Padding           = new Thickness(0, logoTopOffset, 0, 0),
                Content           = logo
            };
            #endregion

            #region Welcome
            var welcome = new AppLabel
            {
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.Start,
                AppFont           = AppFonts.Quicksand,
                FontSize          = MainPage.PageHeight / 39.2353,
                TextColor         = Color.White
            };
            welcome.SetBinding(AppLabel.TextProperty, new Binding("StartPanelWelcomeText", BindingMode.OneWay, null, null, null, AppLanguages.CurrentLanguage));

            var welcomeContent = new ContentView
            {
                HorizontalOptions = LayoutOptions.Fill,
                VerticalOptions   = LayoutOptions.Start,
                Padding           = new Thickness(0, welcomeTextOffset, 0, 0),
                Content           = welcome
            };
            #endregion

            #region Buttons
            var logIn = new AppButton
            {
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.Start,
                WidthRequest      = MainPage.PageWidth / 1.2458,
                HeightRequest     = MainPage.PageHeight / 11.7018,
                FontSize          = MainPage.PageHeight / 39.2353
            };
            logIn.SetBinding(AppButton.TextProperty, new Binding("StartPanelLogInButtonText", BindingMode.OneWay, null, null, null, AppLanguages.CurrentLanguage));
            logIn.SetBinding(AppButton.CommandProperty, "LogInCommand");

            var createAccount = new AppButton
            {
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.Start,
                WidthRequest      = MainPage.PageWidth / 1.2458,
                HeightRequest     = MainPage.PageHeight / 11.7018,
                FontSize          = MainPage.PageHeight / 39.2353
            };
            createAccount.SetBinding(AppButton.TextProperty, new Binding("StartPanelCreateAccountButtonText", BindingMode.OneWay, null, null, null, AppLanguages.CurrentLanguage));
            createAccount.SetBinding(AppButton.CommandProperty, "CreateAccountCommand");

            var facebookLogin = new AppButton
            {
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.Start,
                AppButtonStyle    = AppButtonStyles.Facebook,
                Image             = "facebook_white",
                WidthRequest      = MainPage.PageWidth / 1.2458,
                HeightRequest     = MainPage.PageHeight / 11.7018,
                FontSize          = MainPage.PageHeight / 39.2353
            };
            facebookLogin.SetBinding(AppButton.TextProperty, new Binding("StartPanelFacebookLoginButtonText", BindingMode.OneWay, null, null, null, AppLanguages.CurrentLanguage));
            facebookLogin.SetBinding(AppButton.CommandProperty, "FacebookLoginCommand");

            var buttons = new StackLayout
            {
                HorizontalOptions = LayoutOptions.Fill,
                VerticalOptions   = LayoutOptions.Start,
                Spacing           = MainPage.PageHeight / 29,
                Padding           = new Thickness(0, buttonsOffset, 0, 0)
            };
            buttons.Children.Add(logIn);
            buttons.Children.Add(createAccount);
            buttons.Children.Add(facebookLogin);
            #endregion

            var grid = new Grid
            {
                HorizontalOptions = LayoutOptions.Fill,
                VerticalOptions   = LayoutOptions.Fill,
                RowSpacing        = 0,
                ColumnSpacing     = 0,
                RowDefinitions    =
                {
                    new RowDefinition {
                        Height = new GridLength(1, GridUnitType.Auto)
                    },
                    new RowDefinition {
                        Height = new GridLength(1, GridUnitType.Auto)
                    },
                    new RowDefinition {
                        Height = new GridLength(1, GridUnitType.Auto)
                    }
                }
            };
            grid.Children.Add(logoContent, 0, 0);
            grid.Children.Add(welcomeContent, 0, 1);
            grid.Children.Add(buttons, 0, 2);

            return(grid);
        }
示例#7
0
 private void SetLines()
 {
     AppLabel multiLineLabel = (AppLabel)Element;
     if (multiLineLabel != null && multiLineLabel.Lines != -1)
         Control.Lines = multiLineLabel.Lines;
 }