Example #1
0
 public BtnLabel()
 {
     TextColor = Color.White;
     FontSize  = 30;
     Margin    = new Thickness(0, 20, 0, 0);
     HorizontalTextAlignment = TextAlignment.Center;
     FontFamily = FontAwsomeXamarin.GetFontName();
 }
Example #2
0
        public TripPlaceCard(Place trip)
        {
            BackgroundColor = Color.FromHex("#ededed");

            Margin     = new Thickness(20, 0, 20, 30);
            RowSpacing = 1;

            ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1, GridUnitType.Star)
            });
            ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(70, GridUnitType.Absolute)
            });

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

            var img = new Image {
                Source = trip.Url, Aspect = Aspect.AspectFill
            };
            var name = new Label {
                Text = trip.Name, Margin = 6
            };

            var likes = new Label
            {
                Text       = FontAwsomeXamarin.FAHeartO + " " + trip.Likes,
                FontFamily = FontAwsomeXamarin.GetFontName(),
                HorizontalTextAlignment = TextAlignment.End,
                FontSize = 15,
                Margin   = 6
            };

            Children.Add(img, 0, 0);
            Children.Add(name, 0, 1);
            Children.Add(likes, 1, 1);

            SetColumnSpan(img, 2);

            var tgr = new TapGestureRecognizer();

            tgr.Tapped += (sender, e) =>
            {
                Navigation.PushModalAsync(new PlacePage());
            };

            GestureRecognizers.Add(tgr);
        }
Example #3
0
        public MenuListCell()
        {
            var label = new Label
            {
                FontFamily            = FontAwsomeXamarin.GetFontName(),
                FontSize              = 16,
                TextColor             = Color.White,
                Margin                = new Thickness(10, 0, 0, 0),
                VerticalTextAlignment = TextAlignment.Center
            };

            label.Text = FontAwsomeXamarin.FAAdjust + " option";
            label.SetBinding(Label.TextProperty, "Text");

            View = label;
        }
Example #4
0
        public AddPlaceLabelInstruction()
        {
            Margin                  = 20;
            TextColor               = ColorConstants.TextColor;
            VerticalOptions         = LayoutOptions.Center;
            HorizontalOptions       = LayoutOptions.Center;
            HorizontalTextAlignment = TextAlignment.Center;

            var fs = new FormattedString();

            fs.Spans.Add(new Span {
                Text = FontAwsomeXamarin.FAMapMarker, FontSize = 40, FontFamily = FontAwsomeXamarin.GetFontName()
            });
            fs.Spans.Add(new Span {
                Text = "\n\nAdd places where you've been, double tap to delete. =)"
            });

            FormattedText = fs;
        }
Example #5
0
        public UploadImgLabelInstruction()
        {
            Margin                  = 20;
            TextColor               = ColorConstants.TextColor;
            VerticalOptions         = LayoutOptions.Center;
            HorizontalOptions       = LayoutOptions.Center;
            HorizontalTextAlignment = TextAlignment.Center;

            var fs = new FormattedString();

            fs.Spans.Add(new Span {
                Text = FontAwsomeXamarin.FACamera, FontSize = 40, FontFamily = FontAwsomeXamarin.GetFontName()
            });
            fs.Spans.Add(new Span {
                Text = "\n\nAdd photos you took, double tap to delete. =)"
            });

            FormattedText = fs;
        }
Example #6
0
        public ConfigPage()
        {
            BackgroundColor = ColorConstants.FeedBackground;

            var logOut = new Button
            {
                Margin     = 20,
                FontSize   = 20,
                TextColor  = ColorConstants.TextColor,
                Text       = FontAwsomeXamarin.FASignOut + "  Log out",
                FontFamily = FontAwsomeXamarin.GetFontName()
            };

            logOut.Clicked += LogOut_Clicked;

            Content = new StackLayout
            {
                Children = { logOut }
            };
        }
Example #7
0
        public PlaceInfo()
        {
            Spacing = 10;
            Padding = 15;

            BackgroundColor = Color.FromHex("#323232");

            var siteLabel = new Label {
                TextColor = Color.White
            };
            var siteFs = new FormattedString();

            siteFs.Spans.Add(new Span {
                Text = FontAwsomeXamarin.FAGlobe, FontSize = 20, FontFamily = FontAwsomeXamarin.GetFontName()
            });
            siteFs.Spans.Add(new Span {
                Text = "  www.manguinhosbeach.com"
            });

            siteLabel.FormattedText = siteFs;

            var phoneLabel = new Label {
                TextColor = Color.White
            };
            var phoneFs = new FormattedString();

            phoneFs.Spans.Add(new Span {
                Text = FontAwsomeXamarin.FAPhone, FontSize = 20, FontFamily = FontAwsomeXamarin.GetFontName()
            });
            phoneFs.Spans.Add(new Span {
                Text = "  (27) 99612-5988"
            });

            phoneLabel.FormattedText = phoneFs;

            Children.Add(siteLabel);
            Children.Add(phoneLabel);
        }
Example #8
0
        public AddressCard()
        {
            HasShadow       = false;
            CornerRadius    = 0;
            Padding         = 15;
            Margin          = 0;
            BackgroundColor = Color.FromHex("#323232");

            var contentLabel = new Label {
                TextColor = Color.White
            };
            var contentFs = new FormattedString();

            contentFs.Spans.Add(new Span {
                Text = FontAwsomeXamarin.FAMapMarker, FontSize = 20, FontFamily = FontAwsomeXamarin.GetFontName()
            });
            contentFs.Spans.Add(new Span {
                Text = "   Manguinhos, Serra, State of Espirito Santo, Brazil"
            });

            contentLabel.FormattedText = contentFs;
            Content = contentLabel;
        }
Example #9
0
        public NewTripPage()
        {
            BackgroundColor = ColorConstants.NewTripBackground;

            var saveBtn = new ToolbarItem {
                Icon = ImgConstants.Next
            };
            var grid = new Grid {
                Padding = 20
            };

            saveBtn.Clicked += (sender, e) => Navigation.PushAsync(new UploadImgPage());
            ToolbarItems.Add(saveBtn);

            grid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1, GridUnitType.Star)
            });
            grid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(60, GridUnitType.Absolute)
            });

            grid.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(20, GridUnitType.Absolute)
            });
            grid.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(40, GridUnitType.Absolute)
            });
            grid.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(20, GridUnitType.Absolute)
            });
            grid.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(40, GridUnitType.Absolute)
            });
            grid.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(20, GridUnitType.Absolute)
            });
            grid.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(40, GridUnitType.Absolute)
            });
            grid.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(40, GridUnitType.Absolute)
            });
            grid.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(20, GridUnitType.Absolute)
            });
            grid.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(200, GridUnitType.Absolute)
            });


            var descEditor = new Editor {
                TextColor = ColorConstants.NewTripFontColor
            };
            var placeEntry  = new NewTripEntry();
            var nameEntry   = new NewTripEntry();
            var newTagEntry = new NewTripEntry();

            var newTagBtn = new Button
            {
                FontSize   = 20,
                TextColor  = ColorConstants.NewTripFontColor,
                FontFamily = FontAwsomeXamarin.GetFontName(),
                Text       = FontAwsomeXamarin.FAPlusCircle
            };

            var tagStack = new StackLayout {
                Orientation = StackOrientation.Horizontal
            };
            var tagStackScroll = new ScrollView {
                Orientation = ScrollOrientation.Horizontal, Content = tagStack
            };

            newTagBtn.Clicked += (sender, e) =>
            {
                var _rnd  = new Random();
                var color = Color.FromRgb(_rnd.Next(100, 200), _rnd.Next(100, 200), _rnd.Next(100, 200));
                tagStack.Children.Add(new NewTripTag {
                    Text = newTagEntry.Text, BackgroundColor = color
                });
                newTagEntry.Text = "";
            };

            /*
             * var photoBtn = new Button
             * {
             *  FontSize = 40,
             *  TextColor = Color.White,
             *  Text = FontAwsomeXamarin.FACamera,
             *  FontFamily = FontAwsomeXamarin.GetFontName()
             * };
             *
             * photoBtn.Clicked += async (sender, e) =>
             * {
             *  if (!CrossMedia.Current.IsPickPhotoSupported)
             *      return;
             *
             *  var photo = await CrossMedia.Current.PickPhotoAsync();
             *
             *  if (photo == null)
             *      return;
             *
             *  var image = new Image
             *  {
             *      Source = ImageSource.FromStream(() =>
             *      {
             *          var stream = photo.GetStream();
             *          photo.Dispose();
             *          return stream;
             *      })
             *  };
             *
             *  photoBtn.IsVisible = false;
             *  grid.Children.Add(image, 0, 0);
             * };
             */

            grid.Children.Add(new Label {
                TextColor = Color.White, Text = "trip name:"
            }, 0, 0);
            grid.Children.Add(nameEntry, 0, 1);
            grid.Children.Add(new Label {
                TextColor = Color.White, Text = "trip location:"
            }, 0, 2);
            grid.Children.Add(placeEntry, 0, 3);
            grid.Children.Add(new Label {
                TextColor = Color.White, Text = "trip tags:"
            }, 0, 4);
            grid.Children.Add(newTagEntry, 0, 5);
            grid.Children.Add(newTagBtn, 1, 5);
            grid.Children.Add(tagStackScroll, 0, 6);
            grid.Children.Add(new Label {
                TextColor = Color.White, Text = "description:"
            }, 0, 7);
            grid.Children.Add(descEditor, 0, 8);

            Grid.SetColumnSpan(nameEntry, 2);
            Grid.SetColumnSpan(placeEntry, 2);
            Grid.SetColumnSpan(descEditor, 2);
            Grid.SetColumnSpan(tagStackScroll, 2);

            Content = grid;
        }
Example #10
0
        public ProfilePage()
        {
            BackgroundColor = ColorConstants.NewTripBackground;

            var saveBtn = new ToolbarItem {
                Icon = ImgConstants.Check
            };
            var grid = new Grid {
                Padding = 20, ColumnSpacing = 15
            };

            // saveBtn.Clicked += (sender, e) => Navigation.PushAsync(new UploadImgPage());

            ToolbarItems.Add(saveBtn);

            grid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(90, GridUnitType.Absolute)
            });
            grid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1, GridUnitType.Star)
            });

            grid.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(45, GridUnitType.Absolute)
            });
            grid.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(45, GridUnitType.Absolute)
            });
            grid.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(25, GridUnitType.Absolute)
            });
            grid.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(45, GridUnitType.Absolute)
            });

            var nameEntry = new ProfileEntry();
            var mailEntry = new ProfileEntry();

            var photoBtn = new Button
            {
                FontSize   = 40,
                TextColor  = Color.White,
                Text       = FontAwsomeXamarin.FACamera,
                FontFamily = FontAwsomeXamarin.GetFontName()
            };

            photoBtn.Clicked += async(sender, e) =>
            {
                if (!CrossMedia.Current.IsTakePhotoSupported)
                {
                    return;
                }

                var photo = await CrossMedia.Current.TakePhotoAsync(new StoreCameraMediaOptions
                {
                    Directory = "NossaTrip",
                    Name      = DateTime.Now + ".jpg"
                });

                if (photo == null)
                {
                    return;
                }

                var image = new Image
                {
                    Aspect = Aspect.AspectFill,
                    Source = ImageSource.FromStream(() =>
                    {
                        var stream = photo.GetStream();
                        photo.Dispose();
                        return(stream);
                    })
                };

                photoBtn.IsVisible = false;
                grid.Children.Add(image, 0, 0);
                Grid.SetRowSpan(image, 2);
            };

            grid.Children.Add(photoBtn, 0, 0);
            grid.Children.Add(new ProfileLabel {
                Text = "name:"
            }, 1, 0);
            grid.Children.Add(nameEntry, 1, 1);
            grid.Children.Add(new ProfileLabel {
                Text = "e-mail:"
            }, 0, 2);
            grid.Children.Add(mailEntry, 0, 3);

            Grid.SetRowSpan(photoBtn, 2);
            Grid.SetColumnSpan(mailEntry, 2);

            Content = grid;
        }
Example #11
0
        public TripMainData(string source, string name, string address)
        {
            var bg_opacity = new BoxView
            {
                Color   = Color.Black,
                Opacity = 0.5
            };

            Bg = new Image {
                Source = source
            };

            var bgContainer = new Frame {
                Padding = 0, Content = Bg, HasShadow = false, CornerRadius = 0
            };
            var grid = new Grid();

            grid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1, GridUnitType.Star)
            });
            grid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1, GridUnitType.Star)
            });
            grid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1, GridUnitType.Star)
            });

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

            var fs = new FormattedString();

            var nameSpan = new Span
            {
                Text            = String.Format("{0}\n", name),
                ForegroundColor = Color.White,
                FontSize        = 30
            };

            var addressSpan = new Span {
                Text            = String.Format("{0} {1}", FontAwsomeXamarin.FAMapMarker, address),
                FontFamily      = FontAwsomeXamarin.GetFontName(),
                ForegroundColor = Color.White
            };

            fs.Spans.Add(nameSpan);
            fs.Spans.Add(addressSpan);

            var label = new Label {
                Margin = new Thickness(20, 0, 0, 0)
            };

            label.FormattedText = fs;

            var like = new BtnLabel {
                Text = FontAwsomeXamarin.FAHeartO
            };
            var share = new BtnLabel {
                Text = FontAwsomeXamarin.FAShareAlt
            };
            var favorite = new BtnLabel {
                Text = FontAwsomeXamarin.FAStarO
            };

            like.AddFunction(TripController.Like());
            share.AddFunction(TripController.Share());
            favorite.AddFunction(TripController.Favorite());

            grid.Children.Add(label, 0, 0);
            grid.Children.Add(like, 0, 1);
            grid.Children.Add(share, 1, 1);
            grid.Children.Add(favorite, 2, 1);

            Grid.SetColumnSpan(label, 3);

            HeightRequest = App.ScreenHeight;

            SetLayoutBounds(bgContainer, new Rectangle(0, 0, 1, 1));
            SetLayoutBounds(bg_opacity, new Rectangle(0, 0, 1, 1));
            SetLayoutBounds(grid, new Rectangle(0, 0.95, 1, 0.25));

            SetLayoutFlags(bgContainer, AbsoluteLayoutFlags.SizeProportional);
            SetLayoutFlags(bg_opacity, AbsoluteLayoutFlags.SizeProportional);
            SetLayoutFlags(grid, AbsoluteLayoutFlags.All);

            Children.Add(bgContainer);
            Children.Add(bg_opacity);
            Children.Add(grid);
        }
Example #12
0
        public FeedListCell()
        {
            var grid = new Grid
            {
                BackgroundColor = ColorConstants.FeedCard,
                ColumnSpacing   = 0,
                RowSpacing      = 0
            };

            var card = new CardView
            {
                Margin       = new Thickness(15, 7, 15, 5),
                CornerRadius = 10,
                Padding      = 0
            };

            var avaliation = new BoxView();

            var avatar = new Image
            {
                HeightRequest = 40,
                WidthRequest  = 40,
                Margin        = 10
            };

            var name_label = new Label
            {
                FontSize              = 14,
                TextColor             = ColorConstants.TextColor,
                VerticalTextAlignment = TextAlignment.Center
            };

            var time_label = new Label
            {
                FontSize              = 11,
                TextColor             = ColorConstants.TextColor,
                Margin                = new Thickness(10, 0, 0, 0),
                VerticalTextAlignment = TextAlignment.Center
            };

            var trip_label = new Label
            {
                FontSize              = 22,
                Margin                = new Thickness(15, 10, 10, 0),
                TextColor             = ColorConstants.TextColor,
                FontFamily            = FontAwsomeXamarin.GetKhulaFontName(true),
                VerticalTextAlignment = TextAlignment.End,
            };

            var address_label = new Label
            {
                Margin                = new Thickness(15, 5, 10, 20),
                TextColor             = ColorConstants.TextColor,
                FontFamily            = FontAwsomeXamarin.GetFontName(),
                VerticalTextAlignment = TextAlignment.Start
            };

            avatar.SetBinding(Image.SourceProperty, "Url");
            name_label.SetBinding(Label.TextProperty, "UserName");
            trip_label.SetBinding(Label.TextProperty, "TripName");
            time_label.SetBinding(Label.TextProperty, "Time");
            address_label.SetBinding(Label.TextProperty, "TripPlace");
            avaliation.SetBinding(BoxView.ColorProperty, "AvaliationColor");

            grid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(10, GridUnitType.Absolute)
            });
            grid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(60, GridUnitType.Absolute)
            });
            grid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1, GridUnitType.Star)
            });
            grid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1, GridUnitType.Star)
            });
            grid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1, GridUnitType.Star)
            });

            grid.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(60, GridUnitType.Absolute)
            });
            grid.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(1, GridUnitType.Auto)
            });
            grid.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(1, GridUnitType.Auto)
            });

            grid.Children.Add(avaliation, 0, 0);
            grid.Children.Add(avatar, 1, 0);
            grid.Children.Add(name_label, 2, 0);
            grid.Children.Add(time_label, 4, 0);
            grid.Children.Add(trip_label, 1, 1);
            grid.Children.Add(address_label, 1, 2);

            Grid.SetRowSpan(avaliation, 4);
            Grid.SetColumnSpan(name_label, 2);
            Grid.SetColumnSpan(trip_label, 4);
            Grid.SetColumnSpan(address_label, 4);

            card.Content = grid;
            View         = card;
        }