public override void ViewWillAppear(bool animated) { base.ViewWillAppear (animated); if(BL.Managers.UpdateManager.IsUpdatingUserGroups) { if (loadingOverlay == null) { loadingOverlay = new MWC.iOS.UI.Controls.LoadingOverlay (View.Frame); // because DialogViewController is a UITableViewController, // we need to step OVER the UITableView, otherwise the loadingOverlay // sits *in* the scrolling area of the table if (View.Superview != null) { // TODO: see when Superview is null View.Superview.Add (loadingOverlay); View.Superview.BringSubviewToFront (loadingOverlay); } } ConsoleD.WriteLine("Waiting for updates to finish before displaying table."); } else { loadingOverlay = null; if (Root == null || Root.Count == 0) { ConsoleD.WriteLine("Not updating, populating table."); PopulateTable(); } else ConsoleD.WriteLine ("Exhibitors already populated"); } }
public override void ViewWillAppear (bool animated) { base.ViewWillAppear (animated); if(BL.Managers.UpdateManager.IsUpdating) { if (loadingOverlay == null) { var bounds = new RectangleF(0,0,768,1004); if (InterfaceOrientation == UIInterfaceOrientation.LandscapeLeft || InterfaceOrientation == UIInterfaceOrientation.LandscapeRight) { bounds = new RectangleF(0,0,1024,748); } loadingOverlay = new MWC.iOS.UI.Controls.LoadingOverlay (bounds); // because DialogViewController is a UITableViewController, // we need to step OVER the UITableView, otherwise the loadingOverlay // sits *in* the scrolling area of the table View.Superview.Add (loadingOverlay); View.Superview.BringSubviewToFront (loadingOverlay); } ConsoleD.WriteLine("Waiting for updates to finish before displaying table."); } else { loadingOverlay = null; if (AlwaysRefresh || Root == null || Root.Count == 0) { ConsoleD.WriteLine("Not updating, populating table."); PopulateTable(); } else ConsoleD.WriteLine("Data already populated."); } }
void HandleUpdateFinished(object sender, EventArgs e) { ConsoleD.WriteLine("Updates finished, going to populate table."); InvokeOnMainThread ( () => { PopulateTable (); if (loadingOverlay != null) loadingOverlay.Hide (); loadingOverlay = null; }); }
void HandleUpdateFinished(object sender, EventArgs e) { ConsoleD.WriteLine("Updates finished, going to populate table."); InvokeOnMainThread(() => { PopulateTable(); if (loadingOverlay != null) { loadingOverlay.Hide(); } loadingOverlay = null; }); }
void HandleUpdateStarted(object sender, EventArgs e) { ConsoleD.WriteLine("Updates starting, need to create overlay."); InvokeOnMainThread(() => { if (loadingOverlay == null) { loadingOverlay = new MWC.iOS.UI.Controls.LoadingOverlay(TableView.Frame); // because DialogViewController is a UITableViewController, // we need to step OVER the UITableView, otherwise the loadingOverlay // sits *in* the scrolling area of the table if (View.Superview != null) //TODO: see when this is null { View.Superview.Add(loadingOverlay); View.Superview.BringSubviewToFront(loadingOverlay); } } }); }
public override void ViewWillAppear(bool animated) { base.ViewWillAppear(animated); if (BL.Managers.UpdateManager.IsUpdating) { if (loadingOverlay == null) { var bounds = new CGRect(0, 0, 768, 1004); if (InterfaceOrientation == UIInterfaceOrientation.LandscapeLeft || InterfaceOrientation == UIInterfaceOrientation.LandscapeRight) { bounds = new CGRect(0, 0, 1024, 748); } loadingOverlay = new MWC.iOS.UI.Controls.LoadingOverlay(bounds); // because DialogViewController is a UITableViewController, // we need to step OVER the UITableView, otherwise the loadingOverlay // sits *in* the scrolling area of the table View.Superview.Add(loadingOverlay); View.Superview.BringSubviewToFront(loadingOverlay); } ConsoleD.WriteLine("Waiting for updates to finish before displaying table."); } else { loadingOverlay = null; if (AlwaysRefresh || Root == null || Root.Count == 0) { ConsoleD.WriteLine("Not updating, populating table."); PopulateTable(); } else { ConsoleD.WriteLine("Data already populated."); } } }
public override void ViewWillAppear(bool animated) { base.ViewWillAppear(animated); if (BL.Managers.UpdateManager.IsUpdatingUserGroups) { if (loadingOverlay == null) { loadingOverlay = new MWC.iOS.UI.Controls.LoadingOverlay(View.Frame); // because DialogViewController is a UITableViewController, // we need to step OVER the UITableView, otherwise the loadingOverlay // sits *in* the scrolling area of the table if (View.Superview != null) { // TODO: see when Superview is null View.Superview.Add(loadingOverlay); View.Superview.BringSubviewToFront(loadingOverlay); } } ConsoleD.WriteLine("Waiting for updates to finish before displaying table."); } else { loadingOverlay = null; if (Root == null || Root.Count == 0) { ConsoleD.WriteLine("Not updating, populating table."); PopulateTable(); } else { ConsoleD.WriteLine("Exhibitors already populated"); } } }
public override void ViewDidLoad() { base.ViewDidLoad (); BL.Managers.UpdateManager.UpdateFinished += HandleUpdateFinished; SessionTable.SeparatorColor = UIColor.Black; SessionTable.SeparatorStyle = UITableViewCellSeparatorStyle.SingleLine; if (AppDelegate.IsPhone) { MwcLogoImageView.Image = UIImage.FromBundle("/Images/Home"); MwcLogoImageView.Frame = new RectangleF(0,0,320,480); } else { // IsPad MwcLogoImageView.Image = UIImage.FromBundle("/Images/Home-Portrait~ipad"); // style the separators to be black SessionTable.SeparatorColor = UIColor.Black; SessionTable.SeparatorStyle = UITableViewCellSeparatorStyle.SingleLine; UpNextTable.SeparatorColor = UIColor.Black; UpNextTable.SeparatorStyle = UITableViewCellSeparatorStyle.SingleLine; FavoritesTable.SeparatorColor = UIColor.Black; FavoritesTable.SeparatorStyle = UITableViewCellSeparatorStyle.SingleLine; // the extra 'clear' Views for background are a bit of a hack // and not needed on the phone! // http://forums.macrumors.com/showthread.php?t=901706 var clearView1 = new UIView(); clearView1.Frame = new RectangleF(0,470, 320, 200); clearView1.BackgroundColor = UIColor.Clear; SessionTable.BackgroundColor = UIColor.Clear; SessionTable.BackgroundView = clearView1; var clearView2 = new UIView(); clearView2.Frame = new RectangleF(0,470+210, 320, 320); clearView2.BackgroundColor = UIColor.Clear; UpNextTable.BackgroundColor = UIColor.Clear; UpNextTable.BackgroundView = clearView2; var clearView3 = new UIView(); clearView3.Frame = new RectangleF(768-320,470, 320, 420); clearView3.BackgroundColor = UIColor.Clear; FavoritesTable.BackgroundColor = UIColor.Clear; FavoritesTable.BackgroundView = clearView3; } //TODO: Craig, i want to look at encapsulating this at the BL layer, // i don't know if that's a feasible approach, but i think this is // generally a good pattern. // // if we're in the process of updating, populate the table when it's done // alas, if we keep it in the app layer, it gives us an opportunity to // show a spinner over the table with an "updating" message. if(BL.Managers.UpdateManager.IsUpdating) { if (AppDelegate.IsPhone) loadingOverlay = new MWC.iOS.UI.Controls.LoadingOverlay (SessionTable.Frame); else { // IsPad (rotates!) var overlayFrame = View.Frame; overlayFrame.Y = 330; overlayFrame.Height = 768 - 330; loadingOverlay = new MWC.iOS.UI.Controls.LoadingOverlay (overlayFrame); loadingOverlay.AutoresizingMask = UIViewAutoresizing.FlexibleDimensions; } View.AddSubview (loadingOverlay); ConsoleD.WriteLine("UpdateManager.IsUpdating ~ wait for them to finish"); } else { PopulateTable(); } }
void HandleUpdateStarted(object sender, EventArgs e) { ConsoleD.WriteLine("Updates starting, need to create overlay."); InvokeOnMainThread ( () => { if (loadingOverlay == null) { loadingOverlay = new MWC.iOS.UI.Controls.LoadingOverlay (TableView.Frame); // because DialogViewController is a UITableViewController, // we need to step OVER the UITableView, otherwise the loadingOverlay // sits *in* the scrolling area of the table if (View.Superview != null) { //TODO: see when this is null View.Superview.Add (loadingOverlay); View.Superview.BringSubviewToFront (loadingOverlay); } } }); }
public override void ViewDidLoad() { base.ViewDidLoad(); BL.Managers.UpdateManager.UpdateFinished += HandleUpdateFinished; SessionTable.SeparatorColor = UIColor.Black; SessionTable.SeparatorStyle = UITableViewCellSeparatorStyle.SingleLine; if (AppDelegate.IsPhone) { MwcLogoImageView.Image = UIImage.FromBundle("/Images/Home"); MwcLogoImageView.Frame = new RectangleF(0, 0, 320, 480); } else { // IsPad MwcLogoImageView.Image = UIImage.FromBundle("/Images/Home-Portrait~ipad"); // style the separators to be black SessionTable.SeparatorColor = UIColor.Black; SessionTable.SeparatorStyle = UITableViewCellSeparatorStyle.SingleLine; UpNextTable.SeparatorColor = UIColor.Black; UpNextTable.SeparatorStyle = UITableViewCellSeparatorStyle.SingleLine; FavoritesTable.SeparatorColor = UIColor.Black; FavoritesTable.SeparatorStyle = UITableViewCellSeparatorStyle.SingleLine; // the extra 'clear' Views for background are a bit of a hack // and not needed on the phone! // http://forums.macrumors.com/showthread.php?t=901706 var clearView1 = new UIView(); clearView1.Frame = new RectangleF(0, 470, 320, 200); clearView1.BackgroundColor = UIColor.Clear; SessionTable.BackgroundColor = UIColor.Clear; SessionTable.BackgroundView = clearView1; var clearView2 = new UIView(); clearView2.Frame = new RectangleF(0, 470 + 210, 320, 320); clearView2.BackgroundColor = UIColor.Clear; UpNextTable.BackgroundColor = UIColor.Clear; UpNextTable.BackgroundView = clearView2; var clearView3 = new UIView(); clearView3.Frame = new RectangleF(768 - 320, 470, 320, 420); clearView3.BackgroundColor = UIColor.Clear; FavoritesTable.BackgroundColor = UIColor.Clear; FavoritesTable.BackgroundView = clearView3; } //TODO: Craig, i want to look at encapsulating this at the BL layer, // i don't know if that's a feasible approach, but i think this is // generally a good pattern. // // if we're in the process of updating, populate the table when it's done // alas, if we keep it in the app layer, it gives us an opportunity to // show a spinner over the table with an "updating" message. if (BL.Managers.UpdateManager.IsUpdating) { if (AppDelegate.IsPhone) { loadingOverlay = new MWC.iOS.UI.Controls.LoadingOverlay(SessionTable.Frame); } else // IsPad (rotates!) { var overlayFrame = View.Frame; overlayFrame.Y = 330; overlayFrame.Height = 768 - 330; loadingOverlay = new MWC.iOS.UI.Controls.LoadingOverlay(overlayFrame); loadingOverlay.AutoresizingMask = UIViewAutoresizing.FlexibleDimensions; } View.AddSubview(loadingOverlay); ConsoleD.WriteLine("UpdateManager.IsUpdating ~ wait for them to finish"); } else { PopulateTable(); } }