示例#1
0
        protected override Grid SetupMessageGrid()
        {
            Grid messageGrid = new Grid()
            {
                RowSpacing = 20,
            };

            messageGrid.RowDefinitions.Add(new RowDefinition()
            {
            });

            AutoFontSizeFormattedTextLabel messageLabel = new AutoFontSizeFormattedTextLabel()
            {
                HorizontalTextAlignment = TextAlignment.Center,
                VerticalTextAlignment   = TextAlignment.Center,
                HorizontalOptions       = LayoutOptions.FillAndExpand,
                VerticalOptions         = LayoutOptions.FillAndExpand,
            };

            messageLabel.FormattedText = new FormattedString();

            messageLabel.FormattedText.Spans.Add(new Span()
            {
                Text = "Elige una prueba", FontAttributes = FontAttributes.Bold
            });

            messageGrid.Children.Add(messageLabel, 0, 0);

            return(messageGrid);
        }
示例#2
0
        protected override Grid SetupMessageGrid()
        {
            Grid messageGrid = new Grid()
            {
                RowSpacing = 20,
            };

            messageGrid.RowDefinitions.Add(new RowDefinition()
            {
            });

            AutoFontSizeFormattedTextLabel messageLabel = new AutoFontSizeFormattedTextLabel()
            {
                MinFontSize = 12,
                MaxFontSize = 26,
                //FontSize = 100,
                HorizontalTextAlignment = TextAlignment.Center,
                VerticalTextAlignment   = TextAlignment.Center,
                TextColor         = Configuration.Theme.TextColor,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.FillAndExpand,
            };

            messageLabel.FormattedText = new FormattedString();

            messageLabel.FormattedText.Spans.Add(new Span()
            {
                Text = _challenge.Statement
            });

            messageGrid.Children.Add(messageLabel, 0, 0);

            return(messageGrid);
        }
示例#3
0
        //protected override void OnAppearing()
        //{
        //    emotionalIcon = FormsHelper.ConfigureImageButton($"{ _emotionalStatus.ToString().ToLower() }.png", null, SelectEmotionalStatusPage.EmotionalIconSize); // new Size(85, 85));

        //    //emotionalIcon.VerticalOptions = LayoutOptions.Center;

        //    //emotionalIcon.Margin = new Thickness(0, 20, 0, 0);

        //    //_youHaveChosenContent.Children.Add(emotionalIcon);

        //    //_mainLayout.Children.Add(emotionalIcon, new Rectangle(0.5, 130, 87.7143, 87.7143), AbsoluteLayoutFlags.XProportional);

        //    _mainLayout.Children.Add(emotionalIcon, new Rectangle(0.5, 130, SelectEmotionalStatusPage.EmotionalIconSize.Width, SelectEmotionalStatusPage.EmotionalIconSize.Height), AbsoluteLayoutFlags.XProportional);

        //    base.OnAppearing();
        //}

        protected override Grid SetupMessageGrid()
        {
            Grid messageGrid = new Grid()
            {
                RowSpacing = 20,
            };

            messageGrid.RowDefinitions.Add(new RowDefinition()
            {
                Height = new GridLength(1, GridUnitType.Star)
            });
            messageGrid.RowDefinitions.Add(new RowDefinition()
            {
                Height = new GridLength(80, GridUnitType.Absolute)
            });

            AutoFontSizeFormattedTextLabel messageLabel = new AutoFontSizeFormattedTextLabel()
            {
                HorizontalTextAlignment = TextAlignment.Center,
                VerticalTextAlignment   = TextAlignment.Center,
                //TextColor = Configuration.Theme.TextColor,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.FillAndExpand,
            };

            messageLabel.FormattedText = new FormattedString();

            if (_emotionalStatus == EmotionalStatus.Happy || _emotionalStatus == EmotionalStatus.VeryHappy)
            {
                messageLabel.FormattedText.Spans.Add(new Span()
                {
                    Text = "Genial, ", FontAttributes = FontAttributes.Bold
                });
                messageLabel.FormattedText.Spans.Add(new Span()
                {
                    Text = "nos alegramos de que te sientas bien." + Environment.NewLine + Environment.NewLine + "Vuelve a ejecutar el proceso cuando lo necesites."
                });
            }
            else
            {
                messageLabel.FormattedText.Spans.Add(new Span()
                {
                    Text = "Te recomendamos que vuelvas a intentar el proceso a ver si puedes sentirte un poquito mejor"
                });
            }

            messageGrid.Children.Add(messageLabel, 0, 0);

            Frame itemFrame = new Frame()
            {
                CornerRadius = 10,
                //BackgroundColor = useSelectedColor ? Configuration.Theme.SelectedBackgroundColor : Configuration.Theme.SecondaryBackgroundColor,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.FillAndExpand,
                HasShadow         = true,
                Margin            = new Thickness(10, 0),
            };

            Label itemLabel = new Label()
            {
                //FontSize = Configuration.Theme.MediumFontSize,
                Text = "Volver a empezar",
                //TextColor = useSelectedColor ? Configuration.Theme.SelectedTextColor : Configuration.Theme.TextColor,
                VerticalTextAlignment   = TextAlignment.Center,
                HorizontalTextAlignment = TextAlignment.Center,
                HorizontalOptions       = LayoutOptions.FillAndExpand,
                VerticalOptions         = LayoutOptions.FillAndExpand,
            };

            itemFrame.Content = itemLabel;

            itemFrame.AddTapRecognizer((e, s) => { StartAgainPressed?.Invoke(); });

            Frame itemFrame2 = new Frame()
            {
                CornerRadius = 10,
                //BackgroundColor = useSelectedColor ? Configuration.Theme.SelectedBackgroundColor : Configuration.Theme.SecondaryBackgroundColor,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.FillAndExpand,
                HasShadow         = true,
                Margin            = new Thickness(10, 0),
            };

            Label itemLabel2 = new Label()
            {
                //FontSize = Configuration.Theme.MediumFontSize,
                Text = "Salir",
                //TextColor = useSelectedColor ? Configuration.Theme.SelectedTextColor : Configuration.Theme.TextColor,
                VerticalTextAlignment   = TextAlignment.Center,
                HorizontalTextAlignment = TextAlignment.Center,
                HorizontalOptions       = LayoutOptions.FillAndExpand,
                VerticalOptions         = LayoutOptions.FillAndExpand,
            };

            itemFrame2.Content = itemLabel2;

            itemFrame2.AddTapRecognizer((e, s) => { ExitPressed?.Invoke(); });

            messageGrid.Children.Add(itemFrame, 0, 1);
            messageGrid.Children.Add(itemFrame2, 0, 2);

            return(messageGrid);
        }
        private Grid SetupTitleLayout()
        {
            Grid titleLayout = new Grid()
            {
                HeightRequest = 130,
            };

            titleLayout.RowDefinitions.Add(new RowDefinition()
            {
                Height = new GridLength(1, GridUnitType.Star)
            });
            titleLayout.RowDefinitions.Add(new RowDefinition()
            {
                Height = new GridLength(1, GridUnitType.Star)
            });

            titleLayout.Children.Add(new AutoFontSizeLabel()
            {
                //FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)),
                //FontSize = Configuration.Theme.BigFontSize,
                FontAttributes          = FontAttributes.Bold,
                HorizontalTextAlignment = TextAlignment.Center,
                VerticalTextAlignment   = TextAlignment.Center,
                TextColor = Configuration.Theme.TextColor,
                Text      = _titleText,
            }, 0, 0);

            AutoFontSizeFormattedTextLabel subtitle = new AutoFontSizeFormattedTextLabel()
            {
                HorizontalTextAlignment = TextAlignment.Center,
                VerticalTextAlignment   = TextAlignment.Center,
            };

            subtitle.FormattedText = new FormattedString();

            subtitle.FormattedText.Spans.Add(new Span()
            {
                Text           = "Selecciona",
                TextColor      = Configuration.Theme.TextColor,
                FontAttributes = FontAttributes.Bold,
            });

            subtitle.FormattedText.Spans.Add(new Span()
            {
                Text      = " la opción que más se acerca a tu estado de ánimo",
                TextColor = Configuration.Theme.TextColor,
            });

            titleLayout.Children.Add(subtitle, 0, 1);

            //titleLayout.Children.Add(new HtmlLabel()
            //{
            //    FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)),
            //    //FontSize = Configuration.Theme.MediumFontSize,
            //    HorizontalTextAlignment = TextAlignment.Center,
            //    TextColor = Configuration.Theme.TextColor,
            //    Text = "<b>Selecciona</b> la opción que<br/>más se acerca a tu estado de ánimo",
            //}, 0, 1);

            return(titleLayout);
        }