private void DecorateFollowButton() { if (!AppSettings.User.HasPostingPermission || _currentUser.Author == AppSettings.User.Login) { followButton.Hidden = true; return; } if (_currentUser.FollowedChanging) { followButton.Selected = false; followButton.Enabled = false; followButton.Layer.BorderWidth = 0; Constants.CreateGradient(followButton, _cornerRadius); progressBar.StartAnimating(); } else { followButton.Enabled = true; followButton.Selected = _currentUser.HasFollowed; progressBar.StopAnimating(); if (_currentUser.HasFollowed) { Constants.RemoveGradient(followButton); followButton.Layer.BorderWidth = 1; } else { followButton.Layer.BorderWidth = 0; Constants.CreateGradient(followButton, _cornerRadius); } } }
public override void ViewDidLoad() { base.ViewDidLoad(); Constants.CreateShadow(loginButton, Constants.R231G72B0, 0.5f, 25, 10, 12); avatar.Layer.CornerRadius = avatar.Frame.Height / 2; var eyeButton = new UIButton(new CGRect(0, 0, 25, password.Frame.Height)); eyeButton.SetImage(UIImage.FromBundle("eye"), UIControlState.Normal); password.RightView = eyeButton; password.RightViewMode = UITextFieldViewMode.Always; qrButton.Layer.CornerRadius = 25; qrButton.Layer.BorderWidth = 1f; qrButton.Layer.BorderColor = Constants.R244G244B246.CGColor; if (_isPostingMode) { var avatarLink = AccountInfoResponse.Metadata?.Profile?.ProfileImage; if (!string.IsNullOrEmpty(avatarLink)) { ImageLoader.Load(avatarLink, avatar, size: new CGSize(300, 300)); } else { avatar.Image = UIImage.FromBundle("ic_noavatar"); } } else { Username = AppSettings.User.Login; password.Placeholder = "Private active key"; avatar.Image = ((MainTabBarController)NavigationController.ViewControllers[0])._avatar.Image; GetAccountInfo(); } password.Font = Constants.Regular14; loginButton.Font = Constants.Semibold14; qrButton.Font = Constants.Semibold14; #if DEBUG var di = AppSettings.AssetHelper.GetDebugInfo(); if (AppDelegate.MainChain == KnownChains.Steem) { password.Text = di.SteemTestWif; } else { password.Text = di.GolosTestWif; } #endif loginButton.TouchDown += Login; eyeButton.TouchDown += EyeButtonTouch; password.ShouldReturn += PasswordShouldReturn; password.ShouldChangeCharacters += ShouldCharactersChange; qrButton.TouchDown += QrTouch; SetBackButton(); }
public void ReloadCollection() { more.Enabled = true; transfer.Enabled = true; Constants.CreateGradient(transfer, 25); _cardsCollection.UserInteractionEnabled = true; _cardsCollection.ReloadData(); _pageControl.Pages = _presenter.Balances.Count; }
public override void ViewDidLayoutSubviews() { if (!_isinitialized) { postPhotoButton.LayoutIfNeeded(); Constants.CreateGradient(postPhotoButton, 25); Constants.CreateShadow(postPhotoButton, Constants.R231G72B0, 0.5f, 25, 10, 12); _isinitialized = true; } }
public override void ViewDidLoad() { base.ViewDidLoad(); Constants.CreateShadow(loginButton, Constants.R231G72B0, 0.5f, 25, 10, 12); avatar.Layer.CornerRadius = avatar.Frame.Height / 2; var eyeButton = new UIButton(new CGRect(0, 0, 25, password.Frame.Height)); eyeButton.SetImage(UIImage.FromBundle("eye"), UIControlState.Normal); password.RightView = eyeButton; password.RightViewMode = UITextFieldViewMode.Always; qrButton.Layer.CornerRadius = 25; qrButton.Layer.BorderWidth = 1f; qrButton.Layer.BorderColor = Constants.R244G244B246.CGColor; ImageService.Instance.LoadUrl(AvatarLink, TimeSpan.FromDays(30)) .Retry(2, 200) .FadeAnimation(false, true) .DownSample(width: 300) .Into(avatar); password.Font = Constants.Regular14; loginButton.Font = Constants.Semibold14; qrButton.Font = Constants.Semibold14; #if DEBUG var di = AppSettings.AssetsesHelper.GetDebugInfo(); if (BasePresenter.Chain == KnownChains.Steem) { password.Text = di.SteemTestWif; } else { password.Text = di.GolosTestWif; } #endif loginButton.TouchDown += Login; eyeButton.TouchDown += EyeButtonTouch; password.ShouldReturn += PasswordShouldReturn; password.ShouldChangeCharacters += ShouldCharactersChange; qrButton.TouchDown += QrTouch; SetBackButton(); }
public override void ViewDidLoad() { base.ViewDidLoad(); Constants.CreateShadow(loginButton, Constants.R231G72B0, 0.5f, 25, 10, 12); loginText.Font = Constants.Regular14; loginButton.Font = Constants.Semibold14; loginText.ShouldReturn += LoginShouldReturn; loginButton.TouchDown += Login; #if DEBUG if (BasePresenter.Chain == KnownChains.Steem) { loginText.Text = DebugHelper.GetTestSteemLogin(); } else { loginText.Text = DebugHelper.GetTestGolosLogin(); } #endif NavigationController.SetNavigationBarHidden(false, false); SetBackButton(); }
public override void ViewDidLayoutSubviews() { Constants.CreateGradient(postPhotoButton, 25); Constants.CreateShadow(postPhotoButton, Constants.R231G72B0, 0.5f, 25, 10, 12); }
public override void ViewDidLayoutSubviews() { base.ViewDidLayoutSubviews(); Constants.CreateGradient(loginButton, 25); }
private void SetupCardsCollection() { var cellProportion = 240f / 335f; var cellSize = new CGSize(UIScreen.MainScreen.Bounds.Width - 20f * 2f, (UIScreen.MainScreen.Bounds.Width - 20f * 2f) * cellProportion); var cardProportion = 190f / 335f; var cardCenter = ((UIScreen.MainScreen.Bounds.Width - 20f * 2f) * cardProportion / 2) + 20; var cardBottom = ((UIScreen.MainScreen.Bounds.Width - 20f * 2f) * cardProportion) + 25; _cardBehind.BackgroundColor = UIColor.FromRGB(255, 255, 255); _cardBehind.Layer.CornerRadius = 16; Constants.CreateShadowFromZeplin(_cardBehind, UIColor.FromRGB(0, 0, 0), 0.03f, 0, 1, 1, 0); AddSubview(_cardBehind); _cardBehind.AutoPinEdgeToSuperviewEdge(ALEdge.Top, cardCenter); _cardBehind.AutoPinEdgeToSuperviewEdge(ALEdge.Left, 10); _cardBehind.AutoPinEdgeToSuperviewEdge(ALEdge.Right, 10); _cardBehind.AutoSetDimension(ALDimension.Height, cardCenter + 115); _cardsCollection = new UICollectionView(CGRect.Null, new SliderFlowLayout() { ScrollDirection = UICollectionViewScrollDirection.Horizontal, ItemSize = cellSize, MinimumLineSpacing = 10, SectionInset = new UIEdgeInsets(0, 20, 0, 20), }) { BackgroundColor = UIColor.Clear }; _cardsCollection.RegisterClassForCell(typeof(CardShimmerCollectionView), nameof(CardShimmerCollectionView)); _cardsCollection.RegisterClassForCell(typeof(CardCollectionViewCell), nameof(CardCollectionViewCell)); AddSubview(_cardsCollection); _cardsCollection.AutoPinEdgeToSuperviewEdge(ALEdge.Top, 20); _cardsCollection.AutoPinEdgeToSuperviewEdge(ALEdge.Left); _cardsCollection.AutoPinEdgeToSuperviewEdge(ALEdge.Right); _cardsCollection.AutoSetDimension(ALDimension.Height, cellSize.Height); _cardsGridDelegate.CardsScrolled += () => { var pageWidth = cellSize.Width + 20; _pageControl.CurrentPage = (int)Math.Floor((_cardsCollection.ContentOffset.X - pageWidth / 2) / pageWidth) + 1; }; _cardsCollection.UserInteractionEnabled = false; _cardsCollection.DecelerationRate = UIScrollView.DecelerationRateFast; _cardsCollection.ShowsHorizontalScrollIndicator = false; _cardsCollection.Layer.MasksToBounds = false; _cardsCollection.ClipsToBounds = false; _pageControl.Pages = 5; _pageControl.PageIndicatorTintColor = UIColor.FromRGB(0, 0, 0).ColorWithAlpha(0.1f); _pageControl.CurrentPageIndicatorTintColor = UIColor.FromRGB(0, 0, 0).ColorWithAlpha(0.4f); _pageControl.UserInteractionEnabled = false; AddSubview(_pageControl); _pageControl.AutoPinEdgeToSuperviewEdge(ALEdge.Top, cardBottom); _pageControl.AutoAlignAxis(ALAxis.Vertical, _cardsCollection); transfer.Enabled = false; transfer.SetTitle("TRANSFER", UIControlState.Normal); transfer.Font = Constants.Bold14; transfer.SetTitleColor(UIColor.White, UIControlState.Normal); transfer.Layer.CornerRadius = 25; transfer.BackgroundColor = UIColor.FromRGB(230, 230, 230); transfer.ClipsToBounds = true; AddSubview(transfer); transfer.TouchDown += (object sender, EventArgs e) => { _navigationController.PushViewController(new TransferViewController(), true); }; transfer.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, _pageControl, 20); transfer.AutoPinEdgeToSuperviewEdge(ALEdge.Left, 20); transfer.AutoSetDimension(ALDimension.Height, 50); more.Enabled = false; more.BackgroundColor = Constants.R250G250B250; more.SetImage(UIImage.FromBundle("ic_more"), UIControlState.Normal); more.Layer.CornerRadius = 25; more.ClipsToBounds = true; more.TouchDown += (object sender, EventArgs e) => { Popups.PowerManipulationPopup.Create(_navigationController, _presenter, async(bool response) => { if (response) { var balance = _presenter.Balances[0]; var model = new BalanceModel(0, balance.MaxDecimals, balance.CurrencyType) { UserInfo = balance.UserInfo }; await _presenter.TryPowerUpOrDown(model, PowerAction.CancelPowerDown); _presenter.UpdateWallet?.Invoke(); } }); }; AddSubview(more); more.AutoAlignAxis(ALAxis.Horizontal, transfer); more.AutoPinEdgeToSuperviewEdge(ALEdge.Right, 20); more.AutoPinEdge(ALEdge.Left, ALEdge.Right, transfer, 10); more.AutoSetDimensionsToSize(new CGSize(50, 50)); var historyLabel = new UILabel(); historyLabel.Text = "Transaction history"; historyLabel.Font = Constants.Regular20; historyLabel.TextColor = UIColor.Black; AddSubview(historyLabel); historyLabel.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, _cardBehind, 27); historyLabel.AutoPinEdgeToSuperviewEdge(ALEdge.Left, 20); historyLabel.AutoPinEdgeToSuperviewEdge(ALEdge.Bottom); }
public CustomAlertView Create(Post post, UINavigationController controller, UIView view) { _pickedCoin = CurrencyType.Steem; _coins = new List <CurrencyType>(); switch (AppSettings.User.Chain) { case KnownChains.Steem: _coins.AddRange(new[] { CurrencyType.Steem, CurrencyType.Sbd }); break; case KnownChains.Golos: _coins.AddRange(new[] { CurrencyType.Golos, CurrencyType.Gbg }); break; } var popup = new UIView(); popup.ClipsToBounds = true; popup.Layer.CornerRadius = 20; popup.BackgroundColor = Constants.R255G255B255; var _alert = new CustomAlertView(popup, controller); var dialogWidth = UIScreen.MainScreen.Bounds.Width - 10 * 2; popup.AutoSetDimension(ALDimension.Width, dialogWidth); var commonMargin = 20; var title = new UILabel(); title.Font = Constants.Semibold14; title.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.PromotePost); title.TextAlignment = UITextAlignment.Center; popup.AddSubview(title); title.AutoPinEdgeToSuperviewEdge(ALEdge.Top); title.AutoPinEdgeToSuperviewEdge(ALEdge.Left); title.AutoPinEdgeToSuperviewEdge(ALEdge.Right); title.AutoSetDimension(ALDimension.Height, 70); var topSeparator = new UIView(); topSeparator.BackgroundColor = Constants.R245G245B245; popup.AddSubview(topSeparator); topSeparator.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, title); topSeparator.AutoPinEdgeToSuperviewEdge(ALEdge.Left, commonMargin); topSeparator.AutoPinEdgeToSuperviewEdge(ALEdge.Right, commonMargin); topSeparator.AutoSetDimension(ALDimension.Height, 1); var container = new UIView(); popup.AddSubview(container); container.AutoSetDimension(ALDimension.Height, 142); container.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, topSeparator); container.AutoPinEdgeToSuperviewEdge(ALEdge.Left, commonMargin); container.AutoPinEdgeToSuperviewEdge(ALEdge.Right, commonMargin); var promotionLabel = new UILabel(); promotionLabel.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.Amount); promotionLabel.Font = Constants.Semibold14; container.AddSubview(promotionLabel); promotionLabel.AutoPinEdgeToSuperviewEdge(ALEdge.Top, 27); promotionLabel.AutoPinEdgeToSuperviewEdge(ALEdge.Left); balanceLoader = new UIActivityIndicatorView(); balanceLoader.ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.White; balanceLoader.Color = UIColor.Black; balanceLoader.HidesWhenStopped = true; balanceLoader.StartAnimating(); container.AddSubview(balanceLoader); balanceLoader.AutoPinEdge(ALEdge.Left, ALEdge.Right, promotionLabel, 10); balanceLoader.AutoAlignAxis(ALAxis.Horizontal, promotionLabel); balanceLabel = new UILabel(); balanceLabel.Font = Constants.Semibold14; balanceLabel.TextColor = Constants.R151G155B158; balanceLabel.TextAlignment = UITextAlignment.Right; container.AddSubview(balanceLabel); balanceLabel.AutoAlignAxis(ALAxis.Horizontal, promotionLabel); balanceLabel.AutoPinEdgeToSuperviewEdge(ALEdge.Right); balanceLabel.AutoPinEdge(ALEdge.Left, ALEdge.Right, promotionLabel, 5); balanceLabel.SetContentHuggingPriority(1, UILayoutConstraintAxis.Horizontal); GetBalance(); var rightView = new UIView(); container.AddSubview(rightView); rightView.AutoSetDimension(ALDimension.Height, 50); UIImageView pickerImage = new UIImageView(UIImage.FromBundle("ic_currency_picker.png")); rightView.AddSubview(pickerImage); pickerImage.AutoAlignAxisToSuperviewAxis(ALAxis.Horizontal); pickerImage.AutoPinEdgeToSuperviewEdge(ALEdge.Right, 10); UILabel _pickerLabel = new UILabel(); _pickerLabel.Text = "STEEM"; _pickerLabel.TextAlignment = UITextAlignment.Center; _pickerLabel.Font = Constants.Semibold14; _pickerLabel.TextColor = Constants.R255G71B5; rightView.AddSubview(_pickerLabel); _pickerLabel.AutoAlignAxisToSuperviewAxis(ALAxis.Horizontal); _pickerLabel.AutoPinEdgeToSuperviewEdge(ALEdge.Left); _pickerLabel.AutoPinEdge(ALEdge.Right, ALEdge.Left, pickerImage, -5); rightView.LayoutIfNeeded(); _amountTextField = new SearchTextField(AppSettings.LocalizationManager.GetText(LocalizationKeys.TransferAmountHint), new UIEdgeInsets(0, 20, 0, 0), new AmountFieldDelegate(), false, rightView); _amountTextField.KeyboardType = UIKeyboardType.DecimalPad; _amountTextField.Layer.CornerRadius = 25; container.AddSubview(_amountTextField); _amountTextField.AutoPinEdgeToSuperviewEdge(ALEdge.Left); _amountTextField.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, promotionLabel, 16); _amountTextField.AutoSetDimension(ALDimension.Height, 50); errorMessage = new UILabel(); errorMessage.Font = Constants.Semibold14; errorMessage.TextColor = Constants.R255G34B5; container.AddSubview(errorMessage); errorMessage.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, _amountTextField); errorMessage.AutoPinEdge(ALEdge.Left, ALEdge.Left, _amountTextField); errorMessage.AutoPinEdge(ALEdge.Right, ALEdge.Right, _amountTextField); _amountTextField.EditingChanged += IsEnoughBalance; var max = new UIButton(); max.SetTitle(AppSettings.LocalizationManager.GetText(LocalizationKeys.Max), UIControlState.Normal); max.SetTitleColor(UIColor.Black, UIControlState.Normal); max.Font = Constants.Semibold14; max.Layer.BorderWidth = 1; max.Layer.BorderColor = Constants.R245G245B245.CGColor; max.Layer.CornerRadius = 25; container.AddSubview(max); max.AutoPinEdgeToSuperviewEdge(ALEdge.Right); max.AutoPinEdge(ALEdge.Left, ALEdge.Right, _amountTextField, 10); max.AutoSetDimensionsToSize(new CGSize(80, 50)); max.AutoAlignAxis(ALAxis.Horizontal, _amountTextField); max.TouchDown += MaxBtnOnClick; rightView.AutoAlignAxis(ALAxis.Horizontal, _amountTextField); rightView.AutoPinEdge(ALEdge.Right, ALEdge.Right, _amountTextField); container.BringSubviewToFront(rightView); UIPickerView picker = new UIPickerView(); picker.Select(_coins.IndexOf(_pickedCoin), 0, true); picker.Model = new CoinPickerViewModel(_coins); picker.BackgroundColor = Constants.R255G255B255; popup.AddSubview(picker); picker.AutoMatchDimension(ALDimension.Height, ALDimension.Height, container); picker.AutoMatchDimension(ALDimension.Width, ALDimension.Width, container); picker.AutoPinEdge(ALEdge.Top, ALEdge.Top, container); var pickerHidden = picker.AutoPinEdge(ALEdge.Right, ALEdge.Left, container, -20); var pickerVisible = picker.AutoPinEdge(ALEdge.Right, ALEdge.Right, container); pickerVisible.Active = false; var promoteContainer = new UIView(); promoteContainer.BackgroundColor = Constants.R255G255B255; popup.AddSubview(promoteContainer); promoteContainer.AutoMatchDimension(ALDimension.Height, ALDimension.Height, container); promoteContainer.AutoMatchDimension(ALDimension.Width, ALDimension.Width, container); promoteContainer.AutoPinEdge(ALEdge.Top, ALEdge.Top, container); var promoteHidden = promoteContainer.AutoPinEdge(ALEdge.Left, ALEdge.Right, container, 20); var promoteVisible = promoteContainer.AutoPinEdge(ALEdge.Left, ALEdge.Left, container); promoteVisible.Active = false; var avatar = new UIImageView(); avatar.Layer.CornerRadius = 20; avatar.ClipsToBounds = true; promoteContainer.AddSubview(avatar); avatar.AutoPinEdgeToSuperviewEdge(ALEdge.Top, 16); avatar.AutoPinEdgeToSuperviewEdge(ALEdge.Left); avatar.AutoSetDimensionsToSize(new CGSize(40, 40)); var promoterLogin = new UILabel(); promoterLogin.Font = Constants.Semibold14; promoterLogin.TextColor = Constants.R255G34B5; promoteContainer.AddSubview(promoterLogin); promoterLogin.AutoPinEdge(ALEdge.Left, ALEdge.Right, avatar, 20); promoterLogin.AutoPinEdgeToSuperviewEdge(ALEdge.Right); promoterLogin.AutoAlignAxis(ALAxis.Horizontal, avatar); var expectedTimeBackground = new UIView(); expectedTimeBackground.Layer.CornerRadius = 10; expectedTimeBackground.BackgroundColor = Constants.R250G250B250; promoteContainer.AddSubview(expectedTimeBackground); expectedTimeBackground.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, avatar, 15); expectedTimeBackground.AutoPinEdgeToSuperviewEdge(ALEdge.Left); expectedTimeBackground.AutoPinEdgeToSuperviewEdge(ALEdge.Right); expectedTimeBackground.AutoSetDimension(ALDimension.Height, 50); var expectedTimeLabel = new UILabel(); expectedTimeLabel.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.ExpectedVoteTime); expectedTimeLabel.Font = Constants.Regular14; expectedTimeBackground.AddSubview(expectedTimeLabel); expectedTimeLabel.AutoPinEdgeToSuperviewEdge(ALEdge.Left, DeviceHelper.IsSmallDevice ? 10 : 20); expectedTimeLabel.AutoAlignAxisToSuperviewAxis(ALAxis.Horizontal); var expectedTimeValue = new UILabel(); expectedTimeValue.TextAlignment = UITextAlignment.Right; expectedTimeValue.Font = Constants.Light20; expectedTimeBackground.AddSubview(expectedTimeValue); expectedTimeValue.AutoPinEdge(ALEdge.Left, ALEdge.Right, expectedTimeLabel); expectedTimeValue.AutoPinEdgeToSuperviewEdge(ALEdge.Right, DeviceHelper.IsSmallDevice ? 10 : 20); expectedTimeValue.AutoAlignAxisToSuperviewAxis(ALAxis.Horizontal); var sureText = new UILabel(); sureText.BackgroundColor = Constants.R255G255B255; sureText.Lines = 4; sureText.TextAlignment = UITextAlignment.Center; sureText.Font = Constants.Regular20; popup.AddSubview(sureText); sureText.AutoMatchDimension(ALDimension.Height, ALDimension.Height, container); sureText.AutoMatchDimension(ALDimension.Width, ALDimension.Width, container); sureText.AutoPinEdge(ALEdge.Top, ALEdge.Top, container); var sureTextHidden = sureText.AutoPinEdge(ALEdge.Left, ALEdge.Right, container, 20); var sureTextVisible = sureText.AutoPinEdge(ALEdge.Left, ALEdge.Left, container); sureTextVisible.Active = false; var completeText = new UILabel(); completeText.BackgroundColor = Constants.R255G255B255; completeText.Lines = 4; completeText.TextAlignment = UITextAlignment.Center; completeText.Font = Constants.Regular20; popup.AddSubview(completeText); completeText.AutoMatchDimension(ALDimension.Height, ALDimension.Height, container); completeText.AutoMatchDimension(ALDimension.Width, ALDimension.Width, container); completeText.AutoPinEdge(ALEdge.Top, ALEdge.Top, container); var completeTextHidden = completeText.AutoPinEdge(ALEdge.Left, ALEdge.Right, container, 20); var completeTextVisible = completeText.AutoPinEdge(ALEdge.Left, ALEdge.Left, container); completeTextVisible.Active = false; var separator = new UIView(); separator.BackgroundColor = Constants.R245G245B245; popup.AddSubview(separator); separator.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, container); separator.AutoPinEdgeToSuperviewEdge(ALEdge.Left, commonMargin); separator.AutoPinEdgeToSuperviewEdge(ALEdge.Right, commonMargin); separator.AutoSetDimension(ALDimension.Height, 1); var selectButton = new UIButton(); selectButton.SetTitle(string.Empty, UIControlState.Disabled); selectButton.SetTitle(AppSettings.LocalizationManager.GetText(LocalizationKeys.FindPromoter), UIControlState.Normal); selectButton.SetTitleColor(UIColor.White, UIControlState.Normal); selectButton.Layer.CornerRadius = 25; selectButton.Font = Constants.Bold14; popup.AddSubview(selectButton); selectButton.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, separator, 20); selectButton.AutoPinEdgeToSuperviewEdge(ALEdge.Right, commonMargin); selectButton.AutoPinEdgeToSuperviewEdge(ALEdge.Left, commonMargin); selectButton.AutoSetDimension(ALDimension.Height, 50); selectButton.LayoutIfNeeded(); var loader = new UIActivityIndicatorView(); loader.ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.White; loader.HidesWhenStopped = true; selectButton.AddSubview(loader); loader.AutoCenterInSuperview(); var tap = new UITapGestureRecognizer(() => { if (balances == null) { return; } _amountTextField.ResignFirstResponder(); pickerHidden.Active = false; pickerVisible.Active = true; UIView.Animate(0.2, 0, UIViewAnimationOptions.CurveEaseIn, () => { popup.LayoutIfNeeded(); }, () => { title.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.SelectToken); selectButton.SetTitle(AppSettings.LocalizationManager.GetText(LocalizationKeys.Select), UIControlState.Normal); }); }); rightView.AddGestureRecognizer(tap); var cancelButton = new UIButton(); cancelButton.SetTitle(AppSettings.LocalizationManager.GetText(LocalizationKeys.Close), UIControlState.Normal); cancelButton.SetTitleColor(UIColor.Black, UIControlState.Normal); cancelButton.Layer.CornerRadius = 25; cancelButton.Font = Constants.Semibold14; cancelButton.Layer.BorderWidth = 1; cancelButton.Layer.BorderColor = Constants.R245G245B245.CGColor; popup.AddSubview(cancelButton); cancelButton.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, selectButton, 20); cancelButton.AutoPinEdgeToSuperviewEdge(ALEdge.Left, commonMargin); cancelButton.AutoPinEdgeToSuperviewEdge(ALEdge.Right, commonMargin); cancelButton.AutoPinEdgeToSuperviewEdge(ALEdge.Bottom, commonMargin); cancelButton.AutoSetDimension(ALDimension.Height, 50); controller.View.EndEditing(true); Timer timer = null; OperationResult <PromoteResponse> promoter = null; selectButton.TouchDown += async(sender, e) => { if (balanceLoader.IsAnimating) { return; } IsEnoughBalance(null, null); if (pickerVisible.Active) { _pickedCoin = _coins[(int)picker.SelectedRowInComponent(0)]; _pickerLabel.Text = _pickedCoin.ToString().ToUpper(); var balance = balances?.Find(x => x.CurrencyType == _pickedCoin); balanceLabel.Text = $"{AppSettings.LocalizationManager.GetText(LocalizationKeys.Balance)}: {balance?.Value}"; pickerHidden.Active = true; pickerVisible.Active = false; UIView.Animate(0.5, () => { popup.LayoutIfNeeded(); }, () => { title.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.PromotePost); selectButton.SetTitle(AppSettings.LocalizationManager.GetText(LocalizationKeys.FindPromoter), UIControlState.Normal); _amountTextField.UpdateRightViewRect(); }); } else if (sureTextVisible.Active) { if (!AppSettings.User.HasActivePermission) { _alert.Hidden = true; controller.PushViewController(new LoginViewController(false), true); return; } selectButton.Enabled = false; loader.StartAnimating(); sureTextHidden.Active = true; sureTextVisible.Active = false; var transferResponse = await _presenter.TryTransfer(AppSettings.User.UserInfo, promoter.Result.Bot.Author, _amountTextField.GetDoubleValue().ToString(), _pickedCoin, $"https://steemit.com{post.Url}"); if (transferResponse.IsSuccess) { completeText.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.SuccessPromote); } else { completeText.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.TokenTransferError); } completeTextHidden.Active = false; completeTextVisible.Active = true; UIView.Animate(0.2, 0, UIViewAnimationOptions.CurveEaseIn, () => { popup.LayoutIfNeeded(); }, () => { selectButton.Enabled = true; loader.StopAnimating(); title.Text = true ? AppSettings.LocalizationManager.GetText(LocalizationKeys.PromoteComplete) : AppSettings.LocalizationManager.GetText(LocalizationKeys.TransferError); selectButton.SetTitle(AppSettings.LocalizationManager.GetText(LocalizationKeys.PromoteAgain), UIControlState.Normal); promoteVisible.Active = false; promoteHidden.Active = true; popup.LayoutIfNeeded(); timer?.Dispose(); }); } else if (promoteVisible.Active) { var promoteConfirmation = AppSettings.LocalizationManager.GetText(LocalizationKeys.PromoteConfirmation, _amountTextField.GetDoubleValue().ToString(), _pickedCoin == CurrencyType.Sbd ? "SBD" : "Steem", promoter.Result.Bot.Author); sureText.Text = promoteConfirmation; sureTextHidden.Active = false; sureTextVisible.Active = true; UIView.Animate(0.2, 0, UIViewAnimationOptions.CurveEaseIn, () => { popup.LayoutIfNeeded(); }, () => { selectButton.SetTitle("Yes", UIControlState.Normal); }); } else if (completeTextVisible.Active) { completeTextHidden.Active = true; completeTextVisible.Active = false; UIView.Animate(0.2, 0, UIViewAnimationOptions.CurveEaseIn, () => { popup.LayoutIfNeeded(); }, () => { title.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.PromotePost); selectButton.SetTitle(AppSettings.LocalizationManager.GetText(LocalizationKeys.FindPromoter), UIControlState.Normal); }); } else { if (_amountTextField.GetDoubleValue() > balances?.Find(x => x.CurrencyType == _pickedCoin).Value) { errorMessage.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.NotEnoughBalance); errorMessage.Hidden = false; return; } if (string.IsNullOrEmpty(_amountTextField.Text) || !IsValidAmount()) { return; } selectButton.Enabled = false; loader.StartAnimating(); var pr = new PromoteRequest() { Amount = _amountTextField.GetDoubleValue(), CurrencyType = _pickedCoin, PostToPromote = post, }; promoter = await _presenter.FindPromoteBot(pr); if (promoter.IsSuccess) { var expectedUpvoteTime = promoter.Result.ExpectedUpvoteTime; if (expectedUpvoteTime.ToString().Length > 8) { expectedTimeValue.Text = expectedUpvoteTime.ToString().Remove(8); } timer = new Timer((obj) => { expectedUpvoteTime = expectedUpvoteTime.Subtract(TimeSpan.FromSeconds(1)); view.InvokeOnMainThread(() => { if (expectedUpvoteTime.ToString().Length > 8) { expectedTimeValue.Text = expectedUpvoteTime.ToString().Remove(8); } else { expectedTimeValue.Text = expectedUpvoteTime.ToString(); } }); }, null, DateTime.Now.Add(expectedUpvoteTime).Millisecond, (int)TimeSpan.FromSeconds(1).TotalMilliseconds); promoterLogin.Text = $"@{promoter.Result.Bot.Author}"; if (!string.IsNullOrEmpty(promoter.Result.Bot.Avatar)) { ImageLoader.Load(promoter.Result.Bot.Avatar, avatar, size: new CGSize(300, 300)); } else { avatar.Image = UIImage.FromBundle("ic_noavatar"); } promoteHidden.Active = false; promoteVisible.Active = true; UIView.Animate(0.2, 0, UIViewAnimationOptions.CurveEaseIn, () => { popup.LayoutIfNeeded(); }, () => { selectButton.Enabled = true; loader.StopAnimating(); title.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.PromoterFound); selectButton.SetTitle(AppSettings.LocalizationManager.GetText(LocalizationKeys.Promote), UIControlState.Normal); }); } else { completeText.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.PromoterNotFound); completeTextHidden.Active = false; completeTextVisible.Active = true; UIView.Animate(0.2, 0, UIViewAnimationOptions.CurveEaseIn, () => { popup.LayoutIfNeeded(); }, () => { selectButton.Enabled = true; loader.StopAnimating(); title.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.PromoterSearchResult); selectButton.SetTitle(AppSettings.LocalizationManager.GetText(LocalizationKeys.SearchAgain), UIControlState.Normal); }); } } }; cancelButton.TouchDown += (sender, e) => { _alert.Close(); }; var popuptap = new UITapGestureRecognizer(() => { _amountTextField.ResignFirstResponder(); }); popup.AddGestureRecognizer(popuptap); Constants.CreateGradient(selectButton, 25); Constants.CreateShadowFromZeplin(selectButton, Constants.R231G72B0, 0.3f, 0, 10, 20, 0); popup.BringSubviewToFront(selectButton); _alert.Show(); return(_alert); }
public override void ViewDidLayoutSubviews() { Constants.CreateGradient(_transferButton, 25); }
private void CreateView() { View.BackgroundColor = UIColor.White; UILabel recepientLabel = new UILabel(); recepientLabel.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.RecipientName); recepientLabel.Font = Constants.Semibold14; recepientLabel.TextColor = UIColor.Black; View.AddSubview(recepientLabel); recepientLabel.AutoPinEdgeToSuperviewEdge(ALEdge.Top, 25); recepientLabel.AutoPinEdgeToSuperviewEdge(ALEdge.Left, 15); var recipientStackView = new UIStackView(); recipientStackView.Spacing = 10; View.AddSubview(recipientStackView); recipientStackView.AutoPinEdgeToSuperviewEdge(ALEdge.Left, 15); recipientStackView.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, recepientLabel, 16); recipientStackView.AutoPinEdgeToSuperviewEdge(ALEdge.Right, 15); recipientStackView.AutoSetDimension(ALDimension.Height, 50); _recipientAvatar = new UIImageView(); _recipientAvatar.Layer.CornerRadius = 25; _recipientAvatar.ClipsToBounds = true; _recipientAvatar.Hidden = true; recipientStackView.AddArrangedSubview(_recipientAvatar); _recipientAvatar.AutoSetDimension(ALDimension.Width, 50); _recepientTextField = new SearchTextField(AppSettings.LocalizationManager.GetText(LocalizationKeys.RecipientNameHint)); _recepientTextField.ReturnButtonTapped += () => { RemoveFocus(); }; _recepientTextField.EditingChanged += EditingChanged; _recepientTextField.Layer.CornerRadius = 25; _recepientTextField.EditingChanged += (object sender, EventArgs e) => { _transferFacade.Recipient = null; }; recipientStackView.AddArrangedSubview(_recepientTextField); _recepientTextField.EditingDidBegin += (object sender, EventArgs e) => { _usersTable.Hidden = false; }; _recepientTextField.EditingDidEnd += (object sender, EventArgs e) => { _usersTable.Hidden = true; _usersLoader.StopAnimating(); _noResultViewTags.Hidden = true; }; _recepientTextField.ClearButtonTapped += () => { UIView.Animate(0.2, () => { _recipientAvatar.Hidden = true; _recipientAvatar.LayoutIfNeeded(); }); _prevQuery = string.Empty; _transferFacade.Recipient = null; _transferFacade.UserFriendPresenter.Clear(); _recepientTextField.Text = _transferFacade?.Recipient?.Author; }; UILabel amountLabel = new UILabel(); amountLabel.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.TransferAmount); amountLabel.Font = Constants.Semibold14; amountLabel.TextColor = UIColor.Black; View.AddSubview(amountLabel); amountLabel.AutoPinEdgeToSuperviewEdge(ALEdge.Left, 15); amountLabel.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, recipientStackView, 25); _balanceLoader.ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.White; _balanceLoader.Color = UIColor.Black; _balanceLoader.HidesWhenStopped = true; _balanceLoader.StartAnimating(); View.AddSubview(_balanceLoader); _balanceLoader.AutoPinEdge(ALEdge.Left, ALEdge.Right, amountLabel, 10); _balanceLoader.AutoAlignAxis(ALAxis.Horizontal, amountLabel); _balanceLabel = new UILabel(); _balanceLabel.Font = Constants.Semibold14; _balanceLabel.TextColor = Constants.R151G155B158; _balanceLabel.TextAlignment = UITextAlignment.Right; View.AddSubview(_balanceLabel); _balanceLabel.AutoAlignAxis(ALAxis.Horizontal, amountLabel); _balanceLabel.AutoPinEdge(ALEdge.Left, ALEdge.Right, amountLabel, 5); _balanceLabel.SetContentHuggingPriority(1, UILayoutConstraintAxis.Horizontal); var rightView = new UIView(); View.AddSubview(rightView); rightView.AutoSetDimension(ALDimension.Height, 50); UIImageView pickerImage = new UIImageView(UIImage.FromBundle("ic_currency_picker.png")); rightView.AddSubview(pickerImage); pickerImage.AutoAlignAxisToSuperviewAxis(ALAxis.Horizontal); pickerImage.AutoPinEdgeToSuperviewEdge(ALEdge.Right, 10); _pickerLabel.Text = "STEEM"; _pickerLabel.TextAlignment = UITextAlignment.Center; _pickerLabel.Font = Constants.Semibold14; _pickerLabel.TextColor = Constants.R255G71B5; rightView.AddSubview(_pickerLabel); _pickerLabel.AutoAlignAxisToSuperviewAxis(ALAxis.Horizontal); _pickerLabel.AutoPinEdgeToSuperviewEdge(ALEdge.Left); _pickerLabel.AutoPinEdge(ALEdge.Right, ALEdge.Left, pickerImage, -5); rightView.LayoutIfNeeded(); _amountTextField = new SearchTextField(AppSettings.LocalizationManager.GetText(LocalizationKeys.TransferAmountHint), new UIEdgeInsets(0, 20, 0, 0), new AmountFieldDelegate(), false, rightView); _amountTextField.KeyboardType = UIKeyboardType.DecimalPad; _amountTextField.Layer.CornerRadius = 25; View.AddSubview(_amountTextField); //_amountTextField.ClearButtonTapped += () => { }; _amountTextField.EditingChanged += IsEnoughBalance; View.AddSubview(_amountTextField); _amountTextField.AutoPinEdgeToSuperviewEdge(ALEdge.Left, 15); _amountTextField.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, amountLabel, 16); _amountTextField.AutoSetDimension(ALDimension.Height, 50); var max = new UIButton(); max.SetTitle(AppSettings.LocalizationManager.GetText(LocalizationKeys.Max), UIControlState.Normal); max.SetTitleColor(UIColor.Black, UIControlState.Normal); max.Font = Constants.Semibold14; max.Layer.BorderWidth = 1; max.Layer.BorderColor = Constants.R245G245B245.CGColor; max.Layer.CornerRadius = 25; View.AddSubview(max); max.AutoPinEdgeToSuperviewEdge(ALEdge.Right, 15); max.AutoPinEdge(ALEdge.Left, ALEdge.Right, _amountTextField, 10); max.AutoSetDimensionsToSize(new CGSize(80, 50)); max.AutoAlignAxis(ALAxis.Horizontal, _amountTextField); max.TouchDown += MaxBtnOnClick; rightView.AutoAlignAxis(ALAxis.Horizontal, _amountTextField); rightView.AutoPinEdge(ALEdge.Right, ALEdge.Right, _amountTextField); View.BringSubviewToFront(rightView); _balanceLabel.AutoPinEdge(ALEdge.Right, ALEdge.Right, _amountTextField); UIView pickerView = new UIView(); pickerView.Layer.CornerRadius = 25; pickerView.Layer.BorderColor = Constants.R244G244B246.CGColor; pickerView.Layer.BorderWidth = 1; pickerView.UserInteractionEnabled = true; var pickerTap = new UITapGestureRecognizer(() => { if (_alert == null) { var popup = new UIView(); popup.ClipsToBounds = true; popup.Layer.CornerRadius = 15; popup.BackgroundColor = UIColor.White; View.AddSubview(popup); var dialogWidth = UIScreen.MainScreen.Bounds.Width - 10 * 2; popup.AutoSetDimension(ALDimension.Width, dialogWidth); var commonMargin = 20; var title = new UILabel(); title.Font = Constants.Semibold14; title.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.SelectToken); title.SizeToFit(); popup.AddSubview(title); title.AutoPinEdgeToSuperviewEdge(ALEdge.Top); title.AutoAlignAxisToSuperviewAxis(ALAxis.Vertical); title.AutoSetDimension(ALDimension.Height, 70); UIPickerView picker = new UIPickerView(); picker.Select(_coins.IndexOf(_pickedCoin), 0, true); picker.Model = new CoinPickerViewModel(_coins); popup.AddSubview(picker); picker.AutoSetDimension(ALDimension.Width, dialogWidth - commonMargin * 2); picker.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, title); picker.AutoAlignAxisToSuperviewAxis(ALAxis.Vertical); picker.SizeToFit(); var topSeparator = new UIView(); topSeparator.BackgroundColor = Constants.R245G245B245; popup.AddSubview(topSeparator); topSeparator.AutoPinEdge(ALEdge.Bottom, ALEdge.Top, picker); topSeparator.AutoPinEdgeToSuperviewEdge(ALEdge.Left, commonMargin); topSeparator.AutoPinEdgeToSuperviewEdge(ALEdge.Right, commonMargin); topSeparator.AutoSetDimension(ALDimension.Height, 1); var separator = new UIView(); separator.BackgroundColor = Constants.R245G245B245; popup.AddSubview(separator); separator.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, picker); separator.AutoPinEdgeToSuperviewEdge(ALEdge.Left, commonMargin); separator.AutoPinEdgeToSuperviewEdge(ALEdge.Right, commonMargin); separator.AutoSetDimension(ALDimension.Height, 1); var selectButton = new UIButton(); selectButton.SetTitle(AppSettings.LocalizationManager.GetText(LocalizationKeys.Select), UIControlState.Normal); selectButton.SetTitleColor(UIColor.White, UIControlState.Normal); selectButton.Layer.CornerRadius = 25; selectButton.Font = Constants.Bold14; popup.AddSubview(selectButton); selectButton.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, separator, 20); selectButton.AutoPinEdgeToSuperviewEdge(ALEdge.Right, commonMargin); selectButton.AutoPinEdgeToSuperviewEdge(ALEdge.Left, commonMargin); selectButton.AutoSetDimension(ALDimension.Height, 50); selectButton.LayoutIfNeeded(); var cancelButton = new UIButton(); cancelButton.SetTitle(AppSettings.LocalizationManager.GetText(LocalizationKeys.Close), UIControlState.Normal); cancelButton.SetTitleColor(UIColor.Black, UIControlState.Normal); cancelButton.Layer.CornerRadius = 25; cancelButton.Font = Constants.Semibold14; cancelButton.Layer.BorderWidth = 1; cancelButton.Layer.BorderColor = Constants.R245G245B245.CGColor; popup.AddSubview(cancelButton); cancelButton.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, selectButton, 20); cancelButton.AutoPinEdgeToSuperviewEdge(ALEdge.Left, commonMargin); cancelButton.AutoPinEdgeToSuperviewEdge(ALEdge.Right, commonMargin); cancelButton.AutoPinEdgeToSuperviewEdge(ALEdge.Bottom, commonMargin); cancelButton.AutoSetDimension(ALDimension.Height, 50); NavigationController.View.EndEditing(true); _alert = new CustomAlertView(popup, NavigationController); selectButton.TouchDown += (sender, e) => { CoinSelected(_coins[(int)picker.SelectedRowInComponent(0)]); _alert.Close(); _amountTextField.UpdateRightViewRect(); }; cancelButton.TouchDown += (sender, e) => { _alert.Close(); }; popup.SizeToFit(); Constants.CreateGradient(selectButton, 25); } _alert.Show(); }); rightView.AddGestureRecognizer(pickerTap); var bottomStackView = new UIStackView(); bottomStackView.Axis = UILayoutConstraintAxis.Vertical; View.AddSubview(bottomStackView); bottomStackView.AutoPinEdgeToSuperviewEdge(ALEdge.Left, 15); bottomStackView.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, _amountTextField, 5); bottomStackView.AutoPinEdgeToSuperviewEdge(ALEdge.Right, 15); bottomStackView.Spacing = 16; errorMessage.Font = Constants.Semibold12; errorMessage.Hidden = true; errorMessage.TextColor = Constants.R255G34B5; errorMessage.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.AmountLimitFull); bottomStackView.AddArrangedSubview(errorMessage); memoLabel = new UILabel(); memoLabel.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.TransferComment); memoLabel.TextColor = Constants.R255G71B5; memoLabel.Font = Constants.Semibold14; memoLabel.UserInteractionEnabled = true; var memoTap = new UITapGestureRecognizer(() => { memoLabel.TextColor = UIColor.Black; memoLabel.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.TransferComment); UIView.Animate(0.2, () => { _memoTextView.Hidden = false; _memoTextView.LayoutIfNeeded(); }); }); memoLabel.AddGestureRecognizer(memoTap); bottomStackView.AddArrangedSubview(memoLabel); memoLabel.AutoSetDimension(ALDimension.Height, 30); _memoTextView = new UITextView(); _memoTextView.Layer.CornerRadius = 25; _memoTextView.TextContainerInset = new UIEdgeInsets(10, 15, 10, 15); _memoTextView.Font = Constants.Regular14; _memoTextView.Bounces = false; _memoTextView.ShowsVerticalScrollIndicator = false; _memoTextView.Hidden = true; _memoTextView.TintColor = Constants.R255G71B5; _memoTextView.BackgroundColor = Constants.R245G245B245; _memoTextViewDelegate = new BaseTextViewDelegate(); _memoTextView.Delegate = _memoTextViewDelegate; _memoTextViewDelegate.EditingEndedAction += () => { base.ScrollTheView(false); }; bottomStackView.AddArrangedSubview(_memoTextView); _memoTextView.AutoSetDimension(ALDimension.Height, 80); var buttonWrapper = new UIView(); _transferButton = new UIButton(); _transferButton.SetTitleColor(UIColor.White, UIControlState.Normal); _transferButton.SetTitleColor(UIColor.Clear, UIControlState.Disabled); _transferButton.SetTitle(AppSettings.LocalizationManager.GetText(LocalizationKeys.Transfer).ToUpper(), UIControlState.Normal); _transferButton.Layer.CornerRadius = 25; _transferButton.Font = Constants.Bold14; _transferButton.TouchDown += Transfer; buttonWrapper.AddSubview(_transferButton); _transferButton.AutoSetDimension(ALDimension.Height, 50); _transferButton.AutoPinEdgeToSuperviewEdge(ALEdge.Left); _transferButton.AutoPinEdgeToSuperviewEdge(ALEdge.Top, 15); _transferButton.AutoPinEdgeToSuperviewEdge(ALEdge.Bottom); _transferButton.AutoPinEdgeToSuperviewEdge(ALEdge.Right); Constants.CreateShadow(_transferButton, Constants.R204G204B204, 0.7f, 25, 10, 12); _tranfserLoader = new UIActivityIndicatorView(); _tranfserLoader.ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.White; _tranfserLoader.HidesWhenStopped = true; buttonWrapper.AddSubview(_tranfserLoader); _tranfserLoader.AutoAlignAxis(ALAxis.Horizontal, _transferButton); _tranfserLoader.AutoAlignAxis(ALAxis.Vertical, _transferButton); bottomStackView.AddArrangedSubview(buttonWrapper); buttonWrapper.AutoSetDimension(ALDimension.Height, 65); SetupTable(); _noResultViewTags.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.NoResultText); _noResultViewTags.Lines = 2; _noResultViewTags.Hidden = true; _noResultViewTags.TextAlignment = UITextAlignment.Center; _noResultViewTags.Font = Constants.Light27; _noResultViewTags.TextColor = Constants.R15G24B30; View.AddSubview(_noResultViewTags); _noResultViewTags.AutoPinEdge(ALEdge.Right, ALEdge.Right, _usersTable, -18); _noResultViewTags.AutoPinEdge(ALEdge.Left, ALEdge.Left, _usersTable, 18); _usersNotFoundHorizontalAlignment = _noResultViewTags.AutoAlignAxis(ALAxis.Horizontal, _usersTable); warningView = new UIView(); warningView.ClipsToBounds = true; warningView.BackgroundColor = Constants.R255G34B5; warningView.Alpha = 0; Constants.CreateShadow(warningView, Constants.R231G72B0, 0.5f, 6, 10, 12); View.AddSubview(warningView); warningView.AutoSetDimension(ALDimension.Height, 60); warningView.AutoPinEdgeToSuperviewEdge(ALEdge.Left, 15); warningView.AutoPinEdgeToSuperviewEdge(ALEdge.Right, 15); warningViewToBottomConstraint = warningView.AutoPinEdgeToSuperviewEdge(ALEdge.Bottom); var warningImage = new UIImageView(); warningImage.Image = UIImage.FromBundle("ic_info"); var warningLabel = new UILabel(); warningLabel.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.TagSearchWarning); warningLabel.Lines = 3; warningLabel.Font = Constants.Regular12; warningLabel.TextColor = UIColor.FromRGB(255, 255, 255); warningView.AddSubview(warningLabel); warningView.AddSubview(warningImage); warningImage.AutoPinEdgeToSuperviewEdge(ALEdge.Left, 20); warningImage.AutoPinEdgeToSuperviewEdge(ALEdge.Top, 20); warningImage.AutoSetDimension(ALDimension.Width, 20); warningImage.AutoPinEdgeToSuperviewEdge(ALEdge.Bottom, 20); warningLabel.AutoPinEdge(ALEdge.Left, ALEdge.Right, warningImage, 20); warningLabel.AutoAlignAxisToSuperviewAxis(ALAxis.Horizontal); warningLabel.AutoPinEdgeToSuperviewEdge(ALEdge.Right, 20); var tap = new UITapGestureRecognizer(() => { RemoveFocus(); }); View.AddGestureRecognizer(tap); }