public CommunityControl() { this.Padding = new Thickness(0); this.ColumnSpacing = 0; this.RowSpacing = 0; this.BackgroundColor = Config.ColorGrayBackground; this.VerticalOptions = LayoutOptions.FillAndExpand; this.HorizontalOptions = LayoutOptions.FillAndExpand; this.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }); this.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) }); this.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }); // buttons buttonVenues = new BybButtonWithNumber("Venues") { IsNumberVisible = false, HeightRequest = Config.OkCancelButtonsHeight + (Config.IsTablet ? 15 : 5) }; buttonVenues.Clicked += (s, e) => { this.OpenTab(CommunityControlTabEnum.Venues); }; buttonPeople = new BybButtonWithNumber("Players") { IsNumberVisible = false, HeightRequest = Config.OkCancelButtonsHeight + (Config.IsTablet ? 15 : 5) }; buttonPeople.Clicked += (s, e) => { this.OpenTab(CommunityControlTabEnum.People); }; buttonFeed = new BybButtonWithNumber("Feed") { IsNumberVisible = false, HeightRequest = Config.OkCancelButtonsHeight + (Config.IsTablet ? 15 : 5) }; buttonFeed.Clicked += (s, e) => { this.OpenTab(CommunityControlTabEnum.Feed); }; this.Children.Add(new StackLayout { Orientation = StackOrientation.Horizontal, BackgroundColor = Color.White, Padding = new Thickness(0, 0, 0, 0), Spacing = 0, HorizontalOptions = LayoutOptions.FillAndExpand, Children = { buttonPeople, buttonFeed, buttonVenues, } }, 0, 0); this.createFeedTabIfNotCreatedYet(); }
public EventsControl() { this.Padding = new Thickness(0); this.ColumnSpacing = 0; this.RowSpacing = 0; this.BackgroundColor = Config.ColorGrayBackground; this.VerticalOptions = LayoutOptions.FillAndExpand; this.HorizontalOptions = LayoutOptions.FillAndExpand; this.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }); this.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) }); this.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) }); this.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }); // tabs buttonNewEvents = new BybButtonWithNumber("Current") { IsNumberVisible = false, HeightRequest = Config.OkCancelButtonsHeight + (Config.IsTablet ? 15 : 5) }; buttonNewEvents.Clicked += (s, e) => { this.IsShowingPastEvents = false; }; buttonPastEvents = new BybButtonWithNumber("Past") { IsNumberVisible = false, HeightRequest = Config.OkCancelButtonsHeight + (Config.IsTablet ? 15 : 5) }; buttonPastEvents.Clicked += (s, e) => { this.IsShowingPastEvents = true; }; this.Children.Add(new StackLayout { Orientation = StackOrientation.Horizontal, BackgroundColor = Color.White, Padding = new Thickness(0, 0, 0, 0), Spacing = 0, HorizontalOptions = LayoutOptions.FillAndExpand, Children = { buttonNewEvents, buttonPastEvents, } }, 0, 0); // buttons Button buttonAdd = new BybButton() { Text = "New event", Style = (Style)App.Current.Resources["LargeButtonStyle"], HorizontalOptions = LayoutOptions.FillAndExpand }; buttonAdd.Clicked += (s1, e1) => { if (App.Navigator.GetOpenedPage(typeof(NewGameHostPage)) != null) { return; } NewGameHostPage dlg = new NewGameHostPage(); App.Navigator.NavPage.Navigation.PushModalAsync(dlg); dlg.Disappearing += (s2, e2) => { this.ReloadAsync(false); }; }; Button buttonSync = new BybButton() { Text = "Sync", Style = (Style)App.Current.Resources["BlackButtonStyle"], HorizontalOptions = LayoutOptions.FillAndExpand }; buttonSync.Clicked += (s1, e1) => { App.Navigator.StartSyncAndCheckForNotifications(); this.ReloadAsync(false); }; this.panelWithButtons = new StackLayout { Spacing = 1, Orientation = StackOrientation.Horizontal, HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.Start, Padding = new Thickness(10, 10, 10, 0), Children = { buttonAdd, buttonSync } }; this.Children.Add(this.panelWithButtons, 0, 1); StackLayout stackLayout = new StackLayout() { Orientation = StackOrientation.Vertical, Padding = new Thickness(), }; // status // this.labelStatus = new BybLabel() // { // HorizontalOptions = LayoutOptions.Center, // TextColor = Config.ColorBlackTextOnWhite, // }; // this.panelStatus = new StackLayout() // { // Orientation = StackOrientation.Vertical, // HorizontalOptions = LayoutOptions.FillAndExpand, // VerticalOptions = LayoutOptions.Start, // Padding = new Thickness(10, 15, 0, 15), // Children = // { // labelStatus // } // }; // stackLayout.Children.Add(this.panelStatus); // current invites this.panelFuture = new StackLayout() { Orientation = StackOrientation.Vertical, Padding = new Thickness(0), Spacing = 0, }; stackLayout.Children.Add(panelFuture); this.listOfGameHostsFuture = new ListOfGameHostsControl(); this.listOfGameHostsFuture.TreatAsASingleItem = true; this.listOfGameHostsFuture.ShowCommentsCount = true; this.listOfGameHostsFuture.Padding = new Thickness(10, 10, 10, 0); this.listOfGameHostsFuture.UserChangedSomething += (s1, e1) => { this.ReloadAsync(false); }; this.panelFuture.Children.Add( new StackLayout() { Orientation = StackOrientation.Vertical, Padding = new Thickness(10, 10, 0, 0), Children = { new BybLabel() { Text = "Your events and events you were invited to:", HorizontalOptions = LayoutOptions.Start, HorizontalTextAlignment = TextAlignment.Start, TextColor = Config.ColorGrayTextOnWhite, } } }); panelFuture.Children.Add(this.listOfGameHostsFuture); var panel = new StackLayout() { Orientation = StackOrientation.Horizontal, Padding = new Thickness(10, 10, 0, 10), Children = { new BybLabel() { Text = "To see public events, go to the", HorizontalOptions = LayoutOptions.Start, HorizontalTextAlignment = TextAlignment.Start, TextColor = Config.ColorGrayTextOnWhite, }, new BybLabel() { Text = "Community page", FontAttributes = FontAttributes.Bold, TextColor = Config.ColorBlackTextOnWhite, } } }; panelFuture.Children.Add(panel); panel.GestureRecognizers.Add(new TapGestureRecognizer() { Command = new Command(async() => { await App.Navigator.GoToCommunity(); }) }); // past invites this.panelPast = new StackLayout() { Orientation = StackOrientation.Vertical, Padding = new Thickness(0), Spacing = 0, }; stackLayout.Children.Add(panelPast); this.listOfGameHostsPast = new ListOfGameHostsControl(); this.listOfGameHostsPast.TreatAsASingleItem = true; this.listOfGameHostsPast.ShowCommentsCount = true; this.listOfGameHostsPast.Padding = new Thickness(10, 10, 10, 0); this.listOfGameHostsPast.IsForPast = true; this.listOfGameHostsPast.UserChangedSomething += (s1, e1) => { this.ReloadAsync(false); }; this.panelPast.Children.Add(this.listOfGameHostsPast); // scrolling and pulltorefresh var scrollView = new ScrollView { Padding = new Thickness(0), HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, Content = stackLayout, }; this.pullToRefresh = new Refractored.XamForms.PullToRefresh.PullToRefreshLayout() { HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, Content = scrollView, RefreshColor = Config.ColorRedBackground, }; pullToRefresh.RefreshCommand = new Command(() => { this.ReloadAsync(false); }); this.Children.Add(pullToRefresh, 0, 2); this.IsShowingPastEvents = false; }
public ProfilePersonControl() { this.Padding = new Thickness(0); this.BackgroundColor = Config.ColorBackground; this.ColumnSpacing = 0; this.RowSpacing = 0; this.VerticalOptions = LayoutOptions.FillAndExpand; this.HorizontalOptions = LayoutOptions.FillAndExpand; /// info panel /// this.infoControl = new ProfilePersonInfoControl() { Padding = new Thickness(0, 0, 0, 15), HorizontalOptions = LayoutOptions.FillAndExpand }; this.infoControl.ClickedOnBestBreak += (s, e) => { this.State = ProfilePersonStateEnum.Breaks; this.listOfBreaksControl.Sort(SnookerBreakSortEnum.ByPoints); }; this.infoControl.ClickedOnBestFrame += (s, e) => { this.State = ProfilePersonStateEnum.Matches; this.listOfMatchesControl.Sort(SnookerMatchSortEnum.ByBestFrame); }; this.infoControl.ClickedOnContributions += (s, e) => { App.Navigator.DisplayAlertRegular("Verifying snooker venues is an example of a contribution."); }; this.infoControl.ClickedOnAbout += (s, e) => { if (IsMyAthlete == true) { App.Navigator.OpenProfileEditPage(true, true); } }; /// panel "Me" /// Button buttonEditProfile = new BybButton() { Text = "Edit profile", Style = (Style)App.Current.Resources["BlackButtonStyle"], FontFamily = Config.FontFamily, TextColor = Config.ColorTextOnBackground }; buttonEditProfile.Clicked += buttonEditProfile_Clicked; this.buttonSync = new BybButton() { Text = "Sync now", Style = (Style)App.Current.Resources["BlackButtonStyle"], FontFamily = Config.FontFamily, TextColor = Config.ColorTextOnBackground }; this.buttonSync.Clicked += buttonSync_Clicked; this.panelMe = new Grid() { Padding = new Thickness(10, 0, 10, 10), ColumnSpacing = Config.SpaceBetweenButtons, RowSpacing = 0, RowDefinitions = new RowDefinitionCollection() { new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) }, }, ColumnDefinitions = new ColumnDefinitionCollection() { new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }, new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }, } }; this.panelMe.Children.Add(buttonSync, 0, 0); this.panelMe.Children.Add(buttonEditProfile, 1, 0); /// panel "Not me" /// this.panelNotMe = new Grid() { BackgroundColor = Config.ColorBackground, Padding = new Thickness(0, 0, 0, 10), ColumnSpacing = 0, RowSpacing = 0, RowDefinitions = new RowDefinitionCollection() { new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) }, }, ColumnDefinitions = new ColumnDefinitionCollection() { new ColumnDefinition { Width = new GridLength(10, GridUnitType.Absolute) }, new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }, new ColumnDefinition { Width = new GridLength(1, GridUnitType.Absolute) }, new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }, new ColumnDefinition { Width = new GridLength(1, GridUnitType.Absolute) }, new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }, new ColumnDefinition { Width = new GridLength(10, GridUnitType.Absolute) }, } }; this.buttonSendFriendRequest = new BybButton() { Text = "Friend", Style = (Style)App.Current.Resources["BlackButtonStyle"] }; this.buttonSendFriendRequest.Clicked += buttonSendFriendRequest_Clicked; this.buttonInvite = new BybButton() { Text = "Invite", Style = (Style)App.Current.Resources["BlackButtonStyle"] }; this.buttonInvite.Clicked += buttonInvite_Clicked; this.buttonMessage = new BybButton() { Text = "Message", Style = (Style)App.Current.Resources["BlackButtonStyle"] }; this.buttonMessage.Clicked += buttonMessage_Clicked; this.labelFriendship = new BybLabel() { Text = "-", TextColor = Config.ColorTextOnBackgroundGrayed, HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center, HorizontalTextAlignment = TextAlignment.Center }; this.labelFriendship.GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command(() => { this.labelFriendship_Tapped(); }), NumberOfTapsRequired = 1 }); this.panelNotMe.Children.Add(this.buttonMessage, 1, 0); this.panelNotMe.Children.Add(this.buttonInvite, 3, 0); this.panelNotMe.Children.Add(this.labelFriendship, 5, 0); this.panelNotMe.Children.Add(this.buttonSendFriendRequest, 5, 0); /// Tabs: Breaks / matches / opponents /// this.buttonBreaks = new BybButtonWithNumber("Breaks") { HeightRequest = 55 }; buttonBreaks.Clicked += (s, e) => { this.State = ProfilePersonStateEnum.Breaks; }; this.buttonMatches = new BybButtonWithNumber("Matches") { HeightRequest = 55 }; buttonMatches.Clicked += (s, e) => { this.State = ProfilePersonStateEnum.Matches; }; this.buttonOpponents = new BybButtonWithNumber("Opponents") { HeightRequest = 55 }; buttonOpponents.Clicked += (s, e) => { this.State = ProfilePersonStateEnum.Opponents; }; this.buttonVenues = new BybButtonWithNumber("Venues") { HeightRequest = 55 }; buttonVenues.Clicked += (s, e) => { this.State = ProfilePersonStateEnum.Venues; }; Grid gridWithButtons = new Grid() { BackgroundColor = Config.ColorBackgroundWhite,//Config.ColorGrayBackground, Padding = new Thickness(0, 0, 0, 0), ColumnSpacing = 0, RowSpacing = 0, RowDefinitions = new RowDefinitionCollection() { new RowDefinition { Height = new GridLength(55, GridUnitType.Auto) }, }, ColumnDefinitions = new ColumnDefinitionCollection() { new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }, new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }, new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }, new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }, } }; gridWithButtons.Children.Add(buttonBreaks, 0, 0); gridWithButtons.Children.Add(buttonMatches, 1, 0); gridWithButtons.Children.Add(buttonOpponents, 2, 0); gridWithButtons.Children.Add(buttonVenues, 3, 0); StackLayout panelContent = new StackLayout() { Orientation = StackOrientation.Horizontal, HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, BackgroundColor = Config.ColorGrayBackground, }; // breaks this.listOfBreaksControl = new ListOfSnookerBreaksControl() { HorizontalOptions = LayoutOptions.FillAndExpand, IsVisible = true }; this.listOfBreaksControl.UserWantsToEditRes += ctrl_UserWantsToEditBreak; this.listOfBreaksControl.UserWantsToDeleteRes += ctrl_UserWantsToDeleteBreak; panelContent.Children.Add(this.listOfBreaksControl); // matches this.listOfMatchesControl = new ListOfSnookerMatchesControl() { HorizontalOptions = LayoutOptions.FillAndExpand, IsVisible = false }; this.listOfMatchesControl.UserWantsToDeleteScore += ctrl_UserWantsToDeleteScore; this.listOfMatchesControl.UserWantsToEditScore += ctrl_UserWantsToEditScore; this.listOfMatchesControl.UserWantsToViewScore += ctrl_UserWantsToViewScore; panelContent.Children.Add(this.listOfMatchesControl); // friends this.listOfOpponents = new ListOfOpponentsControl() { HorizontalOptions = LayoutOptions.FillAndExpand, IsVisible = false }; panelContent.Children.Add(this.listOfOpponents); // venues this.listOfVenues = new ListOfVenuesPlayedControl() { HorizontalOptions = LayoutOptions.FillAndExpand, IsVisible = false }; panelContent.Children.Add(this.listOfVenues); /// Grid /// this.RowDefinitions = new RowDefinitionCollection() { new RowDefinition() { Height = new GridLength(1, GridUnitType.Auto) }, new RowDefinition() { Height = new GridLength(1, GridUnitType.Auto) }, new RowDefinition() { Height = new GridLength(1, GridUnitType.Auto) }, new RowDefinition() { Height = new GridLength(1, GridUnitType.Star) }, }; this.ColumnDefinitions = new ColumnDefinitionCollection() { new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) } }; this.Children.Add(this.infoControl, 0, 0); this.Children.Add(this.panelMe, 0, 1); this.Children.Add(this.panelNotMe, 0, 1); this.Children.Add(gridWithButtons, 0, 2); this.Children.Add(panelContent, 0, 3); this.State = ProfilePersonStateEnum.Breaks; }
public FVOMainPage() { this.labelTitle = new BybLabel() { Text = "Pick Opponents", TextColor = Config.ColorTextOnBackgroundGrayed, FontSize = Config.VeryLargeFontSize, }; this.labelSyncStatus = new BybLabel() { Text = "", TextColor = Config.ColorTextOnBackground, FontSize = Config.LargerFontSize, HorizontalOptions = LayoutOptions.End, VerticalOptions = LayoutOptions.Center, }; /// selected players /// // player A imageA = new BybPersonImage() { WidthRequest = imageSize, HeightRequest = imageSize, HorizontalOptions = LayoutOptions.End, //.FillAndExpand, VerticalOptions = LayoutOptions.Start, //.FillAndExpand, BackgroundColor = Config.ColorBlackBackground, }; imageA.SetImagePickOpponent(); labelA = new BybLabel() { Text = "", TextColor = Config.ColorTextOnBackground, HeightRequest = 50, HorizontalOptions = LayoutOptions.Center, VerticalTextAlignment = TextAlignment.Center, HorizontalTextAlignment = TextAlignment.Center, }; var panelA = new StackLayout() { Orientation = StackOrientation.Vertical, BackgroundColor = Config.ColorBlackBackground, HorizontalOptions = LayoutOptions.End, Padding = new Thickness(0), Spacing = 0, Children = { imageA, labelA, } }; panelA.GestureRecognizers.Add(new TapGestureRecognizer() { Command = new Command(() => { this.panelA_Clicked(); }) }); // player B imageB = new BybPersonImage() { WidthRequest = imageSize, HeightRequest = imageSize, HorizontalOptions = LayoutOptions.Start, //.FillAndExpand, VerticalOptions = LayoutOptions.Start, //.FillAndExpand, BackgroundColor = Config.ColorBlackBackground, }; imageB.SetImagePickOpponent(); labelB = new BybLabel() { Text = "Select Player 2", TextColor = Config.ColorTextOnBackground, HeightRequest = 50, HorizontalOptions = LayoutOptions.Center, VerticalTextAlignment = TextAlignment.Center, HorizontalTextAlignment = TextAlignment.Center, }; var panelB = new StackLayout() { Orientation = StackOrientation.Vertical, BackgroundColor = Config.ColorBlackBackground, HorizontalOptions = LayoutOptions.Start, Padding = new Thickness(0), Spacing = 0, Children = { imageB, labelB, } }; panelB.GestureRecognizers.Add(new TapGestureRecognizer() { Command = new Command(() => { this.panelB_Clicked(); }) }); Grid gridSelectedPlayers = new Grid() { //BackgroundColor = Color.Red, HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center, Padding = new Thickness(0), ColumnSpacing = 0, RowSpacing = 0, RowDefinitions = new RowDefinitionCollection() { new RowDefinition() { Height = new GridLength(1, GridUnitType.Star) }, }, ColumnDefinitions = new ColumnDefinitionCollection() { new ColumnDefinition() { Width = new GridLength(0.01, GridUnitType.Star) }, new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) }, new ColumnDefinition() { Width = new GridLength(1.00, GridUnitType.Star) }, new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) }, new ColumnDefinition() { Width = new GridLength(0.01, GridUnitType.Star) }, } }; gridSelectedPlayers.Children.Add(panelA, 1, 0); gridSelectedPlayers.Children.Add(new Frame() { Padding = new Thickness(0, 0, 0, 50), HasShadow = false, BackgroundColor = Color.Transparent, Content = new BybLabel() { Text = "vs.", FontSize = Config.VeryLargeFontSize + 20, TextColor = Config.ColorTextOnBackgroundGrayed, VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center, VerticalTextAlignment = TextAlignment.Center, HorizontalTextAlignment = TextAlignment.Center, } }, 2, 0); gridSelectedPlayers.Children.Add(panelB, 3, 0); /// start/reset buttons /// this.buttonStartMatch = new BybButton() { Text = "Start Match", Style = (Style)App.Current.Resources["LargeButtonStyle"] }; buttonStartMatch.Clicked += buttonStartMatch_Clicked; this.buttonReset = new BybButton() { Text = "Reset", Style = (Style)App.Current.Resources["BlackButtonStyle"] }; buttonReset.Clicked += buttonReset_Clicked; /// bottom panel /// this.buttonSettings = new BybButton() { Text = "Settings", Style = (Style)App.Current.Resources["SimpleButtonStyle"], TextColor = Config.ColorTextOnBackground, VerticalOptions = LayoutOptions.Center, }; buttonSettings.Clicked += buttonSettings_Clicked; this.buttonHistory = new BybButton() { Text = "History", Style = (Style)App.Current.Resources["SimpleButtonStyle"], TextColor = Config.ColorTextOnBackground, VerticalOptions = LayoutOptions.Center, }; this.buttonHistory.Clicked += buttonHistory_Clicked; //this.buttonHistory = new BybLabel() //{ // Text = "History", // TextColor = Config.ColorTextOnBackground, // VerticalOptions = LayoutOptions.Center, // WidthRequest = 100, // HeightRequest = 40, // HorizontalTextAlignment = TextAlignment.End, // VerticalTextAlignment = TextAlignment.Center, //}; Label labelInfo = new BybLabel() { Text = "Tip: Install 'Snooker Byb' app on your personal mobile device.", HorizontalOptions = LayoutOptions.FillAndExpand, HorizontalTextAlignment = TextAlignment.Center, VerticalOptions = LayoutOptions.Center, TextColor = Config.ColorGrayTextOnWhite, }; StackLayout panelBottom = new StackLayout() { Orientation = StackOrientation.Horizontal, HorizontalOptions = LayoutOptions.FillAndExpand, Spacing = Config.TitleHeight, Padding = new Thickness(20, 0, 20, 0), BackgroundColor = Config.ColorBackground, Children = { buttonSettings, labelInfo, buttonHistory, } }; /// picking athletes panel /// // tab buttons this.buttonExisting = new BybButtonWithNumber("Existing") { IsNumberVisible = false, HeightRequest = Config.OkCancelButtonsHeight }; this.buttonExisting.Clicked += (s1, e1) => { this.registerControl.Clear(); this.PickingAthleteStatus = PickingAthleteStatusEnum.Existing; }; this.buttonRegister = new BybButtonWithNumber("Register") { IsNumberVisible = false, HeightRequest = Config.OkCancelButtonsHeight }; this.buttonRegister.Clicked += (s1, e1) => { if (this.alertAboutSettingsIfNecessary()) { return; } this.PickingAthleteStatus = PickingAthleteStatusEnum.Register; }; Grid panelPickingAthletes = new Grid() { HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, BackgroundColor = Config.ColorBackground, }; this.findPeopleControl = new FindPeopleControl(false); this.findPeopleControl.UserClickedOnPerson += findPeopleControl_UserClickedOnPerson; this.findPeopleControl.BackgroundColor = Config.ColorBackground; this.findPeopleControl.Padding = new Thickness(0, 60, 10, 0); this.registerControl = new FVORegisterControl(); this.registerControl.UserClickedCancel += registerControl_UserClickedCancel; this.registerControl.UserRegistered += registerControl_UserRegistered; this.registerControl.Padding = new Thickness(20, 80, 20, 20); panelPickingAthletes.Children.Add(this.findPeopleControl); panelPickingAthletes.Children.Add(this.registerControl); panelPickingAthletes.Children.Add(new StackLayout { Orientation = StackOrientation.Horizontal, BackgroundColor = Config.ColorBackground, Padding = new Thickness(0, 0, 0, 0), Spacing = 0, HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.Start, Children = { this.buttonExisting, this.buttonRegister, } }); /// layout /// Grid panelRoot = new Grid() { HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, Padding = new Thickness(0), ColumnSpacing = 0, RowSpacing = 0, RowDefinitions = new RowDefinitionCollection() { new RowDefinition() { Height = new GridLength(Config.TitleHeight, GridUnitType.Absolute) }, new RowDefinition() { Height = new GridLength(1, GridUnitType.Star) }, new RowDefinition() { Height = new GridLength(Config.TitleHeight - 20, GridUnitType.Absolute) }, }, ColumnDefinitions = new ColumnDefinitionCollection() { new ColumnDefinition() { Width = new GridLength(3, GridUnitType.Star) }, new ColumnDefinition() { Width = new GridLength(2, GridUnitType.Star) }, } }; panelRoot.Children.Add( new BybLabel() { Text = "Snooker Byb", FontSize = Config.VeryLargeFontSize, TextColor = Color.White, HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center, }, 0, 2, 0, 1); panelRoot.Children.Add( new StackLayout() { Orientation = StackOrientation.Horizontal, VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.End, Padding = new Thickness(0, 0, 20, 0), Children = { this.labelSyncStatus } }, 0, 2, 0, 1); panelRoot.Children.Add( new BoxView() { BackgroundColor = Config.ColorBackground, HeightRequest = 2, HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.End, }, 0, 2, 0, 1); panelRoot.Children.Add(new Frame() { HasShadow = false, BackgroundColor = Color.Transparent, Padding = new Thickness(40, 40, 0, 0), HorizontalOptions = LayoutOptions.Start, VerticalOptions = LayoutOptions.Start, Content = labelTitle }, 0, 1); panelRoot.Children.Add(panelBottom, 0, 2, 2, 3); panelRoot.Children.Add( new BoxView() { BackgroundColor = Config.ColorBlackBackground, HeightRequest = 2, HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.Start, }, 0, 2, 2, 3); panelRoot.Children.Add(new StackLayout() { Orientation = StackOrientation.Horizontal, VerticalOptions = LayoutOptions.End, HorizontalOptions = LayoutOptions.FillAndExpand, Padding = new Thickness(20, 0, 20, 20), Spacing = 0, Children = { buttonReset, buttonStartMatch, } }, 0, 1); panelRoot.Children.Add(gridSelectedPlayers, 0, 1); panelRoot.Children.Add(panelPickingAthletes, 1, 1); this.BackgroundColor = Config.ColorBlackBackground; this.Content = panelRoot; NavigationPage.SetHasNavigationBar(this, false); this.fill(); this.fillPickingAthletesPanel(); this.PickingAthleteStatus = PickingAthleteStatusEnum.Existing; App.Sync.StatusChanged += sync_StatusChanged; }
public ProfileVenueControl() { this.Padding = new Thickness(0); this.BackgroundColor = Config.ColorBackground; this.Spacing = 0; // Metro labelMetro = new BybLabel() { Text = "", Style = (Style)App.Current.Resources["LabelOnBackgroundStyle"], HorizontalOptions = LayoutOptions.Center }; // tables label10ftTables = new BybLabel() { Text = "", FontFamily = Config.FontFamily, FontAttributes = FontAttributes.Bold, FontSize = Config.LargerFontSize, BackgroundColor = Color.Transparent, TextColor = Config.ColorRedBackground, VerticalOptions = LayoutOptions.Center, VerticalTextAlignment = TextAlignment.Center }; label12ftTables = new BybLabel() { Text = "", FontFamily = Config.FontFamily, FontAttributes = FontAttributes.Bold, FontSize = Config.LargerFontSize, BackgroundColor = Color.Transparent, TextColor = Config.ColorRedBackground, VerticalOptions = LayoutOptions.Center, VerticalTextAlignment = TextAlignment.Center }; // panel: not verified this.panelNotVerifiedYet = new StackLayout() { BackgroundColor = Config.ColorBackground, Orientation = StackOrientation.Horizontal, Padding = new Thickness(0), Children = { new BybLabel { Text = "Not verified by the community yet", TextColor = Config.ColorTextOnBackgroundGrayed } } }; // panel verified this.labelVerifiedBy = new BybLabel() { VerticalTextAlignment = TextAlignment.Center, TextColor = Config.ColorTextOnBackground }; this.labelVerifiedBy.GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command(async() => { if (FullVenueData.Venue.LastContributorID > 0) { await App.Navigator.GoToPersonProfile(FullVenueData.Venue.LastContributorID); } }), NumberOfTapsRequired = 1 }); this.labelVerifiedOn = new BybLabel() { VerticalTextAlignment = TextAlignment.Center, TextColor = Config.ColorTextOnBackground }; this.panelVerified = new StackLayout() { Orientation = StackOrientation.Horizontal, Spacing = 2, HorizontalOptions = LayoutOptions.Center, Children = { new BybLabel { Text = "Verified by ", VerticalTextAlignment = TextAlignment.Center, TextColor = Config.ColorTextOnBackgroundGrayed }, labelVerifiedBy, new BybLabel { Text = " on ", VerticalTextAlignment = TextAlignment.Center, TextColor = Config.ColorTextOnBackgroundGrayed }, labelVerifiedOn } }; // panel: Invalid this.panelInvalid = new StackLayout() { Orientation = StackOrientation.Horizontal, HorizontalOptions = LayoutOptions.Center, Padding = new Thickness(0, 10, 0, 0), Children = { new BybLabel { Text = "The venue is closed-down (or invalid entry)", FontAttributes = FontAttributes.Bold, TextColor = Config.ColorTextOnBackground } } }; // map this.map = new Xamarin.Forms.Maps.Map() { HeightRequest = Config.IsTablet ? 200 : 160, HorizontalOptions = LayoutOptions.FillAndExpand, }; // website buttonWebsite = new BybLabel { Text = "", TextColor = Config.ColorTextOnBackground, HorizontalOptions = LayoutOptions.FillAndExpand, }; buttonWebsite.GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command(() => { if (FullVenueData.Venue.HasWebsite) { App.Navigator.OpenBrowserApp(FullVenueData.Venue.Website); } }), NumberOfTapsRequired = 1 }); this.panelAbout = new StackLayout() { BackgroundColor = Config.ColorBackground, Orientation = StackOrientation.Vertical, Spacing = 5, Padding = new Thickness(0, 0, 0, 0), Children = { labelMetro, new StackLayout { HorizontalOptions = LayoutOptions.Center, Padding = new Thickness(0, 0, 0, 0), Orientation = StackOrientation.Horizontal, Children = { new BybLabel { Text = "10' tables",VerticalTextAlignment = TextAlignment.Center, Style = (Style)App.Current.Resources["LabelOnBackgroundStyle"] }, label10ftTables, new BybLabel { Text = " 12' tables",VerticalTextAlignment = TextAlignment.Center, Style = (Style)App.Current.Resources["LabelOnBackgroundStyle"] }, label12ftTables, } }, this.panelInvalid, this.panelNotVerifiedYet, this.panelVerified, new StackLayout { Orientation = StackOrientation.Vertical, HorizontalOptions = LayoutOptions.FillAndExpand, Padding = new Thickness(0, 10, 0, 0), Children = { map } }, new StackLayout { Orientation = StackOrientation.Horizontal, HorizontalOptions = LayoutOptions.Center, Padding = new Thickness(0, 0, 0, 0), Children = { new BybLabel { Style = (Style)App.Current.Resources["LabelOnBackgroundStyle"], VerticalTextAlignment = TextAlignment.Center, HorizontalOptions = LayoutOptions.FillAndExpand, Text = "Website: " }, this.buttonWebsite } }, } }; this.Children.Add(panelAbout); /// Large buttons /// buttonPhoneNumber = new BybButton() { Text = "", Style = (Style)App.Current.Resources["BlackButtonStyle"] }; buttonPhoneNumber.Clicked += (s1, e1) => { if (FullVenueData.Venue.HasPhoneNumber) { App.Navigator.OpenPhoneCallApp(FullVenueData.Venue.PhoneNumber); } }; buttonDirections = new BybButton() { Text = "", Style = (Style)App.Current.Resources["BlackButtonStyle"] }; buttonDirections.Clicked += (s1, e1) => { if (FullVenueData.Venue.Location != null) { App.Navigator.OpenMapsApp(FullVenueData.Venue.Location, FullVenueData.Venue.Name, FullVenueData.Venue.Address); } }; this.buttonEdit = new BybButton() { Text = "Edit / verify", Style = (Style)App.Current.Resources["BlackButtonStyle"], }; this.buttonEdit.Clicked += buttonEdit_Clicked; this.panelWithLargeButtons = new Grid() { BackgroundColor = Config.ColorBackground, Padding = new Thickness(0, 10, 0, 10), ColumnSpacing = 0, RowSpacing = 0, RowDefinitions = new RowDefinitionCollection() { new RowDefinition { Height = new GridLength(Config.LargeButtonsHeight, GridUnitType.Absolute) }, }, ColumnDefinitions = new ColumnDefinitionCollection() { new ColumnDefinition { Width = new GridLength(10, GridUnitType.Absolute) }, new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }, new ColumnDefinition { Width = new GridLength(1, GridUnitType.Absolute) }, new ColumnDefinition { Width = new GridLength(0.8, GridUnitType.Star) }, new ColumnDefinition { Width = new GridLength(1, GridUnitType.Absolute) }, new ColumnDefinition { Width = new GridLength(0.8, GridUnitType.Star) }, new ColumnDefinition { Width = new GridLength(10, GridUnitType.Absolute) }, } }; panelWithLargeButtons.Children.Add(buttonPhoneNumber, 1, 0); panelWithLargeButtons.Children.Add(buttonDirections, 3, 0); panelWithLargeButtons.Children.Add(buttonEdit, 5, 0); this.Children.Add(panelWithLargeButtons); /// Tabs: Breaks / players / games /// this.buttonBreaks = new BybButtonWithNumber("Breaks") { IsNumberVisible = false }; buttonBreaks.Clicked += (s, e) => { this.State = ProfileVenueStateEnum.Breaks; }; this.buttonMatches = new BybButtonWithNumber("Matches") { IsNumberVisible = false }; buttonMatches.Clicked += (s, e) => { this.State = ProfileVenueStateEnum.Matches; }; this.buttonPeople = new BybButtonWithNumber("Players") { IsNumberVisible = false }; buttonPeople.Clicked += (s, e) => { this.State = ProfileVenueStateEnum.People; }; this.buttonGames = new BybButtonWithNumber("Invites") { IsNumberVisible = false }; buttonGames.Clicked += (s, e) => { this.State = ProfileVenueStateEnum.Games; }; Grid gridWithButtons = new Grid() { BackgroundColor = Config.ColorBackgroundWhite, Padding = new Thickness(0, 0, 0, 0), ColumnSpacing = 0, RowSpacing = 0, RowDefinitions = new RowDefinitionCollection() { new RowDefinition { Height = new GridLength(55, GridUnitType.Auto) }, }, ColumnDefinitions = new ColumnDefinitionCollection() { new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }, new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }, new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }, new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }, } }; gridWithButtons.Children.Add(buttonBreaks, 1, 0); gridWithButtons.Children.Add(buttonMatches, 2, 0); gridWithButtons.Children.Add(buttonPeople, 3, 0); gridWithButtons.Children.Add(buttonGames, 0, 0); this.Children.Add(gridWithButtons); StackLayout panelContent = new StackLayout() { Orientation = StackOrientation.Horizontal, HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, BackgroundColor = Config.ColorGrayBackground, }; // breaks this.listOfBreaksControl = new ListOfSnookerBreaksControl() { HorizontalOptions = LayoutOptions.FillAndExpand, IsVisible = true, Type = ListTypeEnum.Venue, SortType = SnookerBreakSortEnum.ByPoints, }; panelContent.Children.Add(this.listOfBreaksControl); // matches this.listOfMatchesControl = new ListOfSnookerMatchesControl() { HorizontalOptions = LayoutOptions.FillAndExpand, IsVisible = false, }; panelContent.Children.Add(this.listOfMatchesControl); // game hosts this.listOfGameHostsControlFuture = new ListOfGameHostsControl() { HorizontalOptions = LayoutOptions.FillAndExpand, Padding = new Thickness(5, 5, 5, 5), IsForPast = false, ShowCommentsCount = true, }; this.listOfGameHostsControlPast = new ListOfGameHostsControl() { HorizontalOptions = LayoutOptions.FillAndExpand, Padding = new Thickness(5, 5, 5, 5), IsForPast = true }; this.buttonNewGameHost = new BybButton() { Style = (Style)App.Current.Resources["SimpleButtonStyle"], HorizontalOptions = LayoutOptions.Start, Text = "Make a New Invite" }; buttonNewGameHost.Clicked += buttonNewGameHost_Clicked; this.panelGameHosts = new StackLayout() { Orientation = StackOrientation.Vertical, HorizontalOptions = LayoutOptions.FillAndExpand, IsVisible = false, Padding = new Thickness(5, 5, 5, 5), Children = { new StackLayout { Padding = new Thickness(5, 0, 0, 0), Children = { buttonNewGameHost, } }, new StackLayout { Padding = new Thickness(5, 10, 0, 0), Children = { new BybLabel { Text = "Active Invites", TextColor = Config.ColorGrayTextOnWhite, HorizontalTextAlignment = TextAlignment.Start, }, } }, //this.panelNoInvitesFuture, this.listOfGameHostsControlFuture, new StackLayout { Padding = new Thickness(5, 10, 0, 0), Children = { new BybLabel { Text = "Past Invites", TextColor = Config.ColorGrayTextOnWhite, HorizontalTextAlignment = TextAlignment.Start, }, } }, this.listOfGameHostsControlPast, } }; panelContent.Children.Add(this.panelGameHosts); // people this.listOfPeopleControl = new ListOfPeopleControl() { IsVisible = false, }; this.listOfPeopleControl.UserClickedOnPerson += async(s, e) => { await App.Navigator.GoToPersonProfile(e.Person.ID); }; panelContent.Children.Add(this.listOfPeopleControl); this.Children.Add(panelContent); this.State = ProfileVenueStateEnum.Games; }