Exemple #1
0
        //[Export("ReportImagesGenerated:")]
        protected void ReportImagesGenerated()
        {
            if (this.NavigationController.TopViewController.Handle == this.Handle)
            {
                Console.WriteLine("Images ready in loading screen");

                var report = MoodReport.LatestGeneratedReport;

                ReportManager.DeleteAllOldReports(report);

                Console.WriteLine("Old reports deleted");

                InvokeOnMainThread(delegate {
//				if(this.NavigationController.TopViewController.View.Handle == this.View.Handle){
//					Console.WriteLine("Reloading map controller");
//				if(this.moodMapController != null){
//					this.moodMapController.Dispose();
//					this.moodMapController = null;
//				}
//					this.moodMapController = new OurMoodViewController();
//					this.NavigationController.PushViewController(moodMapController, true);

                    if (this.moodMapController == null || this.moodMapController.NeedsDisposing)
                    {
                        this.moodMapController = new OurMoodViewController();
                    }
                    else
                    {
                        this.moodMapController.Refresh();
                    }
                    this.NavigationController.PushViewController(moodMapController, true);
                    //}
                });
            }
        }
Exemple #2
0
        public override void ViewDidLoad()
        {
            Console.WriteLine("Loading screen - ViewDidLoad");

            base.ViewDidLoad();

            // Perform any additional setup after loading the view, typically from a nib.



            if (this.moodMapController == null)
            {
                this.moodMapController = new OurMoodViewController();
            }


            NSNotificationCenter.DefaultCenter.AddObserver(this, new Selector("RequestingReportStatus"), "RequestingReportStatus", null);

//			NSNotificationCenter.DefaultCenter.AddObserver (this, new Selector ("ReportImagesGenerated:"), "ReportImagesGenerated", null);
            NSNotificationCenter.DefaultCenter.AddObserver(this, new Selector("NewReportReceived"), "NewReportReceived", null);
            NSNotificationCenter.DefaultCenter.AddObserver(this, new Selector("NoReportData"), "NoReportData", null);


            var images = Resources.LoadingImages;

            loadingImage = new UIImageView(new RectangleF(0, 0, 1024, 748));
            loadingImage.AnimationImages = images.ToArray();
            //loadingImage.Center = new PointF(512, 383);
            loadingImage.ContentMode     = UIViewContentMode.Center;
            loadingImage.BackgroundColor = UIColor.Black;

            this.Add(loadingImage);

            loadingTitle                 = new UILabel(new RectangleF(0, 300, 400, 60));
            loadingTitle.Text            = "Loading data ....";
            loadingTitle.Center          = new PointF(512, 300);
            loadingTitle.TextColor       = UIColor.White;
            loadingTitle.BackgroundColor = UIColor.Clear;
            loadingTitle.TextAlignment   = UITextAlignment.Center;
            this.Add(loadingTitle);

            loadingFirstReport = !MoodReport.HasValidReport;
        }