public TeamCardPopupPage(TeamData team)
        {
            data = team;

            var teamNo = new Label()
            {
                Text           = data.teamNumber.ToString(),
                FontSize       = GlobalVariables.sizeMedium,
                FontAttributes = FontAttributes.Bold
            };

            var teamNa = new Label()
            {
                Text     = data.teamName,
                FontSize = GlobalVariables.sizeMedium
            };

            var teamOPR = new Label()
            {
                Text     = data.tbaOPR.ToString(),
                FontSize = 14
            };

            setPitData();
            //setMatchData();

            Button editTeamBtn = new Button()
            {
                VerticalOptions   = LayoutOptions.Fill,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                Text            = "Edit Info",
                TextColor       = Color.Green,
                BackgroundColor = Color.Black,
                FontSize        = GlobalVariables.sizeMedium
            };

            editTeamBtn.Clicked += (object sender, EventArgs e) =>
            {
                Navigation.PushPopupAsync(new TeamCardPopupEditPage(data));
            };

            Button[] btnArray       = { editTeamBtn };
            var      navigationBtns = new PopupNavigationButtons(true, btnArray);

            navigationBtns.refreshBtn.Clicked += (sender, e) => {
                getFirebaseData();
                setPitData();
            };

            var robotImage = new RobotImageView(data);

            topGrid.Children.Add(robotImage, 0, 1, 0, 2);
            topGrid.Children.Add(teamNo, 1, 0);
            topGrid.Children.Add(teamNa, 1, 1);

            //teamGrid.Children.Add(teamOPR, 0, 2, gridYIndex, gridYIndex++ + 1);
            //teamGrid.Children.Add(teamOPR, 0, 2, gridYIndex, gridYIndex++ + 1);

            //topGrid.Children.Add(navigationBtns, 0, 2, gridYIndex, gridYIndex++ + 1);

            Content = new Frame()
            {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.FillAndExpand,
                Margin            = GlobalVariables.popupMargin,
                Padding           = new Thickness(5),

                BackgroundColor = Color.Gray,
                HasShadow       = true,

                Content = new StackLayout()
                {
                    Children =
                    {
                        topGrid,
                        new ScrollView()
                        {
                            HorizontalOptions = LayoutOptions.StartAndExpand,
                            VerticalOptions   = LayoutOptions.FillAndExpand,

                            Content = pitDataLayout
                        },
                        navigationBtns
                    }
                }
            };
        }
Пример #2
0
		public ImagePopupPage (TeamData tData)
		{
			data = tData;
			robotImg = new RobotImageView(tData);


			Button setImageDefaultBtn = new Button() {
				VerticalOptions = LayoutOptions.Fill,
				HorizontalOptions = LayoutOptions.FillAndExpand,
				Text = "Set Default",
				TextColor = Color.Green,
				BackgroundColor = Color.Black,
				FontSize = GlobalVariables.sizeMedium
			};
			setImageDefaultBtn.Clicked += (object sender, EventArgs e) => {
				setDefaultImage();
			};


			Button retakeImageBtn = new Button()
			{
				VerticalOptions = LayoutOptions.Fill,
				HorizontalOptions = LayoutOptions.FillAndExpand,
				Text = "Retake",
				TextColor = Color.Green,
				BackgroundColor = Color.Black,
				FontSize = GlobalVariables.sizeMedium
			};
			retakeImageBtn.Clicked += (object sender, EventArgs e) =>
			{
				OpenImagePicker();
			};

			btnArray = new Button[] { setImageDefaultBtn, retakeImageBtn };
			var navigationBtns = new PopupNavigationButtons(true, btnArray);
			navigationBtns.refreshBtn.Clicked += (sender, e) => {
				refreshImages();
				robotImg = new RobotImageView(tData);
			};

			Content = new Frame(){
				HorizontalOptions = LayoutOptions.FillAndExpand,
				VerticalOptions = LayoutOptions.FillAndExpand,
				Margin = GlobalVariables.popupMargin,
				Padding = new Thickness(5),

				BackgroundColor = Color.Gray,
				HasShadow = true,

				Content = new StackLayout() {
					HorizontalOptions = LayoutOptions.FillAndExpand,
					VerticalOptions = LayoutOptions.FillAndExpand,

					Children = {
						robotImg,
						new ScrollView(){
							HorizontalOptions = LayoutOptions.FillAndExpand,
							Orientation = ScrollOrientation.Horizontal,

							Content = imageStack
						},
						navigationBtns
					}
				}
			};
		}