public override void ViewDidLoad() { base.ViewDidLoad(); SetupMainScroll(); tagsCollectionView = new UICollectionView(CGRect.Null, new LeftAlignedCollectionViewFlowLayout()); tagsCollectionView.ScrollEnabled = false; CreateView(); tagsCollectionView.RegisterClassForCell(typeof(LocalTagCollectionViewCell), nameof(LocalTagCollectionViewCell)); tagsCollectionView.RegisterNibForCell(UINib.FromName(nameof(LocalTagCollectionViewCell), NSBundle.MainBundle), nameof(LocalTagCollectionViewCell)); collectionviewSource = new LocalTagsCollectionViewSource(editMode); collectionViewDelegate = new LocalTagsCollectionViewFlowDelegate(collectionviewSource, UIScreen.MainScreen.Bounds.Width - _separatorMargin * 2); tagsCollectionView.Source = collectionviewSource; tagsCollectionView.Delegate = collectionViewDelegate; tagsCollectionView.BackgroundColor = UIColor.White; var tap = new UITapGestureRecognizer(RemoveFocusFromTextFields); View.AddGestureRecognizer(tap); SetBackButton(); SetPlaceholder(); if (!editMode) { CheckOnSpam(); } }
public override void ViewDidLoad() { base.ViewDidLoad(); Activeview = descriptionTextField; postPhotoButton.Layer.CornerRadius = 25; postPhotoButton.TitleLabel.Font = Constants.Semibold14; tagField.Font = titleTextField.Font = descriptionTextField.Font = Constants.Regular14; _tableSource = new TagsTableViewSource(_presenter); _tableSource.CellAction += TableCellAction; tagsTableView.Source = _tableSource; tagsTableView.LayoutMargins = UIEdgeInsets.Zero; tagsTableView.RegisterClassForCellReuse(typeof(TagTableViewCell), nameof(TagTableViewCell)); tagsTableView.RegisterNibForCellReuse(UINib.FromName(nameof(TagTableViewCell), NSBundle.MainBundle), nameof(TagTableViewCell)); tagsTableView.RowHeight = 65f; tagsCollectionView.RegisterClassForCell(typeof(LocalTagCollectionViewCell), nameof(LocalTagCollectionViewCell)); tagsCollectionView.RegisterNibForCell(UINib.FromName(nameof(LocalTagCollectionViewCell), NSBundle.MainBundle), nameof(LocalTagCollectionViewCell)); tagsCollectionView.SetCollectionViewLayout(new UICollectionViewFlowLayout() { ScrollDirection = UICollectionViewScrollDirection.Horizontal, SectionInset = new UIEdgeInsets(0, 15, 0, 0), }, false); _collectionviewSource = new LocalTagsCollectionViewSource(); _collectionviewSource.CellAction += CollectionCellAction; _collectionViewDelegate = new LocalTagsCollectionViewFlowDelegate(_collectionviewSource); tagsCollectionView.Source = _collectionviewSource; tagsCollectionView.Delegate = _collectionViewDelegate; tagField.Delegate = new TagFieldDelegate(DoneTapped); tagField.EditingChanged += EditingDidChange; tagField.EditingDidBegin += EditingDidBegin; tagField.EditingDidEnd += EditingDidEnd; var tap = new UITapGestureRecognizer(RemoveFocusFromTextFields); View.AddGestureRecognizer(tap); var rotateTap = new UITapGestureRecognizer(RotateImage); rotateImage.AddGestureRecognizer(rotateTap); postPhotoButton.TouchDown += PostPhoto; _presenter.SourceChanged += SourceChanged; _timer = new Timer(OnTimer); SetBackButton(); SearchTextChanged(); SetPlaceholder(); }
public TagsPickerViewController(LocalTagsCollectionViewSource viewSource, LocalTagsCollectionViewFlowDelegate flowDelegate) { _viewSource = viewSource; _flowDelegate = flowDelegate; _timer = new Timer(OnTimer); }