public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath) { var cell = tableView.DequeueReusableCell("JegereTableCell"); if(cell == null) cell = new UIJaktTableViewCell(UITableViewCellStyle.Subtitle, "JegereTableCell"); var jeger = JegerList.ElementAt(indexPath.Row); var label = jeger.Navn; //var imgpath = jeger.ImagePath; //if(imgpath == string.Empty) // imgpath = "Images/Icons/icon_placeholder_jeger.png"; var imgstr = Utils.GetPath("jeger_"+jeger.ID+".jpg"); if(!File.Exists(imgstr)){ imgstr = "Images/Icons/icon_placeholder_jeger.png"; cell.ImageView.Image = new UIImage(imgstr); } else cell.ImageView.Image = new UIImage(Utils.GetPath(imgstr)); cell.ImageView.Layer.MasksToBounds = true; cell.ImageView.Layer.CornerRadius = 5.0f; cell.TextLabel.Text = label; cell.DetailTextLabel.Text = jeger.Email; cell.Accessory = UITableViewCellAccessory.DisclosureIndicator; return cell; }
public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath) { var cell = tableView.DequeueReusableCell("DogsTableCell"); if(cell == null) cell = new UIJaktTableViewCell(UITableViewCellStyle.Subtitle, "DogsTableCell"); var dog = DogList.ElementAt(indexPath.Row); var label = dog.Navn; var imgstr = Utils.GetPath("dog_"+dog.ID+".jpg"); if(!File.Exists(imgstr)){ imgstr = "Images/Icons/Tabs/dog-paw.png"; cell.ImageView.Image = new UIImage(imgstr); } else cell.ImageView.Image = new UIImage(Utils.GetPath(imgstr)); cell.ImageView.Layer.MasksToBounds = true; cell.ImageView.Layer.CornerRadius = 5.0f; cell.TextLabel.Text = label; cell.DetailTextLabel.Text = dog.Rase; cell.Accessory = UITableViewCellAccessory.DisclosureIndicator; return cell; }
public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath) { var cell = tableView.DequeueReusableCell("ArterTableCell"); if(cell == null) cell = new UIJaktTableViewCell(UITableViewCellStyle.Default, "ArterTableCell"); var groupId = JaktLoggApp.instance.ArtGroupList[indexPath.Section].ID; var artsInSection = JaktLoggApp.instance.ArtList.Where(a => a.GroupId == groupId); var c = artsInSection.Count(); //legg til art - knapp if(_controller.TableView.Editing && groupId == 100 && indexPath.Row == c){ cell.TextLabel.Text = Utils.Translate("specie.new"); //cell.Accessory = UITableViewCellAccessory.None; cell.ImageView.Image = null; } else { var art = artsInSection.ElementAt(indexPath.Row); var label = art.Navn; var icon = JaktLoggApp.instance.SelectedArtIds.Contains(art.ID) ? "icon_checked.png" : "icon_unchecked.png"; var file = "Images/Icons/"+icon; cell.ImageView.Image = new UIImage(file); cell.ImageView.Layer.MasksToBounds = true; cell.ImageView.Layer.CornerRadius = 5.0f; cell.TextLabel.Text = label; cell.TextLabel.TextAlignment = UITextAlignment.Left; if(!EditMode) cell.Accessory = UITableViewCellAccessory.DetailDisclosureButton; } return cell; }
public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath) { var row = indexPath.Row; var section = indexPath.Section; var datelist = (from item in JaktList select item.DatoFra.Year).Distinct().ToList(); var currentItems = JaktList.Where(l => l.DatoFra.Year == datelist.ElementAt(section)); var jakt = currentItems.ElementAt(row); var cell = tableView.DequeueReusableCell("JaktTableCell"); if(cell == null) cell = new UIJaktTableViewCell(UITableViewCellStyle.Subtitle, "JaktTableCell"); cell.TextLabel.Text = jakt.DatoFra.ToNorwegianDateString(); cell.DetailTextLabel.Text = jakt.Sted; cell.Accessory = UITableViewCellAccessory.DisclosureIndicator; var imgstr = Utils.GetPath("jakt_"+jakt.ID+".jpg"); if(!File.Exists(imgstr)){ imgstr = "Images/Icons/pictureframe.png"; cell.ImageView.Image = new UIImage(imgstr); } else cell.ImageView.Image = new UIImage(Utils.GetPath(imgstr)); cell.ImageView.Layer.MasksToBounds = true; cell.ImageView.Layer.CornerRadius = 5.0f; return cell; }
public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath) { var row = indexPath.Row; var section = indexPath.Section; // IF MAP BUTTON if(datelist.Count() <= section) { var mapCell = tableView.DequeueReusableCell("LoggTableCellLast"); if(mapCell == null) mapCell = new UIJaktTableViewCell(UITableViewCellStyle.Default, "LoggTableCellLast"); mapCell.TextLabel.Text = Utils.Translate("log.showlogsinmap"); mapCell.ImageView.Image = new UIImage("Images/Icons/radar.png"); mapCell.Accessory = UITableViewCellAccessory.DisclosureIndicator; //mapCell.BackgroundColor = UIColor.FromRGB(0.4f, 0.7f, 0.4f); mapCell.Hidden = _logger.Where(l => l.Latitude != "").Count() == 0; return mapCell; } // ELSE var cell = tableView.DequeueReusableCell("LoggTableCell"); if(cell == null) cell = new UIJaktTableViewCell(UITableViewCellStyle.Subtitle, "LoggTableCell"); var currentLogs = _logger.Where(l => l.Dato.ToLocalDateString() == datelist.ElementAt(section)); var logg = currentLogs.ElementAt(row); cell.TextLabel.Text = logg.Dato.ToLocalTimeString(); var art = JaktLoggApp.instance.GetArt(logg.ArtId); if(art != null) cell.DetailTextLabel.Text = logg.Treff + " " + art.Navn + " " + logg.Skudd + " skudd. "; else if(logg.Skudd > 0) cell.DetailTextLabel.Text = logg.Skudd + " " + Utils.Translate("shots") + ". " + logg.Treff + " "+ Utils.Translate("hits") + " "; else cell.DetailTextLabel.Text = ""; if(logg.JegerId > 0) cell.DetailTextLabel.Text += JaktLoggApp.instance.GetJeger(logg.JegerId).Fornavn; cell.Accessory = UITableViewCellAccessory.DisclosureIndicator; var imgstr = Utils.GetPath("jaktlogg_"+logg.ID+".jpg"); if(!File.Exists(imgstr)){ imgstr = "Images/Icons/pictureframe.png"; cell.ImageView.Image = new UIImage(imgstr); } else cell.ImageView.Image = new UIImage(Utils.GetPath(imgstr)); cell.ImageView.Layer.MasksToBounds = true; cell.ImageView.Layer.CornerRadius = 5.0f; return cell; }
public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath) { var cell = tableView.DequeueReusableCell("MoreTableCell"); if(cell == null) cell = new UIJaktTableViewCell(UITableViewCellStyle.Subtitle, "MoreTableCell"); cell.TextLabel.Text = GetCellLabel(indexPath.Section, indexPath.Row); cell.DetailTextLabel.Text = GetCellValue(indexPath.Section, indexPath.Row); cell.Accessory = UITableViewCellAccessory.DisclosureIndicator; string imgpath = GetImageFile(indexPath.Section, indexPath.Row); cell.ImageView.Image = new UIImage(imgpath); return cell; }
public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath) { var cell = tableView.DequeueReusableCell("ArtPickerCell"); if(cell == null) cell = new UIJaktTableViewCell(UITableViewCellStyle.Default, "ArtPickerCell"); var currentArt = ArtList.ElementAt(indexPath.Row); cell.TextLabel.Text = currentArt.Navn; if(currentArt.ID == _controller.SelectedArtId){ cell.Accessory = UITableViewCellAccessory.Checkmark; } return cell; }
public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath) { if(indexPath.Section == 0) { //Input-box var cell = tableView.DequeueReusableCell("FieldStringCell"); if(cell == null){ NSBundle.MainBundle.LoadNib("TextInputCell", controller, null); cell = controller.Cell; controller.TextField.BecomeFirstResponder(); controller.TextField.ReturnKeyType = UIReturnKeyType.Done; controller.TextField.ShouldReturn = SaveText; controller.TextField.KeyboardType = _tableViewController.KeyboardType; } controller.TextField.Text = _tableViewController.Value; controller.TextField.Placeholder = _tableViewController.Placeholder; return cell; } else { //Load autosuggestions var cell = tableView.DequeueReusableCell("FieldAutoSuggestCell"); if(cell == null) cell = new UIJaktTableViewCell(UITableViewCellStyle.Value1, "FieldAutoSuggestCell"); var suggestion = AutoSuggestions.ElementAt(indexPath.Row); cell.TextLabel.Text = suggestion.Name; cell.DetailTextLabel.Text = suggestion.Count.ToString(); return cell; } /*else { //Cancel-button var cell = tableView.DequeueReusableCell("FieldCancelCell"); if(cell == null) cell = new UIJaktTableViewCell(UITableViewCellStyle.Default, "FieldCancelCell"); cell.TextLabel.Text = Utils.Translate("cancel"); cell.TextLabel.TextAlignment = UITextAlignment.Center; cell.Hidden = _tableViewController.NavigationController != null; return cell; }*/ }
public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath) { var cell = tableView.DequeueReusableCell("JaktItemCell"); if(cell == null) cell = new UIJaktTableViewCell(UITableViewCellStyle.Subtitle, "JaktItemCell"); var j = JaktLoggApp.instance.JaktList.ElementAt(indexPath.Row); cell.TextLabel.Text = j.Sted; cell.DetailTextLabel.Text = j.DatoFra.ToNorwegianDateAndYearString(); cell.Accessory = UITableViewCellAccessory.DisclosureIndicator; var picturefile = Utils.GetPath("jakt_"+j.ID+".jpg"); if(File.Exists(picturefile)) cell.ImageView.Image = new UIImage(picturefile); return cell; }
public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath) { var cell = tableView.DequeueReusableCell("JegereTableCell"); if(cell == null) cell = new UIJaktTableViewCell(UITableViewCellStyle.Default, "JegereTableCell"); var jeger = JegerList.ElementAt(indexPath.Row); var label = jeger.Navn; var icon = JegerIds.Contains(jeger.ID) ? "icon_checked.png" : "icon_unchecked.png"; var file = "Images/Icons/"+icon; cell.ImageView.Image = new UIImage(file); cell.TextLabel.Text = label; cell.Accessory = UITableViewCellAccessory.DetailDisclosureButton; return cell; }
public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath) { var cell = tableView.DequeueReusableCell("LoggSetupTableCell"); if(cell == null) cell = new UIJaktTableViewCell(UITableViewCellStyle.Subtitle, "LoggSetupTableCell"); var loggtypesInSection = LoggTypes.Where(a => a.GroupId == JaktLoggApp.instance.LoggTypeGroupList[indexPath.Section].ID); var item = loggtypesInSection.ElementAt(indexPath.Row); var icon = JaktLoggApp.instance.SelectedLoggTypeIds.Contains(item.Key) ? "icon_checked.png" : "icon_unchecked.png"; var file = "Images/Icons/"+icon; cell.ImageView.Image = new UIImage(file); cell.ImageView.Layer.MasksToBounds = true; cell.ImageView.Layer.CornerRadius = 5.0f; cell.TextLabel.Text = item.Navn; cell.DetailTextLabel.Text = item.Beskrivelse; return cell; }
public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath) { var currentItem = ItemList.ElementAt(indexPath.Row); var cell = tableView.DequeueReusableCell("ItemPickerCell"); if(cell == null) cell = new UIJaktTableViewCell(currentItem.CellStyle, "ItemPickerCell"); cell.TextLabel.Text = currentItem.TextLabel; if(currentItem.Image != null) cell.ImageView.Image = currentItem.Image; if(currentItem.Key == _controller.SelectedKey){ cell.Accessory = UITableViewCellAccessory.Checkmark; } else cell.Accessory = UITableViewCellAccessory.None; return cell; }
public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath) { var cell = tableView.DequeueReusableCell("ArtTableCell"); if(cell == null) cell = new UIJaktTableViewCell(UITableViewCellStyle.Value1, "ArtTableCell"); if(GetCellLabel(indexPath.Section, indexPath.Row) == Utils.Translate("specie.delete")) { tableView.SeparatorStyle = UITableViewCellSeparatorStyle.None; CellDelete.ButtonText = GetCellLabel(indexPath.Section, indexPath.Row); CellDelete.LoadGUI(); return delcell; } else { cell.TextLabel.Text = GetCellLabel(indexPath.Section, indexPath.Row); cell.DetailTextLabel.Text = GetCellValue(indexPath.Section, indexPath.Row); cell.Accessory = UITableViewCellAccessory.DisclosureIndicator; } return cell; }
public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath) { var cell = tableView.DequeueReusableCell("ArterTableCell"); if(cell == null) cell = new UIJaktTableViewCell(UITableViewCellStyle.Default, "ArterTableCell"); var artsInSection = ArtList.Where(a => a.GroupId == JaktLoggApp.instance.ArtGroupList[indexPath.Section].ID); var art = artsInSection.ElementAt(indexPath.Row); var label = art.Navn; var icon = JaktLoggApp.instance.SelectedArtIds.Contains(art.ID) ? "icon_checked.png" : "icon_unchecked.png"; var file = "Images/Icons/"+icon; cell.ImageView.Image = new UIImage(file); cell.ImageView.Layer.MasksToBounds = true; cell.ImageView.Layer.CornerRadius = 5.0f; cell.TextLabel.Text = label; cell.Accessory = UITableViewCellAccessory.DetailDisclosureButton; return cell; }
public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath) { var cell = tableView.DequeueReusableCell("JegerTableCell"); if(cell == null) cell = new UIJaktTableViewCell(UITableViewCellStyle.Value1, "JegerTableCell"); if(GetCellLabel(indexPath.Section, indexPath.Row) == "Slett jeger") { var CellDelete = new CellDeleteButton(HandleDeleteButtonTouchUpInside); cell = tableView.DequeueReusableCell("CellDeleteButton"); if(cell == null) { NSBundle.MainBundle.LoadNib("CellDeleteButton", CellDelete, null); CellDelete.ButtonText = GetCellLabel(indexPath.Section, indexPath.Row); CellDelete.LoadGUI(); cell = CellDelete.Cell; } tableView.SeparatorStyle = UITableViewCellSeparatorStyle.None; } else { cell.TextLabel.Text = GetCellLabel(indexPath.Section, indexPath.Row); cell.DetailTextLabel.Text = GetCellValue(indexPath.Section, indexPath.Row); cell.Accessory = UITableViewCellAccessory.DisclosureIndicator; string imgpath = GetImageFile(indexPath.Section, indexPath.Row); if(cell.TextLabel.Text == "Profilbilde"){ var picturefile = Utils.GetPath("jeger_"+_jeger.ID+".jpg"); if(File.Exists(picturefile)) imgpath = picturefile; } cell.ImageView.Image = new UIImage(imgpath); } return cell; }
public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath) { if(indexPath.Section == 0) { var cell = tableView.DequeueReusableCell("FieldStringCell"); if(cell == null){ NSBundle.MainBundle.LoadNib("MultilineTextinputCell", controller, null); cell = controller.Cell; controller.TextView.BecomeFirstResponder(); controller.TextView.ReturnKeyType = UIReturnKeyType.Default; controller.TextView.ShouldEndEditing = SaveText; controller.TextView.KeyboardType = _tableViewController.KeyboardType; } controller.TextView.Text = _tableViewController.Value; //controller.TextView.Placeholder = _tableViewController.Placeholder; return cell; } else { var cell = tableView.DequeueReusableCell("FieldCancelCell"); if(cell == null) cell = new UIJaktTableViewCell(UITableViewCellStyle.Default, "FieldCancelCell"); cell.TextLabel.Text = "Avbryt"; cell.TextLabel.TextAlignment = UITextAlignment.Center; cell.Hidden = _tableViewController.NavigationController != null; return cell; } }
public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath) { var currentItem = ItemList.ElementAt(indexPath.Row); var cell = tableView.DequeueReusableCell("StatsJegererCell"); if(cell == null) cell = new UIJaktTableViewCell(UITableViewCellStyle.Subtitle, "StatsJegererCell"); var jeger = JaktLoggApp.instance.GetJeger(currentItem.JegerId); cell.TextLabel.Text = jeger.Navn; cell.DetailTextLabel.Text = currentItem.Hits + " treff av "+currentItem.Shots + " skudd"; cell.Accessory = UITableViewCellAccessory.DisclosureIndicator; var imgstr = Utils.GetPath("jeger_"+jeger.ID+".jpg"); if(!File.Exists(imgstr)){ imgstr = "Images/Icons/icon_placeholder_jeger.png"; cell.ImageView.Image = new UIImage(imgstr); } else cell.ImageView.Image = new UIImage(Utils.GetPath(imgstr)); cell.ImageView.Layer.MasksToBounds = true; cell.ImageView.Layer.CornerRadius = 5.0f; return cell; }
public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath) { var cell = tableView.DequeueReusableCell("UploadScreenCell"); if(cell == null) cell = new UIJaktTableViewCell(UITableViewCellStyle.Value1, "UploadScreenCell"); if(indexPath.Section == 2) { cell = new UIJaktTableViewCell(UITableViewCellStyle.Default, "UploadButtonCell"); cell.TextLabel.Text = GetCellLabel(indexPath.Section, indexPath.Row); cell.TextLabel.TextAlignment = UITextAlignment.Center; } else{ cell.TextLabel.Text = GetCellLabel(indexPath.Section, indexPath.Row); cell.DetailTextLabel.Text = GetCellValue(indexPath.Section, indexPath.Row); cell.Accessory = UITableViewCellAccessory.DisclosureIndicator; } return cell; }
public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath) { var currentItem = ItemList.ElementAt(indexPath.Row); var cell = tableView.DequeueReusableCell("StatsArterCell"); if(cell == null) cell = new UIJaktTableViewCell(UITableViewCellStyle.Value1, "StatsArterCell"); var j = JaktLoggApp.instance.GetArt(currentItem.ArtId); cell.TextLabel.Text = j != null ? j.Navn : "?"; cell.DetailTextLabel.Text = currentItem.Count.ToString(); return cell; }
public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath) { var cell = tableView.DequeueReusableCell("LoggItemCell"); if(cell == null) cell = new UIJaktTableViewCell(UITableViewCellStyle.Value1, "LoggItemCell"); var lbl = GetCellLabel(indexPath.Section, indexPath.Row) ; if(lbl == "Slett loggføring") { var CellDelete = new CellDeleteButton(HandleDeleteButtonTouchUpInside); cell = tableView.DequeueReusableCell("CellDeleteButton"); if(cell == null) { NSBundle.MainBundle.LoadNib("CellDeleteButton", CellDelete, null); CellDelete.ButtonText = GetCellLabel(indexPath.Section, indexPath.Row); CellDelete.LoadGUI(); cell = CellDelete.Cell; } tableView.SeparatorStyle = UITableViewCellSeparatorStyle.None; } else { if(lbl == "Felt/sett vilt"){ cell = new UIJaktTableViewCell(UITableViewCellStyle.Subtitle, "LoggItemCellSubtitle"); } cell.TextLabel.Text = lbl; cell.DetailTextLabel.Text = GetCellValue(indexPath.Section, indexPath.Row); cell.Accessory = UITableViewCellAccessory.DisclosureIndicator; string imgpath = GetImageFile(indexPath.Section, indexPath.Row); if(cell.TextLabel.Text == "Bilde"){ var picturefile = Utils.GetPath("jaktlogg_"+loggItem.ID+".jpg"); if(File.Exists(picturefile)) imgpath = picturefile; } cell.ImageView.Image = new UIImage(imgpath); } return cell; }
public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath) { var cell = tableView.DequeueReusableCell("JaktItemCell"); if(cell == null) cell = new UIJaktTableViewCell(UITableViewCellStyle.Value1, "JaktItemCell"); if(GetCellLabel(indexPath.Section, indexPath.Row) == Utils.Translate("jakt.delete")) { tableView.SeparatorStyle = UITableViewCellSeparatorStyle.None; CellDelete.ButtonText = GetCellLabel(indexPath.Section, indexPath.Row); CellDelete.LoadGUI(); return delcell; } else { cell.TextLabel.Text = GetCellLabel(indexPath.Section, indexPath.Row); cell.DetailTextLabel.Text = GetCellValue(indexPath.Section, indexPath.Row); cell.Accessory = UITableViewCellAccessory.DisclosureIndicator; string imgpath = GetImageFile(indexPath.Section, indexPath.Row); if(cell.TextLabel.Text == Utils.Translate("jakt.image")){ var picturefile = Utils.GetPath("jakt_"+jakt.ID+".jpg"); if(File.Exists(picturefile)) imgpath = picturefile; } cell.ImageView.Image = new UIImage(imgpath); } return cell; }