void ReleaseDesignerOutlets () { if (collectionViewUser != null) { collectionViewUser.Dispose (); collectionViewUser = null; } }
public override void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath) { if (lastSelectedCell != null) { lastSelectedCell.BackgroundColor = UIColor.Clear; } var cell = collectionView.CellForItem (indexPath); cell.BackgroundColor = UIColor.Cyan; lastSelectedCell = cell; if (cell is FriendsPuzzleListCellViewController) { // var friendsCell = cell as FriendsPuzzleListCellViewController; // var puzzle = puzzlesWitHFriends [indexPath.Item - 1]; } else if (cell is FriendsPuzzleListNewCellViewController) { var vc = this.Storyboard.InstantiateViewController("MenuCreateViewController") as MenuCreateViewController; vc.IsFriendMatch = true; NavigationController.PushViewController( vc, true ); } }
public override int GetItemsCount(UICollectionView collectionView, int section) { if (section == 0) return Team1.Count; else return Team2.Count; }
public override UICollectionViewCell GetCell(UICollectionView collectionView, Foundation.NSIndexPath indexPath) { var cell = (ListingImageCell)collectionView.DequeueReusableCell(CellID, indexPath); cell.Image = urls[indexPath.Row]; return cell; }
public override UICollectionViewCell GetCell(UICollectionView collectionView, NSIndexPath indexPath) { var cell = collectionView.DequeueReusableCell(ToolCell.Key, indexPath) as ToolCell; cell.Text = AvailableTools[indexPath.Item].Name; cell.SetBorder(); return cell; }
public override void MoveItem (UICollectionView collectionView, NSIndexPath sourceIndexPath, NSIndexPath destinationIndexPath) { // Reorder our list of items var item = Numbers [(int)sourceIndexPath.Item]; Numbers.RemoveAt ((int)sourceIndexPath.Item); Numbers.Insert ((int)destinationIndexPath.Item, item); }
public override UICollectionReusableView GetViewForSupplementaryElement(UICollectionView collectionView, NSString elementKind, NSIndexPath indexPath) { if (elementKind == (NSString)"UICollectionElementKindSectionHeader") { PictureHeaderVIew header = (PictureHeaderVIew)collectionView.DequeueReusableSupplementaryView (UICollectionElementKindSection.Header, (NSString)"header", indexPath); header.title.Frame = new RectangleF (20, 15, 230, 300); header.title.Text = Items.Title; header.title.Lines = 0; header.title.SizeToFit (); header.photo.Image = UIImage.FromFile ("./Assets/photo.png"); header.picturesCount.Text = Items.Images.Count.ToString(); return header; } else { StartReadingView footer = (StartReadingView)collectionView.DequeueReusableSupplementaryView (UICollectionElementKindSection.Footer, (NSString)"collectionfooter", indexPath); footer.StartReading.SetBackgroundImage (UIImage.FromFile ("./Assets/buttonlong.png"), UIControlState.Normal); footer.StartReading.TouchUpInside += (object sender, EventArgs e) => { UIStoryboard board = UIStoryboard.FromName ("MainStoryboard", null); var prefs = (PreferencesSubController)board.InstantiateViewController ("preferencessub"); this.NavigationController.PushViewController(prefs, true); }; return footer; } }
public override nint GetItemsCount(UICollectionView collectionView, nint section) { if ((dateList == null) || (dateList.Count == 0)) return (nint)0; else return (nint)dateList.Count; }
void ReleaseDesignerOutlets() { if (GridView != null) { GridView.Dispose (); GridView = null; } }
void ReleaseDesignerOutlets () { if (addToMySchedule != null) { addToMySchedule.Dispose (); addToMySchedule = null; } if (sessionDescription != null) { sessionDescription.Dispose (); sessionDescription = null; } if (sessionRoom != null) { sessionRoom.Dispose (); sessionRoom = null; } if (sessionTime != null) { sessionTime.Dispose (); sessionTime = null; } if (sessionTitle != null) { sessionTitle.Dispose (); sessionTitle = null; } if (speakersCollectionView != null) { speakersCollectionView.Dispose (); speakersCollectionView = null; } }
public override UICollectionViewCell GetCell (UICollectionView collectionView, NSIndexPath indexPath) { SearchCollectionCell cell = (SearchCollectionCell)collectionView.DequeueReusableCell (identifer, indexPath); cell.movie = filterData [indexPath.Row]; cell.UpdateCell (); return cell; }
public override UICollectionViewCell GetCell(UICollectionView collectionView, NSIndexPath indexPath) { DBError err; PhotoCell cell = (PhotoCell)collectionView.DequeueReusableCell(PhotoCell.Key, indexPath); DBPath path = Photos [Photos.Length - indexPath.Row - 1].Path; DBFile file = DBFilesystem.SharedFilesystem.OpenFile (path, out err); UIImage image = null; // This means the file doesn't exist, or it is open with asynchronous operation. if (file == null) { cell.Content = null; return cell; } if (file.Status.Cached) { image = new UIImage (file.ReadData (out err)); file.Close (); } else { file.AddObserver (this, () => { DBFileStatus newStatus = file.NewerStatus; if ((newStatus == null && file.Status.Cached) || (newStatus != null && newStatus.Cached)) { image = new UIImage (file.ReadData (out err)); cell.Content = image; file.RemoveObserver(this); file.Close (); } }); } cell.Content = image; return cell; }
// TODO: Step 2c: uncomment to get a header instance to use for the Supplementary View public override UICollectionReusableView GetViewForSupplementaryElement (UICollectionView collectionView, NSString elementKind, NSIndexPath indexPath) { // get a Header instance to use for the supplementary view var headerView = (Header)collectionView.DequeueReusableSupplementaryView (elementKind, headerId, indexPath); headerView.Text = "Evolve Speakers"; return headerView; }
public override void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath) { var photoController = new PhotoViewController { Asset = (PHAsset)fetchResults[indexPath.Item] }; NavigationController.PushViewController (photoController, true); }
public override int GetItemsCount (UICollectionView collectionView, int section) { if (ItemsSource == null) return 0; return ItemsSource.Count(); }
public override UICollectionViewCell GetCell (UICollectionView collectionView, NSIndexPath indexPath) { var cell = (ProductCell)collectionView.DequeueReusableCell (reuseIdentifier, indexPath); ConfigureCell (cell, Products [indexPath.Row]); return cell; }
public override nint NumberOfSections (UICollectionView collectionView) { if (Master.CollectionItems == null || Master.CollectionItems.Count == 0) { return 0; } return 1; }
public override UICollectionViewCell GetCell(UICollectionView collectionView, NSIndexPath indexPath) { var cell = (PictureBigCollectionCell)collectionView.DequeueReusableCell (PictureBigCollectionCell.CellId, indexPath); cell.resetScale (); AppDelegate.MakeImageFromURL (cell.Image, Items.Images [indexPath.Row]); return cell; }
public override CoreGraphics.CGSize GetSizeForItem (UICollectionView collectionView, UICollectionViewLayout layout, Foundation.NSIndexPath indexPath) { if (Master.MaxHeight != 0) { return new CoreGraphics.CGSize ((Master.View.Frame.Size.Width - 10) / 3, Master.MaxHeight); } return new CoreGraphics.CGSize ((Master.View.Frame.Size.Width - padding - 10) / 3, (Master.View.Frame.Size.Width - padding - 10) / 3 + differential); }
public override UICollectionViewCell GetCell(UICollectionView collectionView, NSIndexPath indexPath) { var cell = (CVCell)collectionView.DequeueReusableCell (cellId, indexPath); cell.Text = indexPath.Row.ToString (); return cell; }
public override void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath) { var controller = collectionView as CityCollectionView; App.SelectedCity = controller.Source.Cities [indexPath.Row]; // Close Collection controller.ParentController.DismissViewController(true,null); }
public override void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath) { if (menuItems[indexPath.Row].Enabled) { Console.WriteLine("Item selected: " + indexPath.Row); SelectItem(collectionView, indexPath.Row); } }
public override void ItemSelected (UICollectionView collectionView, NSIndexPath indexPath) { if (this.movies != null && this.movies.Count > indexPath.Row) { var cell = this.GetCell (collectionView, indexPath) as MovieCollectionViewCell; cell.Selected = true; collectionView.CollectionViewLayout.InvalidateLayout (); this.OnMovieSelected (this.movies [indexPath.Row]); } }
public override UICollectionViewCell GetCell (UICollectionView collectionView, NSIndexPath indexPath) { // Get a reusable cell and set it's title from the item var cell = collectionView.DequeueReusableCell ("Cell", indexPath) as TextCollectionViewCell; cell.Title = Numbers [(int)indexPath.Item].ToString(); return cell; }
public override void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath) { var item = GetItemAt(indexPath); var command = SelectionChangedCommand; if (command != null) command.Execute(item); }
public override UICollectionViewCell GetCell(UICollectionView collectionView, NSIndexPath indexPath) { var cell = (PhotoCell)CollectionView.DequeueReusableCell(ReuseIdentifier, indexPath); cell.SetImage(photos[indexPath.Row].ImageUrl); return cell; }
public void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath) { //ga naar locationdetailviewcontroller selectedSpeaker = Speakers[indexPath.Row]; PerformSegue("SpeakerDetail", this); //verander van kleur }
public CGSize GetSizeForItem (UICollectionView collectionView, UICollectionViewLayout layout, NSIndexPath indexPath) { // 3 friends per row var width = collectionView.Frame.Width / 3; var height = width + 27; return new CGSize (width, height); }
public override UICollectionViewCell GetCell (UICollectionView collectionView, NSIndexPath indexPath) { var cell = (PagePreview)collectionView.DequeueReusableCell (cellName, indexPath); cell.Page = pages.ElementAt (indexPath.Row); return cell; }
public virtual UIEdgeInsets GetInsetForSection(UICollectionView collectionView, UICollectionViewLayout layout, int section) { float top = (section == 0) ? 20.0f : 0.0f; return new UIEdgeInsets (top, 20.0f, 10.0f, 20.0f); }
public nfloat GetMinimumLineSpacingForSection( UICollectionView collectionView, UICollectionViewLayout layout, nint section) => 12;
public nint GetItemsCount(UICollectionView collectionView, nint section) { return(availableFilterInfos.Length); }
public override CGSize GetSizeForItem(UICollectionView collectionView, UICollectionViewLayout layout, NSIndexPath indexPath) { var size = (collectionView.Bounds.Size.Width - (60)) / 3; return(new CGSize(size, size)); }
public override nint GetItemsCount(UICollectionView collectionView, nint section) { return(_fetchResults.Count); }
public override nint NumberOfSections(UICollectionView collectionView) => 1;
public CGSize GetSizeForItem( UICollectionView collectionView, UICollectionViewLayout layout, NSIndexPath indexPath) => new CGSize(Math.Floor(collectionView.Frame.Width / 5), 36);
public UIEdgeInsets GetInsetForSection( UICollectionView collectionView, UICollectionViewLayout layout, nint section) => new UIEdgeInsets(0, 0, 0, 0);
public override void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath) { var vm = GetItem(indexPath); _onCellSelected?.Invoke(vm); }
public MvxCollectionViewSource(UICollectionView collectionView, NSString defaultCellIdentifier) : base(collectionView, defaultCellIdentifier) { }
public MvxCollectionViewSource(UICollectionView collectionView) : base(collectionView) { }
public ColorSelectionCollectionViewSource(UICollectionView collectionView) : base(collectionView) { collectionView.RegisterNibForCell(ColorSelectionViewCell.Nib, cellIdentifier); }
public void ItemDeselected(UICollectionView collectionView, NSIndexPath indexPath) { UpdateSelectionForCell(collectionView.CellForItem(indexPath)); }
protected override UICollectionViewCell GetOrCreateCellFor(UICollectionView collectionView, NSIndexPath indexPath, object item) => collectionView.DequeueReusableCell(cellIdentifier, indexPath) as UICollectionViewCell;
public override nint NumberOfSections(UICollectionView collectionView) { CheckForEmptySource(); return(ItemsSource.GroupCount); }
public override nint GetItemsCount(UICollectionView collectionView, nint section) { return(_dataSource != null ? _dataSource.Count : 0); }
public override nint GetItemsCount(UICollectionView collectionView, nint section) { return(cellCount); }
public override UICollectionViewCell GetCell(UICollectionView collectionView, NSIndexPath indexPath) { return((UICollectionViewCell)collectionView.DequeueReusableCell(cellClass, indexPath)); }
public override nint GetItemsCount(UICollectionView collectionView, nint section) { return(ShellSectionController.GetItems().Count); }
public UIDragPreviewParameters GetDropPreviewParameters(UICollectionView collectionView, NSIndexPath indexPath) { return(PreviewParameters(indexPath)); }
public override void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath) => _gridViewSource.ItemSelected(collectionView, indexPath);
public GridViewSource(UICollectionView collectionView) : base(collectionView, new NSString("GridViewCell")) { CollectionView.RegisterClassForCell(typeof(GridViewCell), DefaultCellIdentifier); ReloadOnAllItemsSourceSets = true; }
public override nint GetItemsCount(UICollectionView collectionView, nint section) { return(_itemsSource.Count); }
public nfloat GetMinimumInteritemSpacingForSection( UICollectionView collectionView, UICollectionViewLayout layout, nint section) => 0;
public override void ItemDeselected([NotNull] UICollectionView collectionView, [NotNull] NSIndexPath indexPath) { ItemDeselectedCalled?.Invoke(this, new SelectionChangedEventArgs(GetItem(indexPath))); }
public override Boolean ShouldHighlightItem(UICollectionView collectionView, NSIndexPath indexPath) { return(true); }
public override nint NumberOfSections(UICollectionView collectionView) { return(1); }
public override void ItemHighlighted(UICollectionView collectionView, NSIndexPath indexPath) { /* * Fix this when switching attributes */ var cell = (UserCellAttribute)collectionView.CellForItem(indexPath); ImageCellAttribute Clicked = Cells[indexPath.Row]; SelectedImagesToClear.Add(indexPath); if (mainCollectionView == null) { mainCollectionView = collectionView; } /* * Select/Deselect Images and keep them Highlighted */ if (isAttributesTab) { //unclick the previous image if (prevImageSelected != null && prevImageSelected != indexPath) { Cells[prevImageSelected.Row].isSelected = false; prevCell.ImageView.Layer.BorderColor = UIColor.Gray.CGColor; prevCell.ImageView.Layer.BorderWidth = 1f; prevCell.ImageView.Layer.CornerRadius = 5f; prevCell.ImageView.Layer.MasksToBounds = true; //prevCell.ImageView.Alpha = 1.0f; } //always highlight the currently selected image //cell.ImageView.Alpha = 0.5f; cell.ImageView.Layer.BorderColor = AppColors.PEACH.CGColor; cell.ImageView.Layer.BorderWidth = 10f; cell.ImageView.Layer.CornerRadius = 5f; cell.ImageView.Layer.MasksToBounds = true; Cells[indexPath.Row].isSelected = true; prevCell = (UserCellAttribute)collectionView.CellForItem(indexPath); } /* * Image Stacks functionality. This adds Selected images to the array * to be able to delete images from this image stack. */ else { if (Clicked.isSelected) { cell.ImageView.Layer.BorderColor = UIColor.Gray.CGColor; cell.ImageView.Layer.BorderWidth = 1f; cell.ImageView.Layer.CornerRadius = 5f; cell.ImageView.Layer.MasksToBounds = true; //cell.ImageView.Alpha = 1.0f; Clicked.isSelected = false; //remove the object from the list SelectedImagesToImageStack.Remove(Clicked.ImgOBJ); } else { cell.ImageView.Layer.BorderColor = AppColors.PEACH.CGColor; cell.ImageView.Layer.BorderWidth = 10f; cell.ImageView.Layer.CornerRadius = 5f; cell.ImageView.Layer.MasksToBounds = true; //cell.ImageView.Alpha = 0.5f; Clicked.isSelected = true; //add the image object to the list SelectedImagesToImageStack.Add(Clicked.ImgOBJ); } } prevImageSelected = indexPath; }
private void InitializeLayout() { var color = UIColor.FromRGB(64, 64, 64); View.BackgroundColor = color; FixView = new UIView(new CGRect(0, 20, View.Bounds.Width, View.Bounds.Height - 20)); View.AddSubview(FixView); ViewTop = new UIView(new CGRect(0, 0, FixView.Bounds.Width, 45)); ViewTop.BackgroundColor = UIColor.Clear; ViewTop.Layer.MasksToBounds = false; ViewTop.Layer.ShadowOpacity = 1f; ViewTop.Layer.ShadowOffset = new CGSize(0, 2); ViewTop.Layer.ShadowColor = UIColor.Gray.CGColor; ViewTop.Layer.CornerRadius = 0; ButttonBack = new UIButton(new CGRect(0, 8, 50, 30)); ButttonBack.SetImage(UIImage.FromBundle("arrow_left").ImageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal), UIControlState.Normal); ViewTop.AddSubview(ButttonBack); ButtonSpinner = new UIButton(new CGRect((FixView.Frame.Width - 150) / 2, 8, 150, 30)); ButtonSpinner.BackgroundColor = UIColor.Clear; ButtonSpinner.Font = UIFont.SystemFontOfSize(13); ButtonSpinner.SetTitle("Select album", UIControlState.Normal); ButtonSpinner.Layer.CornerRadius = 3; ButtonSpinner.Layer.BorderColor = UIColor.White.CGColor; ButtonSpinner.Layer.BorderWidth = 1f; var arrow = new UIImageView(); arrow.ContentMode = UIViewContentMode.ScaleAspectFit; arrow.Image = UIImage.FromBundle("sort_down_white").ImageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal); arrow.Frame = new CGRect(ButtonSpinner.Frame.X + ButtonSpinner.Frame.Width - 15, ButtonSpinner.Frame.Y + 8, 12, 12); ViewTop.AddSubview(ButtonSpinner); ViewTop.AddSubview(arrow); collectionView = new UICollectionView(new CGRect(0, 45, FixView.Bounds.Width, FixView.Bounds.Height - 45), new UICollectionViewFlowLayout()); collectionView.BackgroundColor = UIColor.White; galleryCollectionSource = new GalleryCollectionSource(assets, this); var NumOfColumns = 3; var Spacing = 2; var SceenWidth = (View.Frame.Width - (NumOfColumns - 1) * Spacing) / NumOfColumns; var layout = new UICollectionViewFlowLayout { MinimumInteritemSpacing = Spacing, MinimumLineSpacing = Spacing, ScrollDirection = UICollectionViewScrollDirection.Vertical, ItemSize = new CoreGraphics.CGSize(SceenWidth, SceenWidth), FooterReferenceSize = new CoreGraphics.CGSize(View.Frame.Width, 150) }; collectionView.RegisterNibForCell(UINib.FromName("GalleryItemPhotoViewCell", NSBundle.MainBundle), "GalleryItemPhotoViewCell"); collectionView.DataSource = galleryCollectionSource; collectionView.SetCollectionViewLayout(layout, true); FixView.AddSubview(collectionView); FixView.AddSubview(ViewTop); ViewBottom = new UIView(new CGRect(0, FixView.Bounds.Height - 45, FixView.Bounds.Width, 45)); ViewBottom.BackgroundColor = color.ColorWithAlpha(0.7f); ButtonDone = new UIButton(new CGRect(ViewBottom.Frame.Width - 110, 8, 100, 30)); ButtonDone.Layer.BackgroundColor = UIColor.FromRGB(42, 131, 193).CGColor; ButtonDone.Layer.CornerRadius = 12; ButtonDone.SetTitle("Done", UIControlState.Normal); ViewBottom.AddSubview(ButtonDone); FixView.AddSubview(ViewBottom); ButttonBack.TouchUpInside += (object sender, EventArgs e) => { DismissViewController(true, null); }; ButtonDone.TouchUpInside += (object sender, EventArgs e) => { MessagingCenter.Send <GalleryPickerController, List <PhotoSetNative> >(this, Utils.SubscribeImageFromGallery, GetCurrentSelected()); DismissModalViewController(true); }; ButtonSpinner.TouchUpInside += (sender, e) => { ShowData(); }; mTMBProgressHUD = new MTMBProgressHUD(this.View); View.AddSubview(mTMBProgressHUD); }
public override bool CanMoveItem(UICollectionView collectionView, NSIndexPath indexPath) { // We can always move items return(true); }
public override nint GetItemsCount(UICollectionView collectionView, nint section) { CheckForEmptySource(); return(ItemsSource.ItemCountInGroup(section)); }