void ReleaseDesignerOutlets() { if (ContentConstraint != null) { ContentConstraint.Dispose(); ContentConstraint = null; } if (MainImageView != null) { MainImageView.Dispose(); MainImageView = null; } if (TimeLabel != null) { TimeLabel.Dispose(); TimeLabel = null; } if (TitleLabel != null) { TitleLabel.Dispose(); TitleLabel = null; } }
public override void AwakeFromNib() { base.AwakeFromNib(); MainImageView.Layer.MasksToBounds = true; MainImageView.Layer.CornerRadius = MainImageView.Frame.Height / 2f; SeparatorInset = new UIEdgeInsets(0, TitleLabel.Frame.Left, 0, 0); TitleLabel.TextColor = Theme.CurrentTheme.MainTitleColor; DetailsLabel.TextColor = UIColor.Gray; DefaultContentConstraintSize = DetailsConstraint.Constant; this.WhenAnyValue(x => x.ViewModel) .Where(x => x != null) .Subscribe(x => { if (string.IsNullOrEmpty(x.ImageUrl)) { MainImageView.Image = Images.LoginUserUnknown; } else { MainImageView.SetImage(new NSUrl(x.ImageUrl), Images.LoginUserUnknown); } TitleLabel.Text = x.Title; DetailsLabel.Text = "Created " + x.Created.UtcDateTime.Humanize(); DetailsConstraint.Constant = string.IsNullOrEmpty(DetailsLabel.Text) ? 0f : DefaultContentConstraintSize; }); }
public override void AwakeFromNib() { base.AwakeFromNib(); MainImageView.Layer.MasksToBounds = true; MainImageView.Layer.CornerRadius = MainImageView.Frame.Height / 2f; SeparatorInset = new UIEdgeInsets(0, TitleLabel.Frame.Left, 0, 0); TitleLabel.TextColor = Theme.CurrentTheme.MainTitleColor; TimeLabel.TextColor = UIColor.Gray; ContentLabel.TextColor = Theme.CurrentTheme.MainTextColor; DefaultContentConstraintSize = ContentConstraint.Constant; this.WhenAnyValue(x => x.ViewModel) .Where(x => x != null) .Subscribe(x => { TitleLabel.Text = x.Name; TimeLabel.Text = x.Date; ContentLabel.Text = x.Description; ContentLabel.Hidden = string.IsNullOrWhiteSpace(x.Description); ContentConstraint.Constant = ContentLabel.Hidden ? 0 : DefaultContentConstraintSize; MainImageView.SetAvatar(x.Avatar); }); }
public override void AwakeFromNib() { base.AwakeFromNib(); MainImageView.Layer.MasksToBounds = true; MainImageView.Layer.CornerRadius = MainImageView.Frame.Height / 2f; SeparatorInset = new UIEdgeInsets(0, TitleLabel.Frame.Left, 0, 0); ContentView.Opaque = true; TitleLabel.TextColor = Theme.MainTitleColor; TimeLabel.TextColor = UIColor.Gray; ContentLabel.TextColor = Theme.MainTextColor; DefaultContentConstraintSize = ContentConstraint.Constant; this.OneWayBind(ViewModel, x => x.Name, x => x.TitleLabel.Text); this.OneWayBind(ViewModel, x => x.Description, x => x.ContentLabel.Text); this.OneWayBind(ViewModel, x => x.Time, x => x.TimeLabel.Text); this.WhenAnyValue(x => x.ViewModel) .Where(x => x != null) .SubscribeSafe(x => { MainImageView.SetAvatar(x.Avatar); ContentConstraint.Constant = string.IsNullOrEmpty(x.Description) ? 0f : DefaultContentConstraintSize; }); }
void ReleaseDesignerOutlets() { if (DetailsLabel != null) { DetailsLabel.Dispose(); DetailsLabel = null; } if (MainImageView != null) { MainImageView.Dispose(); MainImageView = null; } if (TitleLabel != null) { TitleLabel.Dispose(); TitleLabel = null; } if (DetailsConstraint != null) { DetailsConstraint.Dispose(); DetailsConstraint = null; } }
public override void AwakeFromNib() { base.AwakeFromNib(); MainImageView.Layer.MasksToBounds = true; MainImageView.Layer.CornerRadius = MainImageView.Frame.Height / 2f; SeparatorInset = new UIEdgeInsets(0, TitleLabel.Frame.Left, 0, 0); TitleLabel.TextColor = Theme.CurrentTheme.MainTitleColor; TimeLabel.TextColor = Theme.CurrentTheme.MainSubtitleColor; ContentLabel.TextColor = Theme.CurrentTheme.MainTextColor; DefaultContentConstraintSize = ContentConstraint.Constant; this.WhenAnyValue(x => x.ViewModel) .Where(x => x != null) .Subscribe(x => { if (x.ImageUrl == null) { MainImageView.Image = Images.LoginUserUnknown; } else { MainImageView.SetImage(new NSUrl(x.ImageUrl), Images.LoginUserUnknown); } TitleLabel.Text = x.Title; ContentLabel.Text = x.Description; TimeLabel.Text = x.UpdatedAt.ToDaysAgo(); ContentConstraint.Constant = string.IsNullOrEmpty(x.Description) ? 0f : DefaultContentConstraintSize; }); }
public override void AwakeFromNib() { base.AwakeFromNib(); MainImageView.Layer.MasksToBounds = true; MainImageView.Layer.CornerRadius = MainImageView.Frame.Height / 2f; ContentView.Opaque = true; SeparatorInset = new UIEdgeInsets(0, TitleLabel.Frame.Left, 0, 0); TitleLabel.TextColor = Theme.MainTitleColor; TimeLabel.TextColor = Theme.MainSubtitleColor; ContentLabel.TextColor = Theme.MainTextColor; DefaultContentConstraintSize = ContentConstraint.Constant; this.WhenAnyValue(x => x.ViewModel) .Where(x => x != null) .Subscribe(x => { MainImageView.SetAvatar(x.Avatar); TitleLabel.Text = x.Title; ContentLabel.Text = x.Description; TimeLabel.Text = x.UpdatedAt.UtcDateTime.Humanize(); ContentConstraint.Constant = string.IsNullOrEmpty(x.Description) ? 0f : DefaultContentConstraintSize; }); }
public void Set(string title, string description, DateTimeOffset time, GitHubAvatar avatar) { TitleLabel.Text = title; ContentLabel.Text = description; TimeLabel.Text = time.Humanize(); ContentConstraint.Constant = string.IsNullOrEmpty(description) ? 0f : DefaultContentConstraintSize; MainImageView.SetAvatar(avatar); }
void ReleaseDesignerOutlets() { if (MainImageView != null) { MainImageView.Dispose(); MainImageView = null; } if (MainImageViewBottomConstraint != null) { MainImageViewBottomConstraint.Dispose(); MainImageViewBottomConstraint = null; } if (MainImageViewLeadingConstraint != null) { MainImageViewLeadingConstraint.Dispose(); MainImageViewLeadingConstraint = null; } if (MainImageViewTopConstraint != null) { MainImageViewTopConstraint.Dispose(); MainImageViewTopConstraint = null; } if (MainImageViewTrailingConstraint != null) { MainImageViewTrailingConstraint.Dispose(); MainImageViewTrailingConstraint = null; } if (SelectedIconBackgroundView != null) { SelectedIconBackgroundView.Dispose(); SelectedIconBackgroundView = null; } if (SelectedIconImageView != null) { SelectedIconImageView.Dispose(); SelectedIconImageView = null; } if (TopGradientView != null) { TopGradientView.Dispose(); TopGradientView = null; } }
private void RenderImage(IGalleryItem item) { MainImageView.SetImageResource(global::Android.Resource.Color.Transparent); LayoutRoot.Post(() => SetDimensions(MainImageView, item)); MainImageView.Visibility = ViewStates.Visible; VideoWrapper.Visibility = ViewStates.Gone; MainVideoView.Visibility = ViewStates.Gone; var width = DpToPx(Math.Min(PxToDp(LayoutRoot.Width, Resources), item.Width), Resources); ImageService.Instance .LoadUrl(item.Link) .DownSample(width) .Into(MainImageView); }
public void Bind(string title, string time, Avatar avatar) { TitleLabel.Text = title; TimeLabel.Text = time; var avatarUrl = avatar?.ToUrl(64); if (avatarUrl == null) { MainImageView.Image = Images.Avatar; } else { MainImageView.SetImage(new NSUrl(avatarUrl), Images.Avatar); } }
public void Bind(string title, string time, Avatar avatar, UIImage placeholderImage) { TitleLabel.Text = title; TimeLabel.Text = time; var avatarUrl = avatar?.ToUrl(); if (avatarUrl == null) { MainImageView.Image = placeholderImage; } else { MainImageView.SetImage(new NSUrl(avatarUrl), placeholderImage); } }
public void Bind(string name, string description, string time, UIImage logoImage, string logoUri) { TitleLabel.Text = name; TimeLabel.Text = time; ContentLabel.Text = description; ContentLabel.Hidden = string.IsNullOrWhiteSpace(description); ContentConstraint.Constant = ContentLabel.Hidden ? 0 : DefaultContentConstraintSize; if (logoUri == null) { MainImageView.Image = logoImage; } else { MainImageView.SetImage(new NSUrl(logoUri), logoImage); } }
public override void AwakeFromNib() { base.AwakeFromNib(); MainImageView.Layer.MasksToBounds = true; MainImageView.Layer.CornerRadius = MainImageView.Frame.Height / 2f; ContentView.Opaque = true; SeparatorInset = new UIEdgeInsets(0, TitleLabel.Frame.Left, 0, 0); TitleLabel.TextColor = Theme.MainTitleColor; TimeLabel.TextColor = Theme.MainTextColor; this.WhenActivated(d => { d(this.OneWayBind(ViewModel, x => x.Title, x => x.TitleLabel.Text)); d(this.OneWayBind(ViewModel, x => x.Details, x => x.TimeLabel.Text)); d(this.WhenAnyValue(x => x.ViewModel.Avatar).Subscribe(x => MainImageView.SetAvatar(x))); }); }
public void Bind(string name, string description, string time, Avatar avatar) { TitleLabel.Text = name; TimeLabel.Text = time; ContentLabel.Text = description; ContentLabel.Hidden = string.IsNullOrWhiteSpace(description); ContentConstraint.Constant = ContentLabel.Hidden ? 0 : DefaultContentConstraintSize; var logoUri = avatar.ToUri(64); if (logoUri == null) { MainImageView.Image = Images.Avatar; } else { MainImageView.SetImage(new NSUrl(logoUri.AbsoluteUri), Images.Avatar); } }
private void OnPropertyChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName.Equals("ImageName") || e.PropertyName.Equals("MenuItemType")) { MainImageView.Pulse(0.25, 4); MainImageView.Image = UIImage.FromFile(ViewModel.ImageName); } else if (e.PropertyName.Equals("Title")) { TitleLabel.Text = ViewModel.Title; } else if (e.PropertyName.Equals("Subtitle")) { SubtitleLabel.Text = ViewModel.Subtitle; } else if (e.PropertyName.Equals("UserInteractionEnabled")) { UserInteractionEnabled = ViewModel.UserInteractionEnabled; } }
void ReleaseDesignerOutlets() { if (MainImageView != null) { MainImageView.Dispose(); MainImageView = null; } if (TitleLabel != null) { TitleLabel.Dispose(); TitleLabel = null; } if (SubtitleLabel != null) { SubtitleLabel.Dispose(); SubtitleLabel = null; } }
public override void AwakeFromNib() { base.AwakeFromNib(); MainImageView.Layer.MasksToBounds = true; MainImageView.Layer.CornerRadius = MainImageView.Frame.Height / 2f; ContentView.Opaque = true; SeparatorInset = new UIEdgeInsets(0, TitleLabel.Frame.Left, 0, 0); TitleLabel.TextColor = Theme.CurrentTheme.MainTitleColor; TimeLabel.TextColor = Theme.CurrentTheme.MainSubtitleColor; this.WhenAnyValue(x => x.ViewModel) .Subscribe(x => { TitleLabel.Text = x?.Title; TimeLabel.Text = x?.CreatedOn; MainImageView.SetAvatar(x?.Avatar); }); }
public override void AwakeFromNib() { base.AwakeFromNib(); MainImageView.Layer.MasksToBounds = true; MainImageView.Layer.CornerRadius = MainImageView.Frame.Height / 2f; ContentView.Opaque = true; SeparatorInset = new UIEdgeInsets(0, TitleLabel.Frame.Left, 0, 0); TitleLabel.TextColor = Theme.CurrentTheme.MainTitleColor; TimeLabel.TextColor = Theme.CurrentTheme.MainTextColor; this.WhenAnyValue(x => x.ViewModel) .Where(x => x != null) .Subscribe(x => { MainImageView.SetImage(new NSUrl(x.ImageUrl), Images.LoginUserUnknown); TitleLabel.Text = x.Title; TimeLabel.Text = x.Details; }); }
void ReleaseDesignerOutlets() { if (CancelButton != null) { CancelButton.Dispose(); CancelButton = null; } if (DescriptionLabel != null) { DescriptionLabel.Dispose(); DescriptionLabel = null; } if (MainImageView != null) { MainImageView.Dispose(); MainImageView = null; } if (PurchaseButton != null) { PurchaseButton.Dispose(); PurchaseButton = null; } if (TitleLabel != null) { TitleLabel.Dispose(); TitleLabel = null; } if (RestoreButton != null) { RestoreButton.Dispose(); RestoreButton = null; } }
void ReleaseDesignerOutlets() { if (CaptionLabel != null) { CaptionLabel.Dispose(); CaptionLabel = null; } if (NoteLabel != null) { NoteLabel.Dispose(); NoteLabel = null; } if (LocationLabel != null) { LocationLabel.Dispose(); LocationLabel = null; } if (MainImageView != null) { MainImageView.Dispose(); MainImageView = null; } if (DateTimeLabel != null) { DateTimeLabel.Dispose(); DateTimeLabel = null; } if (DeleteButton != null) { DeleteButton.Dispose(); DeleteButton = null; } }
public override void AwakeFromNib() { base.AwakeFromNib(); MainImageView.Layer.MasksToBounds = true; MainImageView.Layer.CornerRadius = MainImageView.Frame.Height / 2f; SeparatorInset = new UIEdgeInsets(0, TitleLabel.Frame.Left, 0, 0); TitleLabel.TextColor = UIColor.FromRGB(0, 64, 128); TimeLabel.TextColor = UIColor.Gray; ContentLabel.TextColor = UIColor.FromRGB(41, 41, 41); DefaultContentConstraintSize = ContentConstraint.Constant; this.WhenAnyValue(x => x.ViewModel) .Where(x => x != null) .Subscribe(x => { MainImageView.SetImage(new NSUrl(x.ImageUrl), Images.LoginUserUnknown); TitleLabel.Text = x.Name; ContentLabel.Text = x.Description; TimeLabel.Text = x.Time.ToDaysAgo(); ContentConstraint.Constant = string.IsNullOrEmpty(x.Description) ? 0f : DefaultContentConstraintSize; }); }
void ReleaseDesignerOutlets() { if (ActivityButton2 != null) { ActivityButton2.Dispose(); ActivityButton2 = null; } if (ButtonView2 != null) { ButtonView2.Dispose(); ButtonView2 = null; } if (ButtonView1 != null) { ButtonView1.Dispose(); ButtonView1 = null; } if (AdoptedView != null) { AdoptedView.Dispose(); AdoptedView = null; } if (ActivityButton != null) { ActivityButton.Dispose(); ActivityButton = null; } if (AdoptButton != null) { AdoptButton.Dispose(); AdoptButton = null; } if (AgeValueLabel != null) { AgeValueLabel.Dispose(); AgeValueLabel = null; } if (ImageView1 != null) { ImageView1.Dispose(); ImageView1 = null; } if (ImageView2 != null) { ImageView2.Dispose(); ImageView2 = null; } if (ImageView3 != null) { ImageView3.Dispose(); ImageView3 = null; } if (ImageView4 != null) { ImageView4.Dispose(); ImageView4 = null; } if (ImageView5 != null) { ImageView5.Dispose(); ImageView5 = null; } if (ImageView6 != null) { ImageView6.Dispose(); ImageView6 = null; } if (LastSignalLabel != null) { LastSignalLabel.Dispose(); LastSignalLabel = null; } if (MainImageView != null) { MainImageView.Dispose(); MainImageView = null; } if (NameLabel != null) { NameLabel.Dispose(); NameLabel = null; } if (OwnerLabel != null) { OwnerLabel.Dispose(); OwnerLabel = null; } if (PositionLabel != null) { PositionLabel.Dispose(); PositionLabel = null; } if (TypeLabel != null) { TypeLabel.Dispose(); TypeLabel = null; } }
public void Set(string title, DateTimeOffset time, GitHubAvatar avatar) { TitleLabel.Text = title; TimeLabel.Text = time.Humanize(); MainImageView.SetAvatar(avatar); }