Esempio n. 1
0
        public ModificarPerfil()
        {
            InitializeComponent();
            //init("http://www.bvbox.intercreaciones.com/getJson.php?get=datosUsr&id=" + Application.Current.Properties["id"]);
            //getNacionalidadError("http://www.bvbox.intercreaciones.com/jsonErrors.php?set=nacionalidad");

            editorNombre.Text       = MainPage.nombre;
            editorCumple.Date       = DateTime.Parse(MainPage.cumple);
            editorSexo.SelectedItem = MainPage.sexo;

            Uri ruta = new Uri("http://localhost/imagenes/" + MainPage.imagen);

            miImagenPerfil.Source = FileImageSource.FromUri(ruta);

            System.Diagnostics.Debug.WriteLine("Imagen en mod perfil" + MainPage.imagen);

            if (MainPage.listaNacionalidades != null)
            {
                editorNacionalidad.ItemsSource  = MainPage.listaNacionalidades;
                editorNacionalidad.SelectedItem = MainPage.nacionalidad;
            }
            else
            {
                DisplayAlert("Error permiso denegado", "Nope tío nope", "OK");
            }



            actPerfil.Clicked += actualizar;
        }
Esempio n. 2
0
        private async Task CargarFoto(Uri uriGato)
        {
            IsLoading = true;

            gatoImage.Source = FileImageSource.FromUri(uriGato);

            IsLoading = false;
        }
Esempio n. 3
0
 private async Task CargarFoto()
 {
     if (seleccionado.image != null)
     {
         if (seleccionado.image.medium != "")
         {
             var imagen = new Uri(seleccionado.image.original);
             Img.Source = FileImageSource.FromUri(imagen);
         }
     }
 }
Esempio n. 4
0
        public MiPerfil()
        {
            InitializeComponent();

            subirnuevafoto.Clicked += subirNuevaFoto;

            miNombre.Text = MainPage.nombre;

            Uri ruta = new Uri("http://localhost/imagenes/" + MainPage.imagen);

            miImagenPerfil.Source = FileImageSource.FromUri(ruta);

            compruebaSeguidores();
            compruebaRedes();
            compruebaMGustas();
        }
        public AddGastosPage()
        {

            this.Title = "Registrar un Nuevo Gasto";

            var myImage = new Image()
            {
                Source = FileImageSource.FromUri(
            new Uri("https://i.pinimg.com/564x/ff/0b/73/ff0b7332c013ed44a96583f98767d9c4.jpg"))
            };

            StackLayout stackLayout = new StackLayout();

            _nombreEntry = new Entry();
            _nombreEntry.Keyboard = Keyboard.Text;
            _nombreEntry.Placeholder = "Ingrese su Nombre";
            stackLayout.Children.Add(_nombreEntry);

            _apellidosEntry = new Entry();
            _apellidosEntry.Keyboard = Keyboard.Text;
            _apellidosEntry.Placeholder = "Ingrese su Apellido";
            stackLayout.Children.Add(_apellidosEntry);

            _fechaGastoEntry = new Entry();
            _fechaGastoEntry.Keyboard = Keyboard.Text;
            _fechaGastoEntry.Placeholder = "dd/mm/aaaa";
            stackLayout.Children.Add(_fechaGastoEntry);

            _montoEntry = new Entry();
            _montoEntry.Keyboard = Keyboard.Text;
            _montoEntry.Placeholder = "Ingrese la Cantidad";
            stackLayout.Children.Add(_montoEntry);

            _tipoGastoEntry = new Entry();
            _tipoGastoEntry.Keyboard = Keyboard.Text;
            _tipoGastoEntry.Placeholder = "Detalle de Gasto";
            stackLayout.Children.Add(_tipoGastoEntry);

            _saveButton = new Button();
            _saveButton.Text = "Guardar";
            _saveButton.Clicked += _saveButton_Clicked;
            stackLayout.Children.Add(_saveButton);
            
            Content = stackLayout;
        }
Esempio n. 6
0
        async void init(string query)
        {
            Task <List <ObjetoPerfil> > pl = ConsultaPerfil.getJsonPerfil(query);
            List <ObjetoPerfil>         p  = await pl;

            miPerfil = p[0];
            System.Diagnostics.Debug.WriteLine("Contenido : " + miPerfil.Imagen + ", " + miPerfil.NombreCompleto + ", " + miPerfil.Nacionalidad + ", " + miPerfil.Sexo + ", " + miPerfil.Cumpleanios);
            //cumple = editorCumple.Date + "";

            nombre = miPerfil.NombreCompleto;
            cumple = miPerfil.Cumpleanios;

            nacionalidad = miPerfil.Nacionalidad;
            sexo         = miPerfil.Sexo;
            imagen       = miPerfil.Imagen;


            miNombre.Text = miPerfil.NombreCompleto;
            Uri ruta = new Uri("http://localhost/imagenes/" + MiPerfil.imagen);

            miImagenPerfil.Source = FileImageSource.FromUri(ruta);
        }
Esempio n. 7
0
        public async void Init(String query)
        {
            Task <List <ObjetoPoliticaApp> > objPol = ConsultaPoliticaApp.getJsonPoliticaApp(query);
            List <ObjetoPoliticaApp>         oP     = await objPol;
            Label texto = new Label()
            {
                Text = oP.ElementAt(0).Descripcion
            };

            texto.HorizontalOptions = LayoutOptions.StartAndExpand;
            texto.VerticalOptions   = LayoutOptions.StartAndExpand;
            texto.BackgroundColor   = Color.LightBlue;


            ScrollView sv = new ScrollView()
            {
                Orientation = ScrollOrientation.Vertical
            };

            //Esta parte del codigo comprueba si el string que recogo del json es una imagen o un color y lo coloca de fondo

            if (!App.Fondo1.Fondo.ElementAt(0).Equals('h'))
            {
                Color color = Color.FromHex(miImagen);

                RelativeLayout rl = new RelativeLayout();

                sv.Content = texto;

                StackLayout imatsl = new StackLayout();
                imatsl.BackgroundColor   = color;
                imatsl.HorizontalOptions = LayoutOptions.FillAndExpand;
                imatsl.VerticalOptions   = LayoutOptions.FillAndExpand;
                rl.Children.Add(imatsl,
                                Constraint.Constant(0),
                                Constraint.Constant(0),
                                Constraint.RelativeToParent((parent) =>
                {
                    return(parent.Width);
                }),
                                Constraint.RelativeToParent((parent) =>
                {
                    return(parent.Height);
                }));
                rl.Children.Add(sv,
                                Constraint.Constant(0),
                                Constraint.Constant(0),
                                Constraint.RelativeToParent((parent) =>
                {
                    return(parent.Width);
                }), Constraint.RelativeToParent((parent) =>
                {
                    return(parent.Height);
                }));

                Content = rl;
            }
            else
            {
                System.Diagnostics.Debug.WriteLine("No comprueba bien");

                var myImage = new Image()
                {
                    Source = FileImageSource.FromUri(
                        new Uri(miImagen))
                };
                myImage.HorizontalOptions = LayoutOptions.FillAndExpand;
                myImage.VerticalOptions   = LayoutOptions.FillAndExpand;
                myImage.Aspect            = Aspect.AspectFill;
                RelativeLayout rl = new RelativeLayout();

                sv.Content = texto;

                StackLayout imatsl = new StackLayout();
                imatsl.BackgroundColor   = Color.Beige;
                imatsl.HorizontalOptions = LayoutOptions.FillAndExpand;
                imatsl.VerticalOptions   = LayoutOptions.FillAndExpand;
                imatsl.Children.Add(myImage);
                rl.Children.Add(imatsl,
                                Constraint.Constant(0),
                                Constraint.Constant(0),
                                Constraint.RelativeToParent((parent) =>
                {
                    return(parent.Width);
                }),
                                Constraint.RelativeToParent((parent) =>
                {
                    return(parent.Height);
                }));

                rl.Children.Add(sv,
                                Constraint.Constant(0),
                                Constraint.Constant(0),
                                Constraint.RelativeToParent((parent) =>
                {
                    return(parent.Width);
                }), Constraint.RelativeToParent((parent) =>
                {
                    return(parent.Height);
                }));


                Content = rl;
            }
        }
Esempio n. 8
0
        //ICallService callService = DependencyService.Get<ICallService>();

        public Contacto(string fondo)
        {
            InitializeComponent();

            if (!App.Fondo1.Fondo.ElementAt(0).Equals('h'))
            {
                Color color = Color.FromHex(fondo);

                RelativeLayout rl = new RelativeLayout();

                StackLayout imatsl = new StackLayout();
                imatsl.BackgroundColor   = color;
                imatsl.HorizontalOptions = LayoutOptions.FillAndExpand;
                imatsl.VerticalOptions   = LayoutOptions.FillAndExpand;
                rl.Children.Add(imatsl,
                                Constraint.Constant(0),
                                Constraint.Constant(0),
                                Constraint.RelativeToParent((parent) =>
                {
                    return(parent.Width);
                }),
                                Constraint.RelativeToParent((parent) =>
                {
                    return(parent.Height);
                }));


                Content = rl;
            }
            else
            {
                System.Diagnostics.Debug.WriteLine("No comprueba bien");

                var myImage = new Image()
                {
                    Source = FileImageSource.FromUri(
                        new Uri(fondo))
                };
                myImage.HorizontalOptions = LayoutOptions.FillAndExpand;
                myImage.VerticalOptions   = LayoutOptions.FillAndExpand;
                myImage.Aspect            = Aspect.AspectFill;
                RelativeLayout rl = new RelativeLayout();


                Button buttonIdentity = new Button
                {
                    WidthRequest  = 30,
                    HeightRequest = 30,
                    BorderRadius  = 20
                };
                buttonIdentity.Image     = "ic_perm_identity_black.png";
                buttonIdentity.IsEnabled = false;
                buttonIdentity.Margin    = 5;

                Label nombre = new Label();
                nombre.Text            = "Nombre: " + MainPage.Cont.Nombre;
                nombre.BackgroundColor = Color.LightBlue;
                nombre.Margin          = 10;


                Button buttonCall = new Button
                {
                    WidthRequest  = 30,
                    HeightRequest = 30,
                    BorderRadius  = 20
                };
                buttonCall.Clicked += OnButtonCallClicked;
                buttonCall.Image    = "ic_call_black.png";
                buttonCall.Margin   = 5;

                Label telefono = new Label();
                telefono.Text            = "Telefono: " + MainPage.Cont.Telefono;
                telefono.BackgroundColor = Color.LightBlue;
                telefono.Margin          = 10;


                Button buttonFax = new Button
                {
                    WidthRequest  = 30,
                    HeightRequest = 30,
                    BorderRadius  = 20
                };
                buttonFax.Image     = "ic_print_black.png";
                buttonFax.IsEnabled = false;
                buttonFax.Margin    = 5;

                Label fax = new Label();
                fax.Text            = "Fax: " + MainPage.Cont.Fax;
                fax.BackgroundColor = Color.LightBlue;
                fax.Margin          = 10;


                Button buttonEmail = new Button
                {
                    WidthRequest  = 30,
                    HeightRequest = 30,
                    BorderRadius  = 20
                };
                buttonEmail.Clicked += OnButtonEmailClicked;
                buttonEmail.Image    = "ic_email_black.png";
                buttonEmail.Margin   = 5;

                Label email = new Label();
                email.Text            = "Email: " + MainPage.Cont.Correo;
                email.BackgroundColor = Color.LightBlue;
                email.Margin          = 10;


                Button buttonAddress = new Button
                {
                    WidthRequest  = 30,
                    HeightRequest = 30,
                    BorderRadius  = 20
                };
                buttonAddress.Image     = "ic_location_on_black.png";
                buttonAddress.IsEnabled = false;
                buttonAddress.Margin    = 5;

                Label direccion = new Label();
                direccion.Text            = "Direccion: " + MainPage.Cont.Direccion;
                direccion.BackgroundColor = Color.LightBlue;
                direccion.Margin          = 10;

                StackLayout imatsl = new StackLayout();

                StackLayout padre = new StackLayout();
                padre.Orientation = StackOrientation.Horizontal;

                StackLayout icons = new StackLayout();
                icons.Orientation = StackOrientation.Vertical;
                icons.Children.Add(buttonIdentity);
                icons.Children.Add(buttonCall);
                icons.Children.Add(buttonFax);
                icons.Children.Add(buttonEmail);
                icons.Children.Add(buttonAddress);
                icons.HorizontalOptions = LayoutOptions.FillAndExpand;
                icons.VerticalOptions   = LayoutOptions.FillAndExpand;

                StackLayout labels = new StackLayout();
                labels.Orientation = StackOrientation.Vertical;
                labels.Children.Add(nombre);
                labels.Children.Add(telefono);
                labels.Children.Add(fax);
                labels.Children.Add(email);
                labels.Children.Add(direccion);
                labels.HorizontalOptions = LayoutOptions.FillAndExpand;
                labels.VerticalOptions   = LayoutOptions.FillAndExpand;

                imatsl.BackgroundColor   = Color.Beige;
                imatsl.HorizontalOptions = LayoutOptions.FillAndExpand;
                imatsl.VerticalOptions   = LayoutOptions.FillAndExpand;
                imatsl.Children.Add(myImage);

                padre.Children.Add(icons);
                padre.Children.Add(labels);

                rl.Children.Add(imatsl,
                                Constraint.Constant(0),
                                Constraint.Constant(0),
                                Constraint.RelativeToParent((parent) =>
                {
                    return(parent.Width);
                }),
                                Constraint.RelativeToParent((parent) =>
                {
                    return(parent.Height);
                }));
                rl.Children.Add(padre,
                                Constraint.Constant(0),
                                Constraint.Constant(0),
                                Constraint.RelativeToParent((parent) =>
                {
                    return(parent.Width);
                }),
                                Constraint.RelativeToParent((parent) =>
                {
                    return(parent.Height);
                }));

                Content = rl;
            }
        }