public override void ViewDidLoad() { base.ViewDidLoad(); // Perform any additional setup after loading the view, typically from a nib. this.NavigationController.NavigationBar.Translucent = true; this.NavigationController.NavigationBar.SetBackgroundImage(new UIImage(), UIBarMetrics.Default); this.NavigationController.NavigationBar.ShadowImage = new UIImage(); this.NavigationController.NavigationBar.BackgroundColor = new UIColor(0.0f, 0.0f, 0.0f, 0.0f); //this.EdgesForExtendedLayout = UIRectEdge.All; HeaderHeightConstraint.Constant = HeaderHeight; TeamOwnerHolderHeightConstraint.Constant = TeamOwnerHolderHeight; TeamRankingGraphHolderHeightConstraint.Constant = 0; TeamCyclersTable.ContentInset = new UIEdgeInsets(HeaderHeight + TeamOwnerHolderHeight, 0, 0, 0); TeamCyclersTable.ContentOffset = new CGPoint(0, -(HeaderHeight + TeamOwnerHolderHeight)); TeamCyclersTable.ScrollIndicatorInsets = new UIEdgeInsets(HeaderHeight + TeamOwnerHolderHeight, 0, 0, 0); this.View.LayoutIfNeeded(); Cyclers = DataSource.GetTeamCyclers(Team.Id); Results = DataSource.GetTeamResults(Team.Id); NSData teamImageData = NSData.FromArray(this.Team.TeamImageData); TeamImageView.Image = UIImage.LoadFromData(teamImageData, 1); CAGradientLayer transparencyLayer = new CAGradientLayer(); transparencyLayer.Frame = TeamImageView.Frame; transparencyLayer.Colors = new CGColor[] { UIColor.Black.CGColor, UIColor.Clear.CGColor }; //[NSArray arrayWithObjects:(id)[UIColor whiteColor].CGColor, (id)[UIColor clearColor].CGColor, nil]; transparencyLayer.StartPoint = new CGPoint(1.0f, 2.0f); transparencyLayer.EndPoint = new CGPoint(1.0f, -1.0f); TeamImageView.Layer.AddSublayer(transparencyLayer); RankingButton.Layer.CornerRadius = RankingButton.Frame.Height / 2; RankingButton.Layer.BorderWidth = 1; RankingButton.Layer.BorderColor = RankingButton.TitleColor(UIControlState.Normal).CGColor; FollowButton.Layer.CornerRadius = FollowButton.Frame.Height / 2; FollowButton.Layer.BorderWidth = 1; FollowButton.Layer.BorderColor = FollowButton.TitleColor(UIControlState.Normal).CGColor; OwnerNameLabel.Text = Team.OwnerName; OwnerImageView.Layer.CornerRadius = 5; NSData ownerImageData = NSData.FromArray(DataSource.GetResource(this.Team.OwnerAvatarUrl)); OwnerImageView.Image = UIImage.LoadFromData(ownerImageData, 1); TeamRankingGraphCurrentCompetitionNameLabel.Text = ""; TeamCyclersTable.WeakDelegate = this; TeamCyclersTable.WeakDataSource = this; }
void Update() { if (levelID < 1) { return; } if (loaded) { return; } //if (!SocialManager.Instance.userHiscore.isLoaded) return; //if (SocialManager.Instance.facebookFriends.all.Count==0) return; if (SocialManager.Instance.ranking.levels[levelID - 1].data.Count > 0) { //SocialEvents.OnRefreshRanking(); loaded = true; foreach (Transform childTransform in container.transform) { Destroy(childTransform.gameObject); } foreach (Ranking.RankingData data in SocialManager.Instance.ranking.levels[levelID - 1].data) { RankingButton newButton = Instantiate(button); newButton.transform.SetParent(container.transform); newButton.Init(data.facebookID, data.score, data.playerName); newButton.transform.localScale = Vector2.one; if (data.isYou) { newButton.IsYou(); } } } }
void Update() { if (loaded) { return; } if (!SocialManager.Instance.userHiscore.isLoaded) { return; } if (SocialManager.Instance.facebookFriends.all.Count == 0) { return; } if (SocialManager.Instance.ranking.data.Count > 0) { SocialEvents.OnRefreshRanking(); loaded = true; foreach (Ranking.RankingData data in SocialManager.Instance.ranking.data) { RankingButton newButton = Instantiate(button); newButton.transform.SetParent(container.transform); newButton.Init(data.facebookID, data.score, data.playerName); newButton.transform.localScale = Vector2.one; if (data.isYou) { newButton.IsYou(); } } } }
void ReleaseDesignerOutlets() { if (FollowButton != null) { FollowButton.Dispose(); FollowButton = null; } if (HeaderHeightConstraint != null) { HeaderHeightConstraint.Dispose(); HeaderHeightConstraint = null; } if (OwnerImageView != null) { OwnerImageView.Dispose(); OwnerImageView = null; } if (OwnerNameLabel != null) { OwnerNameLabel.Dispose(); OwnerNameLabel = null; } if (RankingButton != null) { RankingButton.Dispose(); RankingButton = null; } if (TeamCyclersTable != null) { TeamCyclersTable.Dispose(); TeamCyclersTable = null; } if (TeamHeaderHolder != null) { TeamHeaderHolder.Dispose(); TeamHeaderHolder = null; } if (TeamImageView != null) { TeamImageView.Dispose(); TeamImageView = null; } if (TeamOwnerDetailHolder != null) { TeamOwnerDetailHolder.Dispose(); TeamOwnerDetailHolder = null; } if (TeamOwnerHolderHeightConstraint != null) { TeamOwnerHolderHeightConstraint.Dispose(); TeamOwnerHolderHeightConstraint = null; } if (TeamRankingGraphHolder != null) { TeamRankingGraphHolder.Dispose(); TeamRankingGraphHolder = null; } if (TeamRankingGraphCurrentCompetitionNameLabel != null) { TeamRankingGraphCurrentCompetitionNameLabel.Dispose(); TeamRankingGraphCurrentCompetitionNameLabel = null; } if (TeamRankingGraphHolderHeightConstraint != null) { TeamRankingGraphHolderHeightConstraint.Dispose(); TeamRankingGraphHolderHeightConstraint = null; } }