Beispiel #1
0
        private void UpdateVisibility(bool animated)
        {
            if (DataContext == null)
            {
                return;
            }

            ThumbImageView.SetHidden(!DataContext.IsLogoVisible, animated);
            ThumbLabel.SetHidden(IsExpanded || !DataContext.IsLogoVisible || DataContext.Show.HasPictures(), animated);

            StartTimeLabel.SetHidden(!DataContext.IsTimeVisible, animated);
            EndTimeLabel.SetHidden(!DataContext.IsTimeVisible, animated);

            EndTimeLabel.TextColor = IsExpanded ? ThemeColors.ContentLightTextPassive : ThemeColors.BorderLight;

            var isLocationHidden = !IsExpanded || !DataContext.IsLocationAvailable;

            NavigateOnMapButton.SetHidden(isLocationHidden, animated);
            LocationLabel.SetHidden(isLocationHidden, animated);

            var isDescriptionHidden = !IsExpanded || GetShowDescription(DataContext.Show, !DataContext.IsTimeVisible) == null;

            DescriptionLabel.SetHidden(isDescriptionHidden, animated);

            var isDetailsHidden = !IsExpanded || !DataContext.Show.HasDetailsUrl();

            DetailsLabel.SetHidden(isDetailsHidden, animated);
            DetailsButton.SetHidden(isDetailsHidden, animated);
        }
Beispiel #2
0
        public VenueShowCell(IntPtr handle) : base(handle)
        {
            BackgroundView = new UIView {
                BackgroundColor = ThemeColors.ContentLightBackground
            };

            _smallImageHelper = new MvxResizedImageViewLoader(
                () => ThumbImageView,
                () => ThumbImageView.Bounds,
                state =>
            {
                if (_smallImageHelper.ImageUrl != null &&
                    ThumbImageView.ProgressEnded(state))
                {
                    if (ThumbImageView.HasImage(state))
                    {
                        ThumbImageView.SetHidden(false, _smallImageAnimationDelay.Animate);
                    }
                    else
                    {
                        // showing abbr if image couldn't be loaded
                        ThumbImageView.Image = ThemeIcons.Circle;
                        ThumbLabel.SetHidden(false, false);
                    }
                }
            })
            {
                UseRoundClip = true
            };

            _largeImageHelper = new MvxImageViewLoader(
                () => ThumbImageView,
                () =>
            {
                if (_largeImageHelper.ImageUrl != null &&
                    ThumbImageView.HasImage())
                {
                    ThumbImageView.SetHidden(false, _largeImageAnimationDelay.Animate);
                    UpdateConstraintConstants(false);
                }
            });
            _largeImageHelper.DefaultImagePath = Theme.DefaultImagePath;
            _largeImageHelper.ErrorImagePath   = Theme.ErrorImagePath;
        }
Beispiel #3
0
        void ReleaseDesignerOutlets()
        {
            if (BottomBorderLeftConstraint != null)
            {
                BottomBorderLeftConstraint.Dispose();
                BottomBorderLeftConstraint = null;
            }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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