/////////// IN SIGN-IN-LOADING-PAGE NOW /////////////////////////// //private void APIGetSuccess(string result) { // api_success_count++; // DebugLabel.Text = "successful apiGET no. " + api_success_count; // if (result == "no user found") { // DebugLabel.Text = "No user found that has the key.\r\n\r\nTrying again..."; // CheckIfUserSignedIn(GenerateNewKey()); // } else { // GoToRegisterInfoUserPage(); // } //} //private void APIGetResIsNull() { // DebugLabel.Text = "result == null"; //} //private void APIGetException(string exception) { // DebugLabel.Text = "EXCEPTION:\r\n" + exception; //} private void GoToRegisterInfoUserPage() { Navigation.PushAsync(new RegisterUserInfoPage()); Navigation.RemovePage(this); PlatformIndep.IDroidButtonsBar statusbarc = DependencyService.Get <PlatformIndep.IDroidButtonsBar>(); statusbarc?.SetDroidButtonsBarWhite(); }
public SignInPage() { InitializeComponent(); PlatformIndep.IDroidButtonsBar statusbarc = DependencyService.Get <PlatformIndep.IDroidButtonsBar>(); statusbarc?.SetDroidButtonsBarRed(); //first_success = new DateTime(1, 1, 1, 1, 1, 1); }
//called in App.xaml.cs OnResume() public void StartLoadingSignIn() { if (browser_opened) { Navigation.PushAsync(new SignInLoadingPage(random_key)); Navigation.RemovePage(this); PlatformIndep.IDroidButtonsBar statusbarc = DependencyService.Get <PlatformIndep.IDroidButtonsBar>(); statusbarc?.SetDroidButtonsBarWhite(); } }
private void FakeSignInClicked(object sender, EventArgs e) { if (true) { Navigation.PushAsync(new RegisterUserInfoPage()); Navigation.RemovePage(this); PlatformIndep.IDroidButtonsBar statusbarc = DependencyService.Get <PlatformIndep.IDroidButtonsBar>(); statusbarc?.SetDroidButtonsBarWhite(); } else { Navigation.PushAsync(new MainAppMDPage()); Navigation.RemovePage(this); PlatformIndep.IDroidButtonsBar statusbarc = DependencyService.Get <PlatformIndep.IDroidButtonsBar>(); statusbarc?.SetDroidButtonsBarWhite(); } }
public RoosterTest3() { InitializeComponent(); PlatformIndep.IDroidButtonsBar statusbarc = DependencyService.Get <PlatformIndep.IDroidButtonsBar>(); statusbarc?.SetDroidButtonsBarWhite(); List <Models.Lesson> lessons = Models.APIResultToModelConvertor.ConvertToLessons("lessons! :D"); List <Models.Reservation> reservations = Models.APIResultToModelConvertor.ConvertToReservations("reservations! :D"); List <CalenderItem> calender_items = new List <CalenderItem>(); lessons.ForEach((l) => calender_items.Add(new CalenderItem { Start = l.StartDateTime, End = l.EndDateTime, Text = l.Subject.Name, TextColor = Color.GhostWhite, BackgroundColor = Color.Red })); reservations.ForEach((r) => calender_items.Add(new CalenderItem { Start = r.StartDateTime, End = r.EndDateTime, Text = "Res " + r.RoomID, TextColor = Color.GhostWhite, BackgroundColor = Color.Blue })); item = GetItem(); calendar_line_labels = new List <Label>(); //columns TestGrid.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto }); //new GridLength(10, GridUnitType.Auto) }); TestGrid.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Star }); //rows and content int begin = 0; int end = 24; double standard_height = 40; Color line_color = Color.LightGray; int rowcount = -1; //for calendaritem double amount_start = (double)item.Start.Minute / 60 * standard_height; if (amount_start == 0) { amount_start = 1; } if (amount_start == standard_height) { amount_start = standard_height - 1; } double amount_end = (double)item.End.Minute / 60 * standard_height; if (amount_end == 0) { amount_end = 1; } if (amount_end == standard_height) { amount_end = standard_height - 1; } int row_start = item.Start.Hour * 2 - 1; //gets updated in for loop below int row_end = item.End.Hour * 2 - 1; //gets updated in for loop below for (int hour = begin; hour < end; hour++) { // lines if (hour != begin) { TestGrid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Absolute) }); rowcount++; Label lbl = new Label { Text = "", BackgroundColor = line_color }; Grid.SetRow(lbl, rowcount); Grid.SetColumn(lbl, 0); Grid.SetColumnSpan(lbl, 2); TestGrid.Children.Add(lbl); calendar_line_labels.Add(lbl); } // calendar items RowDefinition rd = new RowDefinition { Height = new GridLength(standard_height, GridUnitType.Absolute) }; TestGrid.RowDefinitions.Add(rd); rowcount++; Label timelabel = new Label { Text = hour + ":00", TextColor = Color.Gray }; Grid.SetColumn(timelabel, 0); Grid.SetRow(timelabel, rowcount); TestGrid.Children.Add(timelabel); if (item.Start.Hour == hour) { row_start = rowcount; } if (item.End.Hour == hour) { row_end = rowcount; } } // item Grid new_g = new Grid { ColumnSpacing = 0, RowSpacing = 0, Margin = new Thickness(5, 0, 4, 0) }; if (row_start == row_end) { new_g.RowDefinitions.Add(new RowDefinition { Height = new GridLength(amount_start, GridUnitType.Absolute) }); // "empty" new_g.RowDefinitions.Add(new RowDefinition { Height = new GridLength(amount_end - amount_start, GridUnitType.Absolute), }); // item new_g.RowDefinitions.Add(new RowDefinition { Height = new GridLength(standard_height - amount_end, GridUnitType.Absolute) }); // "empty" Label LblForColor = new Label { BackgroundColor = Color.LightSeaGreen }; Grid.SetColumn(LblForColor, 0); Grid.SetRow(LblForColor, 1); new_g.Children.Add(LblForColor); Label lbl = new Label { Text = item.Content, TextColor = Color.Purple, FontAttributes = FontAttributes.Bold }; Grid.SetColumn(lbl, 0); Grid.SetRow(lbl, 1); new_g.Children.Add(lbl); Grid.SetColumn(new_g, 1); Grid.SetRow(new_g, row_start); TestGrid.Children.Add(new_g); } else { new_g.RowDefinitions.Add(new RowDefinition { Height = new GridLength(amount_start, GridUnitType.Absolute) }); new_g.RowDefinitions.Add(new RowDefinition { Height = new GridLength(standard_height - amount_start, GridUnitType.Absolute) }); new_g.RowDefinitions.Add(new RowDefinition { Height = GridLength.Star }); new_g.RowDefinitions.Add(new RowDefinition { Height = new GridLength(amount_end, GridUnitType.Absolute) }); new_g.RowDefinitions.Add(new RowDefinition { Height = new GridLength(standard_height - amount_end, GridUnitType.Absolute) }); Label lbl = new Label { Text = item.Content, TextColor = Color.Purple, BackgroundColor = Color.LightGreen }; Grid.SetColumn(lbl, 0); Grid.SetRow(lbl, 1); Grid.SetRowSpan(lbl, 3); new_g.Children.Add(lbl); Grid.SetColumn(new_g, 1); Grid.SetRow(new_g, row_start); Grid.SetRowSpan(new_g, row_end - row_start + 1); TestGrid.Children.Add(new_g); } DateLabel.Text = item.Start.ToString("dd-MM-yyyy"); DayButton.IsEnabled = false; }