private void InitializeStyle() { ThumbImageView.TintColor = ThemeColors.BorderLight; ThumbLabel.Font = Theme.VenueShowLogoFont; ThumbLabel.TextColor = ThemeColors.ContentDarkText; TitleLabel.Font = Theme.ContentFont; TitleLabel.TextColor = ThemeColors.ContentLightText; NavigateOnMapButton.SetImage(ThemeIcons.MapPinSmall, UIControlState.Normal); LocationLabel.Font = Theme.VenueShowDescriptionFont; LocationLabel.TextColor = ThemeColors.ContentLightTextPassive; DescriptionLabel.Font = Theme.VenueShowDescriptionFont; DescriptionLabel.TextColor = ThemeColors.ContentLightTextPassive; StartTimeLabel.Font = Theme.VenueShowTimeFont; StartTimeLabel.TextColor = ThemeColors.ContentLightTextPassive; EndTimeLabel.Font = Theme.VenueShowTimeFont; EndTimeLabel.TextColor = ThemeColors.BorderLight; DetailsButton.SetImage(ThemeIcons.Info, UIControlState.Normal); DetailsButton.TintColor = ThemeColors.Action; DetailsLabel.Font = Theme.VenueShowDetailsFont; DetailsLabel.TextColor = ThemeColors.Action; Separator.BackgroundColor = ThemeColors.ContentLightBackground; BackgroundView.BackgroundColor = ThemeColors.ContentLightBackground; }
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); }
void ReleaseDesignerOutlets() { if (BottomSeparator != null) { BottomSeparator.Dispose(); BottomSeparator = null; } if (GoRightImageView != null) { GoRightImageView.Dispose(); GoRightImageView = null; } if (NameLabel != null) { NameLabel.Dispose(); NameLabel = null; } if (NavigateOnMapButton != null) { NavigateOnMapButton.Dispose(); NavigateOnMapButton = null; } if (TopSeparator != null) { TopSeparator.Dispose(); TopSeparator = null; } }
private void InitializeGestures() { _mapTapGesture = new UITapGestureRecognizer(() => { if (NavigateVenueOnMapCommand != null && NavigateVenueOnMapCommand.CanExecute(DataContext)) { NavigateVenueOnMapCommand.Execute(DataContext); } }); NavigateOnMapButton.AddGestureRecognizer(_mapTapGesture); var initLocation = default(CGPoint); _cellPressGesture = new UILongPressGestureRecognizer(rec => { if (rec.State == UIGestureRecognizerState.Began) { SetSelectedState(true); initLocation = rec.LocationInView( UIApplication.SharedApplication.KeyWindow); } else if (rec.State == UIGestureRecognizerState.Changed) { var location = rec.LocationInView( UIApplication.SharedApplication.KeyWindow); var dx = location.X - initLocation.X; var dy = location.Y - initLocation.Y; if (Math.Sqrt(dx * dx + dy * dy) > 15) { SetSelectedState(false); rec.Enabled = false; rec.Enabled = true; } } else if (rec.State == UIGestureRecognizerState.Ended) { SetSelectedState(false); if (rec.LocatedInView(this) && NavigateVenueCommand != null && NavigateVenueCommand.CanExecute(DataContext)) { NavigateVenueCommand.Execute(DataContext); } } }) { MinimumPressDuration = 0.05, Delegate = new TransientGestureDelegate() }; _cellPressGesture.RequireGestureRecognizerToFail(_mapTapGesture); AddGestureRecognizer(_cellPressGesture); }
private void InitializeStyle() { BottomSeparator.IsLineOnTop = true; NameLabel.Font = Theme.VenueNameFont; NameLabel.TextColor = ThemeColors.ContentLightText; NavigateOnMapButton.SetImage(ThemeIcons.MapPinSmall, UIControlState.Normal); GoRightImageView.Image = ThemeIcons.Forward; GoRightImageView.TintColor = ThemeColors.BorderLight; }
private void DisposeGestures() { if (_mapTapGesture != null) { NavigateOnMapButton.RemoveGestureRecognizer(_mapTapGesture); _mapTapGesture.Dispose(); _mapTapGesture = null; } if (_cellPressGesture != null) { RemoveGestureRecognizer(_cellPressGesture); _cellPressGesture.Dispose(); _cellPressGesture = null; } }
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; } }