Beispiel #1
0
        public override void AwakeFromNib()
        {
            base.AwakeFromNib();

            CaptionLabel.TextColor = Theme.CurrentTheme.MainTitleColor;
            ContentLabel.TextColor = Theme.CurrentTheme.MainTextColor;

            FollowersImageVIew.Image = Theme.CurrentTheme.RepositoryCellFollowers;
            ForksImageView.Image     = Theme.CurrentTheme.RepositoryCellForks;
            UserImageView.Image      = Theme.CurrentTheme.RepositoryCellUser;

            OwnerImageView.Layer.MasksToBounds = true;
            OwnerImageView.Layer.CornerRadius  = OwnerImageView.Bounds.Height / 2f;
            DefaultConstraintSize = ContentConstraint.Constant;
            ContentView.Opaque    = true;

            this.WhenAnyValue(x => x.ViewModel)
            .Where(x => x != null)
            .Subscribe(x =>
            {
                CaptionLabel.Text   = x.Name;
                FollowersLabel.Text = x.Stars.ToString();
                ForksLabel.Text     = x.Forks.ToString();
                OwnerImageView.SetImage(new NSUrl(x.ImageUrl), Images.LoginUserUnknown);
                ContentLabel.Hidden        = string.IsNullOrEmpty(x.Description);
                ContentLabel.Text          = x.Description ?? string.Empty;
                UserLabel.Hidden           = !x.ShowOwner || string.IsNullOrEmpty(x.Owner);
                UserImageView.Hidden       = UserLabel.Hidden;
                UserLabel.Text             = x.Owner ?? string.Empty;
                ContentConstraint.Constant = string.IsNullOrEmpty(ContentLabel.Text) ? 0f : DefaultConstraintSize;
            });
        }
Beispiel #2
0
        void ReleaseDesignerOutlets()
        {
            if (OwnerImageView != null)
            {
                OwnerImageView.Dispose();
                OwnerImageView = null;
            }

            if (CaptionLabel != null)
            {
                CaptionLabel.Dispose();
                CaptionLabel = null;
            }

            if (ContentLabel != null)
            {
                ContentLabel.Dispose();
                ContentLabel = null;
            }

            if (FollowersImageVIew != null)
            {
                FollowersImageVIew.Dispose();
                FollowersImageVIew = null;
            }

            if (FollowersLabel != null)
            {
                FollowersLabel.Dispose();
                FollowersLabel = null;
            }

            if (ForksImageView != null)
            {
                ForksImageView.Dispose();
                ForksImageView = null;
            }

            if (ForksLabel != null)
            {
                ForksLabel.Dispose();
                ForksLabel = null;
            }

            if (UserImageView != null)
            {
                UserImageView.Dispose();
                UserImageView = null;
            }

            if (UserLabel != null)
            {
                UserLabel.Dispose();
                UserLabel = null;
            }
        }
Beispiel #3
0
        public override void AwakeFromNib()
        {
            base.AwakeFromNib();

            CaptionLabel.TextColor = Theme.MainTitleColor;
            ContentLabel.TextColor = Theme.MainTextColor;

            FollowersImageVIew.TintColor = FollowersLabel.TextColor;
            ForksImageView.TintColor     = ForksLabel.TextColor;
            UserImageView.TintColor      = UserLabel.TextColor;

            FollowersImageVIew.Image = Octicon.Star.ToImage(FollowersImageVIew.Frame.Height);
            ForksImageView.Image     = Octicon.RepoForked.ToImage(ForksImageView.Frame.Height);
            UserImageView.Image      = Octicon.Person.ToImage(UserImageView.Frame.Height);

            OwnerImageView.Layer.CornerRadius  = OwnerImageView.Bounds.Height / 2f;
            OwnerImageView.Layer.MasksToBounds = true;
            OwnerImageView.ContentMode         = UIViewContentMode.ScaleAspectFill;
            ContentView.Opaque = true;

            DefaultConstraintSize = ContentConstraint.Constant;

            this.WhenAnyValue(x => x.ViewModel)
            .Where(x => x != null)
            .Subscribe(x => {
                CaptionLabel.Text          = x.Name;
                FollowersLabel.Text        = x.Stars.ToString();
                ForksLabel.Text            = x.Forks.ToString();
                ContentLabel.Hidden        = string.IsNullOrEmpty(x.Description);
                ContentLabel.Text          = x.Description ?? string.Empty;
                UserLabel.Hidden           = !x.ShowOwner || string.IsNullOrEmpty(x.Owner);
                UserImageView.Hidden       = UserLabel.Hidden;
                UserLabel.Text             = x.Owner ?? string.Empty;
                ContentConstraint.Constant = string.IsNullOrEmpty(ContentLabel.Text) ? 0f : DefaultConstraintSize;
            });

            this.WhenAnyValue(x => x.ViewModel.Avatar)
            .Where(_ => !_fakeCell)
            .Subscribe(x => OwnerImageView.SetAvatar(x));
        }
Beispiel #4
0
        public override void AwakeFromNib()
        {
            base.AwakeFromNib();

            CaptionLabel.TextColor = Theme.MainTitleColor;
            ContentLabel.TextColor = Theme.MainTextColor;

            FollowersImageVIew.TintColor = FollowersLabel.TextColor;
            ForksImageView.TintColor     = ForksLabel.TextColor;
            UserImageView.TintColor      = UserLabel.TextColor;

            FollowersImageVIew.Image = new UIImage(Images.Star.CGImage, 1.3f, UIImageOrientation.Up).ImageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate);
            ForksImageView.Image     = new UIImage(Images.Fork.CGImage, 1.3f, UIImageOrientation.Up).ImageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate);
            UserImageView.Image      = new UIImage(Images.Person.CGImage, 1.3f, UIImageOrientation.Up).ImageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate);

            OwnerImageView.Layer.MasksToBounds = true;
            OwnerImageView.Layer.CornerRadius  = OwnerImageView.Bounds.Height / 2f;
            DefaultConstraintSize = ContentConstraint.Constant;
            ContentView.Opaque    = true;

            this.WhenAnyValue(x => x.ViewModel)
            .Where(x => x != null)
            .Subscribe(x =>
            {
                CaptionLabel.Text   = x.Name;
                FollowersLabel.Text = x.Stars.ToString();
                ForksLabel.Text     = x.Forks.ToString();
                OwnerImageView.SetAvatar(x.Avatar);
                ContentLabel.Hidden        = string.IsNullOrEmpty(x.Description);
                ContentLabel.Text          = x.Description ?? string.Empty;
                UserLabel.Hidden           = !x.ShowOwner || string.IsNullOrEmpty(x.Owner);
                UserImageView.Hidden       = UserLabel.Hidden;
                UserLabel.Text             = x.Owner ?? string.Empty;
                ContentConstraint.Constant = string.IsNullOrEmpty(ContentLabel.Text) ? 0f : DefaultConstraintSize;
            });
        }
Beispiel #5
0
        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;
            }
        }