public void UpdateCell(Post post) { _currentPost = post; ImageUrl = post.Media[0].Thumbnails.Micro; _bodyImage?.RemoveFromSuperview(); CreateImageView(); _scheduledWork?.Cancel(); _scheduledWork = ImageService.Instance.LoadUrl(ImageUrl) .Retry(2) .FadeAnimation(false) .WithCache(FFImageLoading.Cache.CacheType.All) .WithPriority(LoadingPriority.Highest) .DownSample(250) /* .DownloadProgress((f)=> * { * })*/ .Into(_bodyImage); if (post.Media.Length > 1) { ContentView.BringSubviewToFront(_galleryImage); } }
public void UpdateCell(Post post) { _currentPost = post; _bodyImage?.RemoveFromSuperview(); CreateImageView(); _scheduledWork?.Cancel(); _scheduledWork = ImageLoader.Load(_currentPost.Media[0].Url, _bodyImage, 2, LoadingPriority.Highest, microUrl: _currentPost.Media[0].Thumbnails.Micro); if (post.Media.Length > 1) { ContentView.BringSubviewToFront(_galleryImage); } }
private void HighFiveButton_TouchUpInside(object sender, EventArgs e) { NameTextField.ResignFirstResponder(); if (ViewModel.HighFiveCommand.CanExecute("Not empty string")) { FlashView.Hidden = false; FlashView.Alpha = 1; ContentView.BringSubviewToFront(FlashView); UIView.Animate( 0.4, () => { FlashView.Alpha = 0; }, () => { FlashView.Hidden = true; }); ViewModel.HighFiveCommand.Execute(null); } }
protected CardShimmerCollectionView(IntPtr handle) : base(handle) { CustomView _image = new CustomView(); _image.BackgroundColor = UIColor.FromRGB(230, 230, 230); _image.ClipsToBounds = true; _image.Layer.CornerRadius = 15; ContentView.AddSubview(_image); _image.AutoPinEdgeToSuperviewEdge(ALEdge.Left); _image.AutoPinEdgeToSuperviewEdge(ALEdge.Top); _image.AutoPinEdgeToSuperviewEdge(ALEdge.Right); _image.AutoSetDimension(ALDimension.Height, ContentView.Frame.Width * 190f / 335f); _shadowHelper.BackgroundColor = UIColor.White; ContentView.AddSubview(_shadowHelper); _shadowHelper.AutoPinEdge(ALEdge.Left, ALEdge.Left, _image, 20); _shadowHelper.AutoPinEdge(ALEdge.Right, ALEdge.Right, _image, -20); _shadowHelper.AutoPinEdge(ALEdge.Bottom, ALEdge.Bottom, _image); _shadowHelper.AutoPinEdge(ALEdge.Top, ALEdge.Top, _image); ContentView.BringSubviewToFront(_image); var loginBackground = new UIView(); loginBackground.ClipsToBounds = true; loginBackground.Layer.CornerRadius = 15; loginBackground.BackgroundColor = Constants.R255G255B255.ColorWithAlpha(0.5f); _image.AddSubview(loginBackground); loginBackground.AutoSetDimensionsToSize(new CGSize(140, 32)); loginBackground.AutoPinEdgeToSuperviewEdge(ALEdge.Right, -20); loginBackground.AutoPinEdgeToSuperviewEdge(ALEdge.Top, 21); UILabel _balanceLabel = new UILabel(); _balanceLabel.Font = Constants.Semibold14; _balanceLabel.Text = "Steem balance"; _balanceLabel.ClipsToBounds = true; _balanceLabel.Layer.CornerRadius = 9; _balanceLabel.TextColor = UIColor.Clear; _balanceLabel.BackgroundColor = Constants.R255G255B255.ColorWithAlpha(0.5f); _image.AddSubview(_balanceLabel); _balanceLabel.AutoAlignAxis(ALAxis.Horizontal, loginBackground); _balanceLabel.AutoPinEdgeToSuperviewEdge(ALEdge.Left, 30); _equivalentBalance.Text = "2422,222"; _equivalentBalance.Font = Constants.Bold34; _equivalentBalance.ClipsToBounds = true; _equivalentBalance.Layer.CornerRadius = 22; _equivalentBalance.TextColor = UIColor.Clear; _equivalentBalance.BackgroundColor = Constants.R255G255B255.ColorWithAlpha(0.5f); _image.AddSubview(_equivalentBalance); _equivalentBalance.AutoPinEdgeToSuperviewEdge(ALEdge.Left, 30); _equivalentBalance.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, loginBackground); var bottomContainer = new UIView(); _image.AddSubview(bottomContainer); bottomContainer.AutoPinEdgeToSuperviewEdge(ALEdge.Left, 30); bottomContainer.AutoPinEdgeToSuperviewEdge(ALEdge.Right, 30); bottomContainer.AutoPinEdgeToSuperviewEdge(ALEdge.Bottom); bottomContainer.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, _equivalentBalance); var steemContainer = new CustomView(); bottomContainer.AddSubview(steemContainer); steemContainer.AutoPinEdgeToSuperviewEdge(ALEdge.Left); steemContainer.AutoAlignAxisToSuperviewAxis(ALAxis.Horizontal); steemContainer.AutoMatchDimensionWithMultiplier(ALDimension.Width, ALDimension.Width, bottomContainer, 0.5f); _firstTokenLabel.Text = "Steem"; _firstTokenLabel.ClipsToBounds = true; _firstTokenLabel.Layer.CornerRadius = 10; _firstTokenLabel.TextColor = UIColor.Clear; _firstTokenLabel.BackgroundColor = Constants.R255G255B255.ColorWithAlpha(0.5f); _firstTokenLabel.Font = Constants.Semibold14; steemContainer.AddSubview(_firstTokenLabel); _firstTokenLabel.AutoPinEdgeToSuperviewEdge(ALEdge.Left); _firstTokenLabel.AutoPinEdgeToSuperviewEdge(ALEdge.Top); _firstTokenValue.Text = "999.999"; _firstTokenValue.ClipsToBounds = true; _firstTokenValue.Font = Constants.Semibold20; _firstTokenValue.Layer.CornerRadius = 15; _firstTokenValue.TextColor = UIColor.Clear; _firstTokenValue.BackgroundColor = Constants.R255G255B255.ColorWithAlpha(0.5f); steemContainer.AddSubview(_firstTokenValue); _firstTokenValue.AutoPinEdgeToSuperviewEdge(ALEdge.Left); _firstTokenValue.AutoPinEdgeToSuperviewEdge(ALEdge.Bottom); _firstTokenValue.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, _firstTokenLabel, 5); var steemPowerContainer = new CustomView(); bottomContainer.AddSubview(steemPowerContainer); steemPowerContainer.AutoPinEdgeToSuperviewEdge(ALEdge.Right); steemPowerContainer.AutoAlignAxisToSuperviewAxis(ALAxis.Horizontal); steemPowerContainer.AutoMatchDimensionWithMultiplier(ALDimension.Width, ALDimension.Width, bottomContainer, 0.5f); _secondTokenLabel.ClipsToBounds = true; _secondTokenLabel.Text = "Steem Power"; _secondTokenLabel.Font = Constants.Semibold14; _secondTokenLabel.Layer.CornerRadius = 10; _secondTokenLabel.TextColor = UIColor.Clear; _secondTokenLabel.BackgroundColor = Constants.R255G255B255.ColorWithAlpha(0.5f); _secondTokenLabel.Font = Constants.Semibold14; steemPowerContainer.AddSubview(_secondTokenLabel); _secondTokenLabel.AutoPinEdgeToSuperviewEdge(ALEdge.Left); _secondTokenLabel.AutoPinEdgeToSuperviewEdge(ALEdge.Top); _secondTokenValue.ClipsToBounds = true; _secondTokenValue.Text = "999.999"; _secondTokenValue.Font = Constants.Semibold20; _secondTokenValue.Layer.CornerRadius = 15; _secondTokenValue.TextColor = UIColor.Clear; _secondTokenValue.BackgroundColor = Constants.R255G255B255.ColorWithAlpha(0.5f); steemPowerContainer.AddSubview(_secondTokenValue); _secondTokenValue.AutoPinEdgeToSuperviewEdge(ALEdge.Left); _secondTokenValue.AutoPinEdgeToSuperviewEdge(ALEdge.Bottom); _secondTokenValue.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, _secondTokenLabel, 5); _image.SubviewLayouted += () => { Constants.ApplyShimmer(_balanceLabel); Constants.ApplyShimmer(loginBackground); Constants.ApplyShimmer(_equivalentBalance); }; steemContainer.SubviewLayouted += () => { Constants.ApplyShimmer(_firstTokenLabel); Constants.ApplyShimmer(_firstTokenValue); }; steemContainer.SubviewLayouted += () => { Constants.ApplyShimmer(_secondTokenLabel); Constants.ApplyShimmer(_secondTokenValue); }; }
protected CardCollectionViewCell(IntPtr handle) : base(handle) { _image.ClipsToBounds = true; _image.ContentMode = UIViewContentMode.ScaleAspectFill; ContentView.AddSubview(_image); _image.AutoPinEdgeToSuperviewEdge(ALEdge.Left); _image.AutoPinEdgeToSuperviewEdge(ALEdge.Top); _image.AutoPinEdgeToSuperviewEdge(ALEdge.Right); _image.AutoSetDimension(ALDimension.Height, ContentView.Frame.Width * 190f / 335f); _shadowHelper.BackgroundColor = UIColor.White; ContentView.AddSubview(_shadowHelper); _shadowHelper.AutoPinEdge(ALEdge.Left, ALEdge.Left, _image, 20); _shadowHelper.AutoPinEdge(ALEdge.Right, ALEdge.Right, _image, -20); _shadowHelper.AutoPinEdge(ALEdge.Bottom, ALEdge.Bottom, _image); _shadowHelper.AutoPinEdge(ALEdge.Top, ALEdge.Top, _image); ContentView.BringSubviewToFront(_image); var loginBackground = new UIView(); loginBackground.Layer.CornerRadius = 15; loginBackground.BackgroundColor = Constants.R255G255B255.ColorWithAlpha(0.1f); _image.AddSubview(loginBackground); loginBackground.AutoSetDimensionsToSize(new CGSize(140, 32)); loginBackground.AutoPinEdgeToSuperviewEdge(ALEdge.Right, -20); loginBackground.AutoPinEdgeToSuperviewEdge(ALEdge.Top, 21); _login.Font = Constants.Semibold14; _login.TextColor = Constants.R255G255B255; loginBackground.AddSubview(_login); _login.AutoAlignAxisToSuperviewAxis(ALAxis.Horizontal); _login.AutoPinEdgeToSuperviewEdge(ALEdge.Right, 20); _login.AutoPinEdgeToSuperviewEdge(ALEdge.Left, 21); _balanceLabel.Font = Constants.Semibold14; _balanceLabel.TextColor = Constants.R255G255B255.ColorWithAlpha(0.5f); _image.AddSubview(_balanceLabel); _balanceLabel.AutoAlignAxis(ALAxis.Horizontal, loginBackground); _balanceLabel.AutoPinEdgeToSuperviewEdge(ALEdge.Left, 30); _equivalentBalance.Font = Constants.Bold34; _equivalentBalance.TextColor = Constants.R255G255B255; _image.AddSubview(_equivalentBalance); _equivalentBalance.AutoPinEdgeToSuperviewEdge(ALEdge.Left, 30); _equivalentBalance.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, loginBackground); _equivalentBalance.AutoPinEdgeToSuperviewEdge(ALEdge.Right); var bottomContainer = new UIView(); _image.AddSubview(bottomContainer); bottomContainer.AutoPinEdgeToSuperviewEdge(ALEdge.Left, 30); bottomContainer.AutoPinEdgeToSuperviewEdge(ALEdge.Right, 30); bottomContainer.AutoPinEdgeToSuperviewEdge(ALEdge.Bottom); bottomContainer.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, _equivalentBalance); var steemContainer = new UIView(); bottomContainer.AddSubview(steemContainer); steemContainer.AutoPinEdgeToSuperviewEdge(ALEdge.Left); steemContainer.AutoAlignAxisToSuperviewAxis(ALAxis.Horizontal); steemContainer.AutoMatchDimensionWithMultiplier(ALDimension.Width, ALDimension.Width, bottomContainer, 0.5f); _firstTokenLabel.Text = "Steem"; _firstTokenLabel.Font = Constants.Semibold14; _firstTokenLabel.TextColor = Constants.R255G255B255.ColorWithAlpha(0.5f); steemContainer.AddSubview(_firstTokenLabel); _firstTokenLabel.AutoPinEdgeToSuperviewEdge(ALEdge.Left); _firstTokenLabel.AutoPinEdgeToSuperviewEdge(ALEdge.Right); _firstTokenLabel.AutoPinEdgeToSuperviewEdge(ALEdge.Top); _firstTokenValue.Text = "999.999"; _firstTokenValue.Font = Constants.Semibold20; _firstTokenValue.TextColor = Constants.R255G255B255; steemContainer.AddSubview(_firstTokenValue); _firstTokenValue.AutoPinEdgeToSuperviewEdge(ALEdge.Left); _firstTokenValue.AutoPinEdgeToSuperviewEdge(ALEdge.Right); _firstTokenValue.AutoPinEdgeToSuperviewEdge(ALEdge.Bottom); _firstTokenValue.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, _firstTokenLabel); var steemPowerContainer = new UIView(); bottomContainer.AddSubview(steemPowerContainer); steemPowerContainer.AutoPinEdgeToSuperviewEdge(ALEdge.Right); steemPowerContainer.AutoAlignAxisToSuperviewAxis(ALAxis.Horizontal); steemPowerContainer.AutoMatchDimensionWithMultiplier(ALDimension.Width, ALDimension.Width, bottomContainer, 0.5f); _secondTokenLabel.Text = "Steem Power"; _secondTokenLabel.Font = Constants.Semibold14; _secondTokenLabel.TextColor = Constants.R255G255B255.ColorWithAlpha(0.5f); steemPowerContainer.AddSubview(_secondTokenLabel); _secondTokenLabel.AutoPinEdgeToSuperviewEdge(ALEdge.Left); _secondTokenLabel.AutoPinEdgeToSuperviewEdge(ALEdge.Right); _secondTokenLabel.AutoPinEdgeToSuperviewEdge(ALEdge.Top); _secondTokenValue.Text = "999.999"; _secondTokenValue.Font = Constants.Semibold20; _secondTokenValue.TextColor = Constants.R255G255B255; steemPowerContainer.AddSubview(_secondTokenValue); _secondTokenValue.AutoPinEdgeToSuperviewEdge(ALEdge.Left); _secondTokenValue.AutoPinEdgeToSuperviewEdge(ALEdge.Right); _secondTokenValue.AutoPinEdgeToSuperviewEdge(ALEdge.Bottom); _secondTokenValue.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, _secondTokenLabel); }
public override void AwakeFromNib() { base.AwakeFromNib(); BackgroundView = new UIImageView(); accept.SetTitleColor(UIColor.White, UIControlState.Normal); decline.SetTitleColor(UIColor.White, UIControlState.Normal); numberAndDate.TextColor = title.TextColor = startAndEnd.TextColor = numberAndDate.HighlightedTextColor = title.HighlightedTextColor = startAndEnd.HighlightedTextColor = Theme.LabelColor; contact.IconImage = Theme.IconPhone; address.IconImage = Theme.Map; status.StatusChanged += (sender, e) => SaveAssignment(); status.Completed += (sender, e) => { var menuViewModel = ServiceContainer.Resolve <MenuViewModel>(); menuViewModel.MenuIndex = SectionIndex.Confirmations; assignmentViewModel.SelectedAssignment = status.Assignment; controller.PerformSegue("AssignmentDetails", controller); }; if (Theme.IsiOS7) { priorityBackground.Image = Theme.NumberBoxHollow; accept.SetTitleColor(Theme.GreenColor, UIControlState.Normal); decline.SetTitleColor(Theme.RedColor, UIControlState.Normal); accept.Font = decline.Font = Theme.FontOfSize(16); startAndEnd.Font = Theme.BoldFontOfSize(10); startAndEnd.TextColor = UIColor.White; priority.TextColor = priority.HighlightedTextColor = Theme.LightGrayColor; //Status frame var frame = status.Frame; frame.Width /= 2; frame.X += frame.Width; status.Frame = frame; //Priority frame frame = priorityBackground.Frame; frame.Width = frame.Height; priorityBackground.Frame = priority.Frame = frame; //Start/end date frame = startAndEnd.Frame; frame.X += 4; startAndEnd.Frame = frame; //Additional green rectangle on the right statusView = new UIView(new RectangleF(Frame.Width - 8, 0, 8, Frame.Height)) { BackgroundColor = Theme.YellowColor, AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleLeftMargin, }; AddSubview(statusView); //Additional box for the start/end date frame = startAndEnd.Frame; frame.X -= 4; frame.Y += 4; frame.Width = 102; frame.Height = 16; var timeBox = new UIImageView(frame) { Image = Theme.TimeBox, ContentMode = UIViewContentMode.Left, }; ContentView.AddSubview(timeBox); ContentView.BringSubviewToFront(startAndEnd); } else { priorityBackground.Image = Theme.NumberBox; accept.SetBackgroundImage(Theme.Accept, UIControlState.Normal); decline.SetBackgroundImage(Theme.Decline, UIControlState.Normal); priority.TextColor = priority.HighlightedTextColor = UIColor.White; } }