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;
        }