public override void ViewDidLoad() { LocationEnabled = true; base.ViewDidLoad(); //adds a stationary circle around phone CAShapeLayer first = new CAShapeLayer(); first.Bounds = new CGRect(0, 0, PhoneImageView.Frame.Width, PhoneImageView.Frame.Height); first.Position = new CGPoint(PhoneImageView.Frame.Width / 2, PhoneImageView.Frame.Height / 2); first.Path = UIBezierPath.FromOval(PhoneImageView.Bounds).CGPath; first.StrokeColor = UIColor.White.CGColor; first.LineWidth = (nfloat)1; first.FillColor = UIColor.Clear.CGColor; PhoneImageView.Layer.AddSublayer(first); //Wire up events DemoCardView = new UIView(); DemoCardView.BackgroundColor = UIColor.Clear; DemoCardSuperviewHeightConstraint.Constant = CardViewController.GetCalculatedHeight(); DemoCardSuperview.AddSubview(DemoCardView); DemoCardSuperview.SetNeedsLayout(); DemoCardSuperview.LayoutIfNeeded(); DemoCardSuperview.BackgroundColor = UIColor.Clear; StatusButton.Hidden = true; StatusButton.TitleLabel.TextAlignment = UITextAlignment.Center; StatusButton.TitleLabel.LineBreakMode = UILineBreakMode.WordWrap; StatusButton.TitleLabel.Lines = 2; RightArrowImageView.Transform = CGAffineTransform.MakeScale(-1, 1); HideCardViews(true); //clear notifications var persistantStorageService = ServiceLocator.Instance.Resolve <IPersistantStorage>(); persistantStorageService.SetDiscoverNotificaionCount(0); if (IsSufficentPermissionGranted()) { var service = ServiceRunner.SharedInstance.FetchService <GeolocatorService>(); service.Start(); } StartLocationManager(); }
public override void ViewWillLayoutSubviews() { base.ViewWillLayoutSubviews(); BackgroundVC.View.Frame = View.Bounds; if (DemoCardView != null) { DemoCardView.Frame = DemoCardSuperview.Bounds; DemoCardView.Bounds = new CGRect(0, 0, View.Bounds.Width - 16, DemoCardSuperview.Bounds.Height); if (!DemoCardSuperview.Subviews.Contains(DemoCardView)) { DemoCardSuperview.AddSubview(DemoCardView); } } }