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); } } }
void ReleaseDesignerOutlets() { if (DemoCardSuperview != null) { DemoCardSuperview.Dispose(); DemoCardSuperview = null; } if (DemoCardSuperviewHeightConstraint != null) { DemoCardSuperviewHeightConstraint.Dispose(); DemoCardSuperviewHeightConstraint = null; } if (FlipButton != null) { FlipButton.Dispose(); FlipButton = null; } if (LeftArrowImageView != null) { LeftArrowImageView.Dispose(); LeftArrowImageView = null; } if (NoBackgroundView != null) { NoBackgroundView.Dispose(); NoBackgroundView = null; } if (NoLabel != null) { NoLabel.Dispose(); NoLabel = null; } if (PhoneImageView != null) { PhoneImageView.Dispose(); PhoneImageView = null; } if (RightArrowImageView != null) { RightArrowImageView.Dispose(); RightArrowImageView = null; } if (StatusButton != null) { StatusButton.Dispose(); StatusButton = null; } if (TitleLabel != null) { TitleLabel.Dispose(); TitleLabel = null; } if (YesBackgroundView != null) { YesBackgroundView.Dispose(); YesBackgroundView = null; } if (YesLabel != null) { YesLabel.Dispose(); YesLabel = null; } }