Example #1
0
        public LayoutAmigos()
        {
            this.BackgroundColor = Color.White;
            this.Padding = new Thickness (3, 3, 3, 3);

            string foto = new Fotos ().fotoaleatoria();

            var imgfoto = new Image () {
                Source = ImageSource.FromResource (foto),
                Aspect = Aspect.AspectFill
            };

            this.Children.Add (imgfoto,
                Constraint.Constant (0),
                Constraint.Constant (2),
                Constraint.RelativeToParent ((Parent) => {
                    return 50;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 50;
                }));

            StackLayout labeltit = new StackLayout ();

            Label label = new Label () {
                FontSize=12
            };
            label.HorizontalOptions = LayoutOptions.FillAndExpand;
            label.XAlign = TextAlignment.Start;

            var fs = new FormattedString ();

            Span sp1 = new Span () {
                Text = "Jonatahan Ivan Vargas Gómez",
                FontAttributes = FontAttributes.Bold,
                FontSize=12
            };
            fs.Spans.Add (sp1);
            label.FormattedText = fs;
            labeltit.Children.Add (label);

            this.Children.Add (labeltit,
                Constraint.Constant (55),
                Constraint.Constant (2),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width - 55;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 50;
                }));

            ExtendedButton btnconfirmar = new ExtendedButton () {
                Text = "Confirmar",
                TextColor = Color.White,
                BackgroundColor = Color.FromRgb(96, 178, 54)
            };

            this.Children.Add (btnconfirmar,
                Constraint.Constant (55),
                Constraint.Constant (20),
                Constraint.RelativeToParent ((Parent) => {
                    return (Parent.Width - 55)/2-10;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 30;
                }));

            ExtendedButton btneliminar = new ExtendedButton () {
                Text = "Eliminar",
                TextColor = Color.White,
                BackgroundColor = Color.FromRgb(96, 178, 54)
            };

            this.Children.Add (btneliminar,
                Constraint.RelativeToParent ((Parent) => {
                    return (Parent.Width - 55)/2+55;
                }),
                Constraint.Constant (20),
                Constraint.RelativeToParent ((Parent) => {
                    return (Parent.Width - 55)/2-10;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 30;
                }));
        }
        public layoutminicomentario()
        {
            string foto = new Fotos ().fotoaleatoria();

            this.BackgroundColor = Color.FromRgb (190, 190, 190);

            this.Padding = new Thickness (3, 3, 3, 3);
            var imgfoto = new Image () {
                Source = ImageSource.FromResource (foto),
                Aspect = Aspect.AspectFill
            };

            this.Children.Add (imgfoto,
                Constraint.Constant (2),
                Constraint.Constant (2),
                Constraint.RelativeToParent ((Parent) => {
                    return 50;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 50;
                }));

            StackLayout labeltit = new StackLayout ();

            Label label = new Label () {
                FontSize=12
            };
            label.HorizontalOptions = LayoutOptions.FillAndExpand;
            label.XAlign = TextAlignment.Start;

            var fs = new FormattedString ();

            Span sp1 = new Span () {
                Text = "#ShielEnsony",
                FontAttributes = FontAttributes.Bold,
                FontSize=12
            };
            fs.Spans.Add (sp1);
            Span sp2 = new Span () {
                Text = "\n bit.ly ",
                FontSize=12
            };
            fs.Spans.Add (sp2);
            Span sp3 = new Span () {
                Text = "\nEl nuevo inhumano se enamor...",
                FontSize=12
            };
            fs.Spans.Add (sp3);
            label.FormattedText = fs;

            labeltit.Children.Add (label);

            Label tiempo = new Label () {
                Text = "El 2 de noviembre a las 8:33 p.m.",
                TextColor = Color.Gray,
                FontSize=8
            };
            labeltit.Children.Add (tiempo);

            this.Children.Add (labeltit,
                Constraint.Constant (57),
                Constraint.Constant (2),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width - 57;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 60;
                }));
        }
        public layoutnotificacion()
        {
            this.BackgroundColor = Color.FromRgb(219,219,219);
            this.Padding = new Thickness (3, 3, 3, 3);

            string foto = new Fotos ().fotoaleatoria();

            var imgfoto = new Image () {
                Source = ImageSource.FromResource (foto),
                Aspect = Aspect.AspectFill
            };

            this.Children.Add (imgfoto,
                Constraint.Constant (0),
                Constraint.Constant (2),
                Constraint.RelativeToParent ((Parent) => {
                    return 50;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 50;
                }));

            StackLayout labeltit = new StackLayout ();

            Label label = new Label () {
                FontSize=12
            };
            label.HorizontalOptions = LayoutOptions.FillAndExpand;
            label.XAlign = TextAlignment.Start;

            var fs = new FormattedString ();

            Span sp1 = new Span () {
                Text = "Jonatahan Ivan Vargas Gómez",
                FontAttributes = FontAttributes.Bold,
                FontSize=12
            };
            fs.Spans.Add (sp1);
            Span sp2 = new Span () {
                Text = " publicó en ",
                FontSize=12
            };
            fs.Spans.Add (sp2);
            Span sp3 = new Span () {
                Text = "La comunidad",
                FontAttributes = FontAttributes.Bold,
                FontSize=12
            };
            fs.Spans.Add (sp3);
            Span sp4 = new Span () {
                Text = " de ",
                FontSize=12
            };
            fs.Spans.Add (sp4);
            Span sp5 = new Span () {
                Text = "viajes interesantes",
                FontAttributes = FontAttributes.Bold,
                FontSize=12
            };
            fs.Spans.Add (sp5);
            label.FormattedText = fs;

            labeltit.Children.Add (label);

            Label tiempo = new Label () {
                Text = "El 2 de noviembre a las 8:33 p.m.",
                TextColor = Color.Gray,
                FontSize=8
            };
            labeltit.Children.Add (tiempo);

            this.Children.Add (labeltit,
                Constraint.Constant (55),
                Constraint.Constant (2),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width - 55;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 50;
                }));
        }
Example #4
0
        public Mensajes()
        {
            BackgroundColor = Color.FromRgb (96, 178, 54);

            var guardaritem = new ToolbarItem {
                Text = "Guardar",
                //Order = ToolbarItemOrder.Secondary
            };

            ToolbarItems.Add (guardaritem);

            RelativeLayout layoutsup = new RelativeLayout ();

            Label lblpara = new Label () {
                Text="Para:"
            };

            layoutsup.Children.Add (lblpara,
                Constraint.Constant (0),
                Constraint.Constant (6),
                Constraint.RelativeToParent ((Parent) => {
                    return 50;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 40;
                }));

            SearchBar searchBar = new SearchBar
            {
                Placeholder = "Amigos",
                BackgroundColor= Color.FromRgb (96, 178, 54)
            };

            layoutsup.Children.Add (searchBar,
                Constraint.Constant (40),
                Constraint.Constant (0),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width-50;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 40;
                }));

            RelativeLayout aquien = new RelativeLayout ();

            string foto = new Fotos ().fotoaleatoria();

            var imgfoto = new Image () {
                Source = ImageSource.FromResource (foto),
                Aspect = Aspect.AspectFill
            };

            aquien.Children.Add (imgfoto,
                Constraint.Constant (0),
                Constraint.Constant (2),
                Constraint.RelativeToParent ((Parent) => {
                    return 50;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 50;
                }));

            StackLayout labeltit = new StackLayout ();

            ExtendedEntry label = new ExtendedEntry () {
                Placeholder = "Comparte esto..."
            };

            labeltit.Children.Add (label);

            aquien.Children.Add (labeltit,
                Constraint.Constant (55),
                Constraint.Constant (2),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width - 55;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 50;
                }));
            layoutminicomentario mini = new layoutminicomentario ();

            this.Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5);

            RelativeLayout rl = new RelativeLayout ();

            rl.Children.Add (layoutsup,
                Constraint.Constant (0),
                Constraint.Constant (0),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 40;
                }));
            rl.Children.Add (aquien,
                Constraint.Constant (0),
                Constraint.Constant (50),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 50;
                }));
            rl.Children.Add (new LayoutBorde(mini),
                Constraint.Constant (50),
                Constraint.Constant (120),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width-100;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 50;
                }));

            this.Content = rl;
        }
Example #5
0
        public LayoutQuienyQue()
        {
            string foto = new Fotos ().fotoaleatoria();

            var imgfoto = new Image () {
                Source = ImageSource.FromResource (foto),
                Aspect = Aspect.AspectFill
            };

            this.Children.Add (imgfoto,
                Constraint.Constant (0),
                Constraint.Constant (2),
                Constraint.RelativeToParent ((Parent) => {
                    return 50;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 50;
                }));

            StackLayout labeltit = new StackLayout ();

            Label label = new Label () {
                FontSize=12
            };
            label.HorizontalOptions = LayoutOptions.FillAndExpand;
            label.XAlign = TextAlignment.Start;

            var fs = new FormattedString ();

            Span sp1 = new Span () {
                Text = "Jonatahan Ivan Vargas Gómez",
                FontAttributes = FontAttributes.Bold,
                FontSize=12
            };
            fs.Spans.Add (sp1);
            Span sp2 = new Span () {
                Text = " compartió la ",
                FontSize=12
            };
            fs.Spans.Add (sp2);
            Span sp3 = new Span () {
                Text = "foto",
                FontAttributes = FontAttributes.Bold,
                FontSize=12
            };
            fs.Spans.Add (sp3);
            Span sp4 = new Span () {
                Text = " de ",
                FontSize=12
            };
            fs.Spans.Add (sp4);
            Span sp5 = new Span () {
                Text = "Gente Inteligente IQ",
                FontAttributes = FontAttributes.Bold,
                FontSize=12
            };
            fs.Spans.Add (sp5);
            label.FormattedText = fs;

            labeltit.Children.Add (label);

            Label tiempo = new Label () {
                Text = "El 2 de noviembre a las 8:33 p.m.",
                TextColor = Color.Gray,
                FontSize=8
            };
            labeltit.Children.Add (tiempo);

            this.Children.Add (labeltit,
                Constraint.Constant (55),
                Constraint.Constant (2),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width - 55;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 50;
                }));
        }