private void BuildPageObjects() { var btnSize = Device.GetNamedSize(NamedSize.Large, typeof(Button)); var lblSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)); var entrySize = Device.GetNamedSize(NamedSize.Large, typeof(Entry)); stackLayout = new StackLayout(); scrollView = new ScrollView(); buttonGrid = new Grid { RowDefinitions = new RowDefinitionCollection { new RowDefinition { Height = new GridLength(1, GridUnitType.Star) } }, ColumnDefinitions = new ColumnDefinitionCollection { new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }, new ColumnDefinition { Width = new GridLength(3, GridUnitType.Star) } } }; headerLbl = new Label { Text = "Change Password", #if __IOS__ FontFamily = "AmericanTypewriter-Bold", FontSize = lblSize * 2, #endif #if __ANDROID__ FontFamily = "Roboto Bold", FontSize = lblSize, #endif VerticalTextAlignment = TextAlignment.Center, HorizontalTextAlignment = TextAlignment.Center, VerticalOptions = LayoutOptions.StartAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand }; secretQuestionLbl = new Label { Text = _user.SecretQuestion, #if __IOS__ FontFamily = "AmericanTypewriter-Bold", FontSize = lblSize * 1.5, #endif #if __ANDROID__ FontFamily = "Roboto Bold", FontSize = lblSize * .75, #endif VerticalTextAlignment = TextAlignment.Center, HorizontalTextAlignment = TextAlignment.Center, VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand }; secretQuestionEntry = new Entry { #if __IOS__ FontFamily = "AmericanTypewriter-Bold", FontSize = entrySize * 1.5, #endif #if __ANDROID__ FontFamily = "Roboto Bold", FontSize = entrySize * .75, #endif VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand }; newPasswordLbl = new Label { Text = "New Password", #if __IOS__ FontFamily = "AmericanTypewriter-Bold", FontSize = lblSize * 1.5, #endif #if __ANDROID__ FontFamily = "Roboto Bold", FontSize = lblSize * .75, #endif VerticalTextAlignment = TextAlignment.Center, HorizontalTextAlignment = TextAlignment.Center, VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand }; newPasswordEntry = new Entry { #if __IOS__ FontFamily = "AmericanTypewriter-Bold", FontSize = entrySize * 1.5, #endif #if __ANDROID__ FontFamily = "Roboto Bold", FontSize = entrySize * .75, #endif IsPassword = true, VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand }; backBtn = new Button { Image = "back.png", Style = (Style)Application.Current.Resources["common-red-btn"] }; submitBtn = new Button { Style = (Style)Application.Current.Resources["common-blue-btn"], #if __IOS__ FontFamily = "AmericanTypewriter-Bold", FontSize = btnSize * 1.5, #endif #if __ANDROID__ FontFamily = "Roboto Bold", FontSize = btnSize * .75, #endif Text = "Submit" }; #if __ANDROID__ var pd = new PaintDrawable(Android.Graphics.Color.Rgb(58, 93, 174)); pd.SetCornerRadius(100); innerGrid = new Grid(); innerGrid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(2, GridUnitType.Star) }); innerGrid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }); innerGrid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }); innerGrid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }); innerGrid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }); innerGrid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }); innerGrid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }); innerGrid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }); innerGrid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }); innerGrid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }); innerGrid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(2, GridUnitType.Star) }); outerGrid = new Grid(); outerGrid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }); androidSecretQuestionLbl = new Android.Widget.TextView(MainApplication.ActivityContext); androidSecretQuestionLbl.Text = _user.SecretQuestion; androidSecretQuestionLbl.Typeface = Constants.COMMONFONT; androidSecretQuestionLbl.SetAutoSizeTextTypeWithDefaults(Android.Widget.AutoSizeTextType.Uniform); androidSecretQuestionLbl.SetTextColor(Android.Graphics.Color.Black); androidSecretQuestionLbl.Gravity = Android.Views.GravityFlags.Center; androidSecretQuestionEntry = new Android.Widget.EditText(MainApplication.ActivityContext); androidSecretQuestionEntry.Typeface = Constants.COMMONFONT; androidSecretQuestionEntry.SetTextSize(Android.Util.ComplexUnitType.Fraction, 75); androidSecretQuestionEntry.SetTextColor(Android.Graphics.Color.Black); androidSecretQuestionEntry.Gravity = Android.Views.GravityFlags.Start; androidSecretQuestionEntry.InputType = Android.Text.InputTypes.TextVariationShortMessage; androidNewPasswordLbl = new Android.Widget.TextView(MainApplication.ActivityContext); androidNewPasswordLbl.Text = "New Password"; androidNewPasswordLbl.Typeface = Constants.COMMONFONT; androidNewPasswordLbl.SetAutoSizeTextTypeWithDefaults(Android.Widget.AutoSizeTextType.Uniform); androidNewPasswordLbl.SetTextColor(Android.Graphics.Color.Black); androidNewPasswordLbl.Gravity = Android.Views.GravityFlags.Center; androidNewPasswordEntry = new Android.Widget.EditText(MainApplication.ActivityContext); androidNewPasswordEntry.Typeface = Constants.COMMONFONT; androidNewPasswordEntry.SetTextSize(Android.Util.ComplexUnitType.Fraction, 75); androidNewPasswordEntry.SetTextColor(Android.Graphics.Color.Black); androidNewPasswordEntry.Gravity = Android.Views.GravityFlags.Start; androidNewPasswordEntry.InputType = Android.Text.InputTypes.TextVariationPassword; androidNewPasswordEntry.TransformationMethod = new PasswordTransformationMethod(); androidSubmitBtn = new Android.Widget.Button(MainApplication.ActivityContext); androidSubmitBtn.Text = "Change Password"; androidSubmitBtn.Typeface = Constants.COMMONFONT; androidSubmitBtn.SetAutoSizeTextTypeWithDefaults(Android.Widget.AutoSizeTextType.Uniform); androidSubmitBtn.SetTextColor(Android.Graphics.Color.Rgb(242, 253, 255)); androidSubmitBtn.SetBackground(pd); androidSubmitBtn.SetAllCaps(false); androidSubmitBtn.Click += async(object sender, EventArgs e) => { ToggleButtons(); await ChangePassword(sender, e); ToggleButtons(); }; contentViewAndroidSecretQuestionLbl = new ContentView(); contentViewAndroidSecretQuestionLbl.Content = androidSecretQuestionLbl.ToView(); contentViewAndroidSecretQuestionEntry = new ContentView(); contentViewAndroidSecretQuestionEntry.Content = androidSecretQuestionEntry.ToView(); contentViewAndroidNewPasswordLbl = new ContentView(); contentViewAndroidNewPasswordLbl.Content = androidNewPasswordLbl.ToView(); contentViewAndroidNewPasswordEntry = new ContentView(); contentViewAndroidNewPasswordEntry.Content = androidNewPasswordEntry.ToView(); contentViewAndroidSubmitBtn = new ContentView(); contentViewAndroidSubmitBtn.Content = androidSubmitBtn.ToView(); #endif //events backBtn.Clicked += (sender, e) => { backBtn.IsEnabled = false; Navigation.PopModalAsync(); backBtn.IsEnabled = true; }; submitBtn.Clicked += async(object sender, EventArgs e) => { ToggleButtons(); await ChangePassword(sender, e); ToggleButtons(); }; //layout #if __ANDROID__ innerGrid.Children.Add(contentViewAndroidSecretQuestionLbl, 0, 3); innerGrid.Children.Add(contentViewAndroidSecretQuestionEntry, 0, 4); innerGrid.Children.Add(contentViewAndroidNewPasswordLbl, 0, 6); innerGrid.Children.Add(contentViewAndroidNewPasswordEntry, 0, 7); innerGrid.Children.Add(contentViewAndroidSubmitBtn, 0, 10); outerGrid.Children.Add(innerGrid, 0, 0); Content = outerGrid; #endif #if __IOS__ buttonGrid.Children.Add(backBtn, 0, 0); buttonGrid.Children.Add(submitBtn, 1, 0); stackLayout.Children.Add(headerLbl); stackLayout.Children.Add(secretQuestionLbl); stackLayout.Children.Add(secretQuestionEntry); stackLayout.Children.Add(newPasswordLbl); stackLayout.Children.Add(newPasswordEntry); stackLayout.Children.Add(buttonGrid); scrollView.Content = stackLayout; Content = scrollView; #endif }
private void BuildPageObjects() { var lblSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)); var btnSize = Device.GetNamedSize(NamedSize.Large, typeof(Button)); innerGrid = new Grid { RowDefinitions = new RowDefinitionCollection { new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }, new RowDefinition { Height = new GridLength(2, GridUnitType.Star) }, new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }, new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }, new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }, new RowDefinition { Height = new GridLength(1, GridUnitType.Star) } }, ColumnDefinitions = new ColumnDefinitionCollection { new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }, new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) } } }; outerGrid = new Grid { RowDefinitions = new RowDefinitionCollection { new RowDefinition { Height = new GridLength(1, GridUnitType.Star) } } }; #if __ANDROID__ var pd = new PaintDrawable(Android.Graphics.Color.Rgb(58, 93, 174)); pd.SetCornerRadius(100); androidVideo1Lbl = new Android.Widget.TextView(MainApplication.ActivityContext); androidVideo1Lbl.Text = "Spider Guard Stuff!"; androidVideo1Lbl.Typeface = Constants.COMMONFONT; androidVideo1Lbl.SetTextSize(Android.Util.ComplexUnitType.Fraction, 75); androidVideo1Lbl.SetTextColor(Android.Graphics.Color.Rgb(241, 236, 206)); androidVideo1Lbl.Gravity = Android.Views.GravityFlags.Center; androidVideo1Lbl.Click += async(object sender, EventArgs e) => { ToggleButtons(); VideoData video = VimeoInfo.data[0]; await Navigation.PushModalAsync(new VideoDetailPage(video)); ToggleButtons(); }; androidVideo1Lbl.SetTypeface(androidVideo1Lbl.Typeface, Android.Graphics.TypefaceStyle.Bold); contentViewVideo1Lbl = new ContentView(); contentViewVideo1Lbl.Content = androidVideo1Lbl.ToView(); androidVideo2Lbl = new Android.Widget.TextView(MainApplication.ActivityContext); androidVideo2Lbl.Text = "Spider Guard Stuff!"; androidVideo2Lbl.Typeface = Constants.COMMONFONT; androidVideo2Lbl.SetTextSize(Android.Util.ComplexUnitType.Fraction, 75); androidVideo2Lbl.SetTextColor(Android.Graphics.Color.Rgb(241, 236, 206)); androidVideo2Lbl.Gravity = Android.Views.GravityFlags.Center; androidVideo2Lbl.Click += async(object sender, EventArgs e) => { ToggleButtons(); VideoData video = VimeoInfo.data[1]; await Navigation.PushModalAsync(new VideoDetailPage(video)); ToggleButtons(); }; androidVideo2Lbl.SetTypeface(androidVideo2Lbl.Typeface, Android.Graphics.TypefaceStyle.Bold); contentViewVideo2Lbl = new ContentView(); contentViewVideo2Lbl.Content = androidVideo2Lbl.ToView(); androidWhatsNewLbl = new Android.Widget.TextView(MainApplication.ActivityContext); androidWhatsNewLbl.Text = "What's New"; androidWhatsNewLbl.Typeface = Constants.COMMONFONT; androidWhatsNewLbl.SetAutoSizeTextTypeWithDefaults(Android.Widget.AutoSizeTextType.Uniform); androidWhatsNewLbl.SetTextColor(Android.Graphics.Color.Black); androidWhatsNewLbl.Gravity = Android.Views.GravityFlags.Center; contenViewWhatsNewLbl = new ContentView(); contenViewWhatsNewLbl.Content = androidWhatsNewLbl.ToView(); androidPlayListLbl = new Android.Widget.TextView(MainApplication.ActivityContext); androidPlayListLbl.Text = "Playlists"; androidPlayListLbl.Typeface = Constants.COMMONFONT; androidPlayListLbl.SetAutoSizeTextTypeWithDefaults(Android.Widget.AutoSizeTextType.Uniform); androidPlayListLbl.SetTextColor(Android.Graphics.Color.Black); androidPlayListLbl.Gravity = Android.Views.GravityFlags.Center; contentViewPlayListLbl = new ContentView(); contentViewPlayListLbl.Content = androidPlayListLbl.ToView(); androidAddPlaylistBtn = new Android.Widget.Button(MainApplication.ActivityContext); androidAddPlaylistBtn.Text = "Create"; androidAddPlaylistBtn.Typeface = Constants.COMMONFONT; androidAddPlaylistBtn.SetAutoSizeTextTypeWithDefaults(Android.Widget.AutoSizeTextType.Uniform); androidAddPlaylistBtn.SetBackground(pd); androidAddPlaylistBtn.SetTextColor(Android.Graphics.Color.Rgb(242, 253, 255)); androidAddPlaylistBtn.Gravity = Android.Views.GravityFlags.Center; androidAddPlaylistBtn.SetAllCaps(false); androidAddPlaylistBtn.Click += async(object sender, EventArgs e) => { ToggleButtons(); await Navigation.PushModalAsync(new PlaylistCreatePage()); ToggleButtons(); }; androidViewPlaylistBtn = new Android.Widget.Button(MainApplication.ActivityContext); androidViewPlaylistBtn.Text = "View"; androidViewPlaylistBtn.Typeface = Constants.COMMONFONT; androidViewPlaylistBtn.SetAutoSizeTextTypeWithDefaults(Android.Widget.AutoSizeTextType.Uniform); androidViewPlaylistBtn.SetBackground(pd); androidViewPlaylistBtn.SetTextColor(Android.Graphics.Color.Rgb(242, 253, 255)); androidViewPlaylistBtn.Gravity = Android.Views.GravityFlags.Center; androidViewPlaylistBtn.SetAllCaps(false); androidViewPlaylistBtn.Click += async(object sender, EventArgs e) => { ToggleButtons(); await Navigation.PushModalAsync(new PlaylistViewPage()); ToggleButtons(); }; #endif whatsNewLbl = new Label { Text = "What's New", #if __IOS__ FontFamily = "AmericanTypewriter-Bold", FontSize = lblSize * 2, #endif #if __ANDROID__ FontFamily = "Roboto Bold", FontSize = lblSize, #endif VerticalTextAlignment = TextAlignment.End, HorizontalTextAlignment = TextAlignment.Center }; video1Image = new Image { Aspect = Aspect.AspectFill }; video1Frame = new Frame { Content = video1Image, BorderColor = Color.Black, BackgroundColor = Color.Black, HasShadow = false, Padding = 3 }; video1Lbl = new Label { #if __IOS__ FontFamily = "AmericanTypewriter-Bold", FontSize = lblSize, #endif #if __ANDROID__ FontFamily = "Roboto Bold", FontSize = lblSize * .75, #endif Text = "Spider Guard Stuff!", Style = (Style)Application.Current.Resources["common-technique-lbl"] }; video1Tap = new TapGestureRecognizer(); video1Tap.Tapped += async(sender, e) => { ToggleButtons(); VideoData video = VimeoInfo.data[0]; await Navigation.PushModalAsync(new VideoDetailPage(video)); ToggleButtons(); }; video1Lbl.GestureRecognizers.Add(video1Tap); video2Image = new Image { Aspect = Aspect.AspectFill }; video2Frame = new Frame { Content = video2Image, BorderColor = Color.Black, BackgroundColor = Color.Black, HasShadow = false, Padding = 3 }; video2Lbl = new Label { #if __IOS__ FontFamily = "AmericanTypewriter-Bold", FontSize = lblSize, #endif #if __ANDROID__ FontFamily = "Roboto Bold", FontSize = lblSize * .75, #endif Text = "Spider Guard Stuff!", Style = (Style)Application.Current.Resources["common-technique-lbl"] }; video2Tap = new TapGestureRecognizer(); video2Tap.Tapped += async(sender, e) => { ToggleButtons(); VideoData video = VimeoInfo.data[1]; await Navigation.PushModalAsync(new VideoDetailPage(video)); ToggleButtons(); }; video2Lbl.GestureRecognizers.Add(video2Tap); playListLbl = new Label { Text = "Playlists", #if __IOS__ FontFamily = "AmericanTypewriter-Bold", FontSize = lblSize * 2, #endif #if __ANDROID__ FontFamily = "Roboto Bold", FontSize = lblSize, #endif VerticalTextAlignment = TextAlignment.Center, HorizontalTextAlignment = TextAlignment.Center, }; addPlaylistBtn = new Button { Style = (Style)Application.Current.Resources["common-blue-btn"], Text = "Create", #if __IOS__ FontSize = btnSize * 1.5, #endif #if __ANDROID__ FontFamily = "Roboto Bold", FontSize = btnSize * .75, Margin = -5, #endif }; viewPlaylistBtn = new Button { Style = (Style)Application.Current.Resources["common-blue-btn"], Text = "View", #if __IOS__ FontSize = btnSize * 1.5, #endif #if __ANDROID__ FontFamily = "Roboto Bold", FontSize = btnSize * .75, Margin = -5, #endif }; timeOutLbl = new Label { #if __IOS__ FontFamily = "AmericanTypewriter-Bold", #endif #if __ANDROID__ FontFamily = "Roboto Bold", #endif Text = "Network Has Timed Out! \n Click To Try Again!", LineBreakMode = LineBreakMode.WordWrap, FontSize = lblSize, VerticalTextAlignment = TextAlignment.Center, HorizontalTextAlignment = TextAlignment.Center, HorizontalOptions = LayoutOptions.CenterAndExpand, VerticalOptions = LayoutOptions.CenterAndExpand, TextColor = Color.White }; timeOutFrame = new Frame { Content = timeOutLbl, BorderColor = Color.Black, BackgroundColor = Color.Black, HasShadow = false, Padding = 3, HorizontalOptions = LayoutOptions.CenterAndExpand, VerticalOptions = LayoutOptions.CenterAndExpand }; timeOutTap = new TapGestureRecognizer(); timeOutTap.Tapped += (sender, e) => { ToggleButtons(); SetContent(this.account); ToggleButtons(); }; timeOutLbl.GestureRecognizers.Add(timeOutTap); activityIndicator = new ActivityIndicator { Style = (Style)Application.Current.Resources["common-activity-indicator"] }; //events addPlaylistBtn.Clicked += async(object sender, EventArgs e) => { ToggleButtons(); await Navigation.PushModalAsync(new PlaylistCreatePage()); ToggleButtons(); }; viewPlaylistBtn.Clicked += async(object sender, EventArgs e) => { ToggleButtons(); await Navigation.PushModalAsync(new PlaylistViewPage()); ToggleButtons(); }; outerGrid.Children.Add(innerGrid, 0, 0); Content = outerGrid; }
//Functions private void SetContent() { var lblSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)); var btnSize = Device.GetNamedSize(NamedSize.Large, typeof(Button)); innerGrid = new Grid { RowDefinitions = new RowDefinitionCollection { new RowDefinition { Height = new GridLength(3, GridUnitType.Star) }, new RowDefinition { Height = new GridLength(2, GridUnitType.Star) } } }; outerGrid = new Grid { RowDefinitions = new RowDefinitionCollection { new RowDefinition { Height = new GridLength(1, GridUnitType.Star) } } }; stackLayout = new StackLayout(); scrollView = new ScrollView(); #if __ANDROID__ androidBlogLbl = new Android.Widget.TextView(MainApplication.ActivityContext); androidBlogLbl.Text = "Blog"; androidBlogLbl.Typeface = Constants.COMMONFONT; androidBlogLbl.SetAutoSizeTextTypeWithDefaults(Android.Widget.AutoSizeTextType.Uniform); androidBlogLbl.SetTextColor(Android.Graphics.Color.Rgb(241, 236, 206)); androidBlogLbl.Gravity = Android.Views.GravityFlags.Center; androidBlogLbl.Click += async(object sender, EventArgs e) => { ToggleButtons(); await Navigation.PushModalAsync(new BlogViewPage()); ToggleButtons(); }; #endif sweepLbl = new Label { Style = (Style)Application.Current.Resources["common-blue-lbl"], Text = "Sweep", #if __IOS__ FontFamily = "AmericanTypewriter-Bold", FontSize = lblSize #endif #if __ANDROID__ FontFamily = "american_typewriter_bold_bt.ttf#american_typewriter_bold_bt", FontSize = lblSize * 1.5, FontAttributes = FontAttributes.Bold #endif }; sweepTap = new TapGestureRecognizer(); sweepTap.Tapped += async(sender, e) => { ToggleButtons(); account = _baseViewModel.GetAccountInformation(); if (account.Properties["Package"] == "Gi") { await Navigation.PushModalAsync(new SearchPage(Album.GiSweep)); } else if (account.Properties["Package"] == "NoGi") { await Navigation.PushModalAsync(new SearchPage(Album.NoGiSweep)); } else { await Navigation.PushModalAsync(new SearchPage(Album.Sweep)); } ToggleButtons(); }; sweepLbl.GestureRecognizers.Add(sweepTap); sweepFrame = new Frame { BackgroundColor = Color.FromRgb(58, 93, 174), HasShadow = false, BorderColor = Color.Black, Content = sweepLbl, Padding = new Thickness(10, 10, 10, 10) }; takeDownLbl = new Label { Style = (Style)Application.Current.Resources["common-blue-lbl"], Text = "Take Down", #if __IOS__ FontFamily = "AmericanTypewriter-Bold", FontSize = lblSize #endif #if __ANDROID__ FontFamily = "american_typewriter_bold_bt.ttf#american_typewriter_bold_bt", FontSize = lblSize * 1.5, FontAttributes = FontAttributes.Bold #endif }; takeDownTap = new TapGestureRecognizer(); takeDownTap.Tapped += async(sender, e) => { ToggleButtons(); account = _baseViewModel.GetAccountInformation(); if (account.Properties["Package"] == "Gi") { await Navigation.PushModalAsync(new SearchPage(Album.GiTakeDown)); } else if (account.Properties["Package"] == "NoGi") { await Navigation.PushModalAsync(new SearchPage(Album.NoGiTakeDown)); } else { await Navigation.PushModalAsync(new SearchPage(Album.TakeDown)); } ToggleButtons(); }; takeDownLbl.GestureRecognizers.Add(takeDownTap); takeDownFrame = new Frame { BackgroundColor = Color.FromRgb(58, 93, 174), HasShadow = false, BorderColor = Color.Black, Content = takeDownLbl, Padding = new Thickness(10, 10, 10, 10) }; submissionLbl = new Label { Style = (Style)Application.Current.Resources["common-blue-lbl"], Text = "Submission", #if __IOS__ FontFamily = "AmericanTypewriter-Bold", FontSize = lblSize #endif #if __ANDROID__ FontFamily = "american_typewriter_bold_bt.ttf#american_typewriter_bold_bt", FontSize = lblSize * 1.5, FontAttributes = FontAttributes.Bold #endif }; submissionTap = new TapGestureRecognizer(); submissionTap.Tapped += async(sender, e) => { ToggleButtons(); account = _baseViewModel.GetAccountInformation(); if (account.Properties["Package"] == "Gi") { await Navigation.PushModalAsync(new SearchPage(Album.GiSubmission)); } else if (account.Properties["Package"] == "NoGi") { await Navigation.PushModalAsync(new SearchPage(Album.NoGiSubmission)); } else { await Navigation.PushModalAsync(new SearchPage(Album.Submission)); } ToggleButtons(); }; submissionLbl.GestureRecognizers.Add(submissionTap); submissionFrame = new Frame { BackgroundColor = Color.FromRgb(58, 93, 174), HasShadow = false, BorderColor = Color.Black, Content = submissionLbl, Padding = new Thickness(10, 10, 10, 10) }; guardPassLbl = new Label { Style = (Style)Application.Current.Resources["common-blue-lbl"], Text = "Guard Pass", #if __IOS__ FontFamily = "AmericanTypewriter-Bold", FontSize = lblSize #endif #if __ANDROID__ FontFamily = "american_typewriter_bold_bt.ttf#american_typewriter_bold_bt", FontSize = lblSize * 1.5, FontAttributes = FontAttributes.Bold #endif }; guardPassTap = new TapGestureRecognizer(); guardPassTap.Tapped += async(sender, e) => { ToggleButtons(); account = _baseViewModel.GetAccountInformation(); if (account.Properties["Package"] == "Gi") { await Navigation.PushModalAsync(new SearchPage(Album.GiGuardPass)); } else if (account.Properties["Package"] == "NoGi") { await Navigation.PushModalAsync(new SearchPage(Album.NoGiGuardPass)); } else { await Navigation.PushModalAsync(new SearchPage(Album.GuardPass)); } ToggleButtons(); }; guardPassLbl.GestureRecognizers.Add(guardPassTap); guardPassFrame = new Frame { BackgroundColor = Color.FromRgb(58, 93, 174), HasShadow = false, BorderColor = Color.Black, Content = guardPassLbl, Padding = new Thickness(10, 10, 10, 10) }; defenseLbl = new Label { Style = (Style)Application.Current.Resources["common-blue-lbl"], Text = "Defense", #if __IOS__ FontFamily = "AmericanTypewriter-Bold", FontSize = lblSize #endif #if __ANDROID__ FontFamily = "american_typewriter_bold_bt.ttf#american_typewriter_bold_bt", FontSize = lblSize * 1.5, FontAttributes = FontAttributes.Bold #endif }; defenseTap = new TapGestureRecognizer(); defenseTap.Tapped += async(sender, e) => { ToggleButtons(); account = _baseViewModel.GetAccountInformation(); if (account.Properties["Package"] == "Gi") { await Navigation.PushModalAsync(new SearchPage(Album.GiDefense)); } else if (account.Properties["Package"] == "NoGi") { await Navigation.PushModalAsync(new SearchPage(Album.NoGiDefense)); } else { await Navigation.PushModalAsync(new SearchPage(Album.Defense)); } ToggleButtons(); }; defenseLbl.GestureRecognizers.Add(defenseTap); defenseFrame = new Frame { BackgroundColor = Color.FromRgb(58, 93, 174), HasShadow = false, BorderColor = Color.Black, Content = defenseLbl, Padding = new Thickness(10, 10, 10, 10) }; backTakeLbl = new Label { Style = (Style)Application.Current.Resources["common-blue-lbl"], Text = "Back Take", #if __IOS__ FontFamily = "AmericanTypewriter-Bold", FontSize = lblSize #endif #if __ANDROID__ FontFamily = "american_typewriter_bold_bt.ttf#american_typewriter_bold_bt", FontSize = lblSize * 1.5, FontAttributes = FontAttributes.Bold #endif }; backTakeTap = new TapGestureRecognizer(); backTakeTap.Tapped += async(sender, e) => { ToggleButtons(); account = _baseViewModel.GetAccountInformation(); if (account.Properties["Package"] == "Gi") { await Navigation.PushModalAsync(new SearchPage(Album.GiBackTake)); } else if (account.Properties["Package"] == "NoGi") { await Navigation.PushModalAsync(new SearchPage(Album.NoGiBackTake)); } else { await Navigation.PushModalAsync(new SearchPage(Album.BackTake)); } ToggleButtons(); }; backTakeLbl.GestureRecognizers.Add(backTakeTap); backTakeFrame = new Frame { BackgroundColor = Color.FromRgb(58, 93, 174), HasShadow = false, BorderColor = Color.Black, #if __ANDROID__ Content = backTakeLbl, #endif #if __IOS__ Content = backTakeLbl, #endif Padding = new Thickness(10, 10, 10, 10) }; drillsLbl = new Label { Style = (Style)Application.Current.Resources["common-blue-lbl"], Text = "Drills", #if __IOS__ FontFamily = "AmericanTypewriter-Bold", FontSize = lblSize #endif #if __ANDROID__ FontFamily = "american_typewriter_bold_bt.ttf#american_typewriter_bold_bt", FontSize = lblSize * 1.5, FontAttributes = FontAttributes.Bold #endif }; drillsTap = new TapGestureRecognizer(); drillsTap.Tapped += async(object sender, EventArgs e) => { ToggleButtons(); account = _baseViewModel.GetAccountInformation(); if (account.Properties["Package"] == "Gi") { await Navigation.PushModalAsync(new SearchPage(Album.GiDrills)); } else if (account.Properties["Package"] == "NoGi") { await Navigation.PushModalAsync(new SearchPage(Album.NoGiDrills)); } else { await Navigation.PushModalAsync(new SearchPage(Album.Drills)); } ToggleButtons(); }; drillsLbl.GestureRecognizers.Add(drillsTap); drillsFrame = new Frame { BackgroundColor = Color.FromRgb(58, 93, 174), HasShadow = false, BorderColor = Color.Black, Content = drillsLbl, Padding = new Thickness(10, 10, 10, 10) }; //blog objects blogLbl = new Label { Style = (Style)Application.Current.Resources["common-technique-lbl"], Text = "Blog", #if __IOS__ FontFamily = "AmericanTypewriter-Bold", #endif FontSize = lblSize * 2 }; blogTap = new TapGestureRecognizer(); blogTap.Tapped += async(sender, e) => { ToggleButtons(); await Navigation.PushModalAsync(new BlogViewPage()); ToggleButtons(); }; blogLbl.GestureRecognizers.Add(blogTap); blogImage = new Image { Aspect = Aspect.AspectFill, Source = ImageSource.FromFile("blog.jpg") }; blogFrame = new Frame { Content = blogImage, BorderColor = Color.Black, BackgroundColor = Color.Black, HasShadow = false, Padding = 3 }; //Events //adding children stackLayout.Children.Add(sweepFrame); stackLayout.Children.Add(takeDownFrame); stackLayout.Children.Add(submissionFrame); stackLayout.Children.Add(guardPassFrame); stackLayout.Children.Add(defenseFrame); stackLayout.Children.Add(backTakeFrame); stackLayout.Children.Add(drillsFrame); scrollView.Content = stackLayout; #if __ANDROID__ scrollView.IsClippedToBounds = true; #endif innerGrid.Children.Add(scrollView, 0, 0); innerGrid.Children.Add(blogFrame, 0, 1); #if __ANDROID__ innerGrid.Children.Add(androidBlogLbl.ToView(), 0, 1); #endif #if __IOS__ innerGrid.Children.Add(blogLbl, 0, 1); #endif outerGrid.Children.Add(innerGrid, 0, 0); Content = outerGrid; }