public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { UITableViewCell cell = tableView.DequeueReusableCell("NewsListCell"); UILabel lbHeadLine = cell.ViewWithTag(100) as UILabel; lbHeadLine.Text = ViewData[indexPath.Row].Value.Title; if (!ViewData[indexPath.Row].Value.IsRead) { lbHeadLine.Font = UIFont.BoldSystemFontOfSize(17); } else { lbHeadLine.Font = UIFont.SystemFontOfSize(17); } if (ViewData[indexPath.Row].Value.PubDate.HasValue) { UILabel lbDate = cell.ViewWithTag(101) as UILabel; lbDate.Text = ViewData[indexPath.Row].Value.PubDate.Value.ToString(); } return(cell); }
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { UITableViewCell cell = null; pIndexPath = indexPath.Row; if (indexPath.Row % 2 == 0) { cell = tableView.DequeueReusableCell(kCellIdentifier) as FifthTableViewCell; if (cell == null) { var views = NSBundle.MainBundle.LoadNib("FifthTableViewCell", cell, null); cell = views.GetItem <FifthTableViewCell>(0); } } else { cell = tableView.DequeueReusableCell(kCellIdentifier) as SixthTableViewCell; if (cell == null) { var views = NSBundle.MainBundle.LoadNib("SixthTableViewCell", cell, null); cell = views.GetItem <SixthTableViewCell>(0); } } cell.SelectionStyle = UITableViewCellSelectionStyle.None; if (cell != null) { var imageView = cell.ViewWithTag(1001) as UIImageView; var descriptionView = cell.ViewWithTag(2001) as UIView; var TheDiesaseDescription = cell.ViewWithTag(10001) as UILabel; var TheDiesaseName = cell.ViewWithTag(9001) as UILabel; imageView.ClipsToBounds = true; imageView.Image = UIImage.FromBundle(pediometricImageList [indexPath.Row]); UIColor uc = UIColor.Clear; TheDiesaseName.Text = pediometricDiseaseName [pIndexPath]; TheDiesaseDescription.Text = pediometricDiseaseDiscription [pIndexPath]; if (pIndexPath < colorList.Count) { descriptionView.BackgroundColor = uc.FromHexString(colorList [pIndexPath]); } else { pIndexPath = pIndexPath % colorList.Count; descriptionView.BackgroundColor = uc.FromHexString(colorList [pIndexPath]); } } return(cell); }
private UITableViewCell AddStat(UITableViewCell cell, int containerTag, int tag, int count) { if (count > 0) { cell.ViewWithTag(containerTag).ViewWithTag(200 + tag).Hidden = false; (cell.ViewWithTag(containerTag).ViewWithTag(300 + tag) as UILabel).Text = count.ToString(); cell.ViewWithTag(containerTag).ViewWithTag(300 + tag).Hidden = false; } else { cell.ViewWithTag(containerTag).ViewWithTag(200 + tag).Hidden = true; cell.ViewWithTag(containerTag).ViewWithTag(300 + tag).Hidden = true; } return(cell); }
public static UITableViewCell FillCellWithMember(UITableViewCell cell, CodeProjectMember member) { (cell.ViewWithTag (100) as UILabel).Text = member.Name; (cell.ViewWithTag (101) as UILabel).Text = "Posts: " + (member.ArticleCount + member.BlogCount); (cell.ViewWithTag (102) as UILabel).Text = member.Reputation; CodeProjectDatabase database = new CodeProjectDatabase (); byte[] gravatar = database.GetGravatar (member.Id); if (gravatar != null) { UIImage image = UIImage.LoadFromData (NSData.FromArray (gravatar)); (cell.ViewWithTag (105) as UIImageView).Image = image; } return cell; }
public override UIView GetViewForHeader(UITableView tableView, int section) { UITableViewCell cell = tableView.DequeueReusableCell("SectionView"); UILabel nameLabel = cell.ViewWithTag(123) as UILabel; switch (tableItemsKeys[section]) { case "releases": nameLabel.Text = "In Stores Now"; break; case "downloadables": nameLabel.Text = "Available for Download"; break; case "events": nameLabel.Text = "Upcoming Events"; break; default: nameLabel.Text = tableItemsKeys [section]; break; } return(cell); }
public static UITableViewCell FillCellWithMember(UITableViewCell cell, CodeProjectMember member) { (cell.ViewWithTag(100) as UILabel).Text = member.Name; (cell.ViewWithTag(101) as UILabel).Text = "Posts: " + (member.ArticleCount + member.BlogCount); (cell.ViewWithTag(102) as UILabel).Text = member.Reputation; CodeProjectDatabase database = new CodeProjectDatabase(); byte[] gravatar = database.GetGravatar(member.Id); if (gravatar != null) { UIImage image = UIImage.LoadFromData(NSData.FromArray(gravatar)); (cell.ViewWithTag(105) as UIImageView).Image = image; } return(cell); }
public override UIView GetViewForHeader(UITableView tableView, int section) { UITableViewCell cell = tableView.DequeueReusableCell("SectionView"); UILabel nameLabel = cell.ViewWithTag(123) as UILabel; nameLabel.Text = tableItemsKeys[section]; return(cell); }
public override UIView GetViewForHeader(UITableView tableView, nint section) { UITableViewCell cell = tableView.DequeueReusableCell("HeaderCell"); cell.BackgroundColor = UIColor.Clear.FromHex(LightGreen.hex); if (section == 0) { (cell.ViewWithTag(200) as UILabel).Text = "Live"; } else { (cell.ViewWithTag(200) as UILabel).Text = "Soon";; } return(cell); }
public override void RefreshCell(UITableViewCell cell) { base.RefreshCell(cell); var v = cell.ViewWithTag(42); if (v == null) { cell.ContentView.AddSubview(_activity); } }
private UITableViewCell AddPlayer(UITableViewCell cell, int containerTag, List <PlayerWithEventsModel> players, int index) { if (players.Count > index) { var player = players[index]; (cell.ViewWithTag(containerTag).ViewWithTag(101) as UILabel).Text = player.Name; cell = AddStat(cell, containerTag, 1, player.Goals); cell = AddStat(cell, containerTag, 2, player.Assists); cell = AddStat(cell, containerTag, 3, player.P2); cell = AddStat(cell, containerTag, 4, player.P5); cell = AddStat(cell, containerTag, 5, player.P10); cell = AddStat(cell, containerTag, 6, player.PV); } else { cell.ViewWithTag(containerTag).Hidden = true; } return(cell); }
private UITableViewCell SetImage(UITableViewCell cell, Event e) { if (e.Type == EventType.P2) { (cell.ViewWithTag(202) as UIImageView).Image = UIImage.FromBundle("2minutes"); } else { if (e.Type == EventType.P5) { (cell.ViewWithTag(202) as UIImageView).Image = UIImage.FromBundle("5minutes"); } else { if (e.Type == EventType.G) { (cell.ViewWithTag(202) as UIImageView).Image = UIImage.FromBundle("goal"); } else { if (e.Type == EventType.P10) { (cell.ViewWithTag(202) as UIImageView).Image = UIImage.FromBundle("10minutes"); } else { if (e.Type == EventType.PV) { (cell.ViewWithTag(202) as UIImageView).Image = UIImage.FromBundle("redcard"); } } } } } return(cell); }
public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { UITableViewCell cell = tableView.DequeueReusableCell("EinstellungenListCell") as UITableViewCell; WSFeedConfig.FeedConfig entry = ViewData[indexPath.Row]; UILabel lbWS = cell.ViewWithTag(202) as UILabel; lbWS.Text = entry.Name; UISwitch tblSwitch = cell.ViewWithTag(203) as UISwitch; tblSwitch.On = entry.IsActive; UILabel lbHidden = cell.ViewWithTag(204) as UILabel; lbHidden.Hidden = true; lbHidden.Text = entry.FeedID.ToString(); uiSwitches.Add(tblSwitch); tblSwitch.ValueChanged += SwitchValueChanged; return(cell); }
public override void ConfigureCell(UITableViewCell cell, RecentSearch recentSearch) { cell.TextLabel.Text = string.Format("{0:s}", recentSearch.Search.DisplayText); cell.Accessory = UITableViewCellAccessory.DisclosureIndicator; UILabel leftHandLabel = (UILabel)cell.ViewWithTag(10); if (leftHandLabel == null) { leftHandLabel = new UILabel(); leftHandLabel.Font = UIFont.SystemFontOfSize(12.0f); leftHandLabel.Tag = 10; leftHandLabel.Frame = new RectangleF(cell.Frame.Size.Width - 100, 0, 60, 30); leftHandLabel.BackgroundColor = UIColor.Clear; leftHandLabel.TextAlignment = UITextAlignment.Right; cell.AddSubview(leftHandLabel); } leftHandLabel.Text = recentSearch.ResultsCount.ToString(); }
public void SwitchValueChanged(object sender, EventArgs e) { UISwitch uiSwitch = (UISwitch)sender; UITableViewCell uiTableCell = (UITableViewCell)((UIView)uiSwitch.Superview).Superview; UILabel lbH = uiTableCell.ViewWithTag(204) as UILabel; if (lbH != null && !String.IsNullOrEmpty(lbH.Text)) { UITableView uiTableView = (UITableView)uiTableCell.Superview; EinstellungenListDataSource ds = uiTableView.DataSource as EinstellungenListDataSource; int feedID = int.Parse(lbH.Text); WSFeedConfig.FeedConfig feedConfig = ds.ViewData.Where(p => p.FeedID == feedID).FirstOrDefault(); if (feedConfig != null) { feedConfig.IsActive = uiSwitch.On; } } }
public override void RefreshCell(UITableViewCell cell) { cell.SelectionStyle = UITableViewCellSelectionStyle.None; cell.TextLabel.Text = Caption; var v = cell.ViewWithTag(42); if (v == null) { cell.ContentView.AddSubview(TextView); } else { if (v.Handle != TextView.Handle) { v.RemoveFromSuperview(); cell.ContentView.AddSubview(TextView); } } TextView.Frame = new RectangleF(70, 11, 220, TextViewHeight); }
public override void RefreshCell(UITableViewCell cell) { cell.SelectionStyle = UITableViewCellSelectionStyle.None; cell.TextLabel.Text = Caption; TextField.ReturnKeyType = NextElement(typeof(TextFieldElement)) != null ? UIReturnKeyType.Next : UIReturnKeyType.Default; var v = cell.ViewWithTag(42); if (v == null) { cell.ContentView.AddSubview(TextField); } else { if (v.Handle != TextField.Handle) { v.RemoveFromSuperview(); cell.ContentView.AddSubview(TextField); } } TextField.Frame = new RectangleF(CaptionWidth, 11, 300 - CaptionWidth, 22); }
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { UITableViewCell cell = null; if (indexPath.Section == 0) { cell = tableView.DequeueReusableCell("ResetTrashCell", indexPath); var label = cell?.ViewWithTag(1) as UILabel; switch (indexPath.Row) { case 0: label.Text = "Hide Everything"; break; case 1: label.Text = "Reset Default Hidden"; break; case 2: label.Text = "Save Current Hidden"; break; case 3: label.Text = "Recall Saved Hidden"; break; } } else if (indexPath.Section == 1) { var label = cell?.ViewWithTag(1) as UILabel; switch (indexPath.Row) { case 0: cell = tableView.DequeueReusableCell("AllNotifyCell", indexPath); var s = cell.ViewWithTag(2) as UISwitch; label = cell.ViewWithTag(1) as UILabel; label.Text = "All Notifications"; s.On = settings.NotifyEnabled; break; case 1: cell = tableView.DequeueReusableCell("AllNotifyCell", indexPath); var s1 = cell.ViewWithTag(2) as UISwitch; label = cell.ViewWithTag(1) as UILabel; label.Text = "> 90% IV Notify"; s1.On = settings.Notify90Enabled; label.TextColor = settings.NotifyEnabled ? UIColor.Black : UIColor.Gray; s1.Enabled = settings.NotifyEnabled; break; case 2: cell = tableView.DequeueReusableCell("AllNotifyCell", indexPath); var s2 = cell.ViewWithTag(2) as UISwitch; label = cell.ViewWithTag(1) as UILabel; label.Text = "100% IV Notify"; s2.On = settings.Notify100Enabled; label.TextColor = settings.NotifyEnabled ? UIColor.Black : UIColor.Gray; s2.Enabled = settings.NotifyEnabled; break; case 3: cell = tableView.DequeueReusableCell("NotifyDistanceCell", indexPath); var input = cell.ViewWithTag(2) as UITextField; if (DistInput == null) { DistInput = input; input.ValueChanged += (sender, e) => { settings.NotifyDistance = int.Parse(DistInput.Text); }; var tool = new UIToolbar(); tool.SizeToFit(); var done = new UIBarButtonItem("Done", UIBarButtonItemStyle.Done, (sender, e) => { settings.NotifyDistance = int.Parse(DistInput.Text); DistInput.ResignFirstResponder(); }); tool.SetItems(new UIBarButtonItem[] { done }, false); DistInput.InputAccessoryView = tool; } label = cell.ViewWithTag(1) as UILabel; input.Text = settings.NotifyDistance.ToString(); label.TextColor = settings.NotifyEnabled ? UIColor.Black : UIColor.Gray; input.Enabled = settings.NotifyEnabled; break; case 4: cell = tableView.DequeueReusableCell("NotifyDistanceCell", indexPath); var input1 = cell.ViewWithTag(2) as UITextField; if (MaxInput == null) { MaxInput = input1; input1.ValueChanged += (sender, e) => { settings.NotifyMaxDistance = int.Parse(MaxInput.Text); }; var tool = new UIToolbar(); tool.SizeToFit(); var done = new UIBarButtonItem("Done", UIBarButtonItemStyle.Done, (sender, e) => { settings.NotifyMaxDistance = int.Parse(MaxInput.Text); MaxInput.ResignFirstResponder(); }); tool.SetItems(new UIBarButtonItem[] { done }, false); MaxInput.InputAccessoryView = tool; } label = cell.ViewWithTag(1) as UILabel; label.Text = "Maximum Distance (miles)"; input1.Text = settings.NotifyMaxDistance.ToString(); label.TextColor = settings.NotifyEnabled ? UIColor.Black : UIColor.Gray; input1.Enabled = settings.NotifyEnabled; break; case 5: cell = tableView.DequeueReusableCell("NotifyDistanceCell", indexPath); var input2 = cell.ViewWithTag(2) as UITextField; if (LevelInput == null) { LevelInput = input2; input2.ValueChanged += (sender, e) => { settings.NotifyLevel = int.Parse(LevelInput.Text); }; var tool = new UIToolbar(); tool.SizeToFit(); var done = new UIBarButtonItem("Done", UIBarButtonItemStyle.Done, (sender, e) => { settings.NotifyLevel = int.Parse(LevelInput.Text); LevelInput.ResignFirstResponder(); }); tool.SetItems(new UIBarButtonItem[] { done }, false); LevelInput.InputAccessoryView = tool; } label = cell.ViewWithTag(1) as UILabel; label.Text = "Minimum Level"; input2.Text = settings.NotifyLevel.ToString(); label.TextColor = settings.NotifyEnabled ? UIColor.Black : UIColor.Gray; input2.Enabled = settings.NotifyEnabled; break; } } else if (indexPath.Section == 2) { var label = cell?.ViewWithTag(1) as UILabel; switch (indexPath.Row) { case 0: cell = tableView.DequeueReusableCell("AllNotifyCell", indexPath); var s3 = cell.ViewWithTag(2) as UISwitch; label = cell.ViewWithTag(1) as UILabel; label.Text = "Legendary Raids"; s3.On = settings.LegondaryRaids; break; case 1: cell = tableView.DequeueReusableCell("AllNotifyCell", indexPath); var s4 = cell.ViewWithTag(2) as UISwitch; label = cell.ViewWithTag(1) as UILabel; label.Text = "Level 4 Raids"; s4.On = settings.Level4Raids; break; case 2: cell = tableView.DequeueReusableCell("AllNotifyCell", indexPath); var s5 = cell.ViewWithTag(2) as UISwitch; label = cell.ViewWithTag(1) as UILabel; label.Text = "Level 3 Raids"; s5.On = settings.Level3Raids; break; case 3: cell = tableView.DequeueReusableCell("AllNotifyCell", indexPath); var s6 = cell.ViewWithTag(2) as UISwitch; label = cell.ViewWithTag(1) as UILabel; label.Text = "Level 2 Raids"; s6.On = settings.Level2Raids; break; case 4: cell = tableView.DequeueReusableCell("AllNotifyCell", indexPath); var s7 = cell.ViewWithTag(2) as UISwitch; label = cell.ViewWithTag(1) as UILabel; label.Text = "Level 1 Raids"; s7.On = settings.Level1Raids; break; } } else { cell = tableView.DequeueReusableCell("FilterCell", indexPath); var img = cell.ViewWithTag(1) as UIImageView; var notifyLbl = cell.ViewWithTag(2) as UILabel; var notifySwitch = cell.ViewWithTag(3) as UISwitch; var trashLbl = cell.ViewWithTag(4) as UILabel; var trashSwitch = cell.ViewWithTag(5) as UISwitch; var ignoreLbl = cell.ViewWithTag(6) as UILabel; var ignoreSwitch = cell.ViewWithTag(7) as UISwitch; var pokemonid = ConvertRowToID(indexPath.Row); img.Image = UIImage.FromBundle(pokemonid.ToString("D3")); if (!settings.PokemonHidden.Contains(pokemonid)) { img.Alpha = 1.0f; notifyLbl.TextColor = UIColor.Black; trashLbl.TextColor = UIColor.Black; ignoreLbl.TextColor = UIColor.Black; trashSwitch.Enabled = true; trashSwitch.On = settings.PokemonTrash.Contains(pokemonid); notifySwitch.Enabled = true; notifySwitch.On = settings.NotifyPokemon.Contains(pokemonid); ignoreSwitch.Enabled = true; ignoreSwitch.On = settings.IgnorePokemon.Contains(pokemonid); } else { img.Alpha = 0.7f; notifyLbl.TextColor = UIColor.LightGray; trashLbl.TextColor = UIColor.LightGray; ignoreLbl.TextColor = UIColor.LightGray; trashSwitch.Enabled = false; trashSwitch.On = false; notifySwitch.Enabled = false; notifySwitch.On = false; ignoreSwitch.Enabled = false; ignoreSwitch.On = false; } cell.SelectionStyle = UITableViewCellSelectionStyle.None; } return(cell); }
public override void WillDisplay(UITableView tableView, UITableViewCell cell, NSIndexPath indexPath) { var unratedArgumentIcon = cell.ViewWithTag(5) as UIImageView; var unratedArgumentLabel = cell.ViewWithTag(10) as UILabel; unratedArgumentIcon.Alpha = 0; unratedArgumentLabel.Alpha = 0; Task.Run(() => { ProductGroupManager.GetUnratedArgumentsCount( ProductGroups[indexPath.Row], UserManager.LoggedInUser().Id, unratedArgumentsCount => InvokeOnMainThread(() => { if ( unratedArgumentsCount > 0 ) { unratedArgumentLabel.Text = unratedArgumentsCount.ToString(); UIView.BeginAnimations("cellAnimation"); UIView.SetAnimationCurve(UIViewAnimationCurve.EaseInOut); UIView.SetAnimationDuration(1); unratedArgumentIcon.Alpha = 1; unratedArgumentLabel.Alpha = 1; UIView.CommitAnimations(); } }) ); }); }
public override void RefreshCell(UITableViewCell cell) { cell.SelectionStyle = UITableViewCellSelectionStyle.None; cell.TextLabel.Text = Caption; TextField.ReturnKeyType = NextElement (typeof(TextFieldElement)) != null ? UIReturnKeyType.Next : UIReturnKeyType.Default; var v = cell.ViewWithTag (42); if (v == null) { cell.ContentView.AddSubview (TextField); } else { if (v.Handle != TextField.Handle) { v.RemoveFromSuperview (); cell.ContentView.AddSubview (TextField); } } TextField.Frame = new RectangleF (CaptionWidth, 11, 300 - CaptionWidth, 22); }
public override void RefreshCell(UITableViewCell cell) { cell.SelectionStyle = UITableViewCellSelectionStyle.None; cell.TextLabel.Text = Caption; var v = cell.ViewWithTag (42); if (v == null) { cell.ContentView.AddSubview (TextView); } else { if (v.Handle != TextView.Handle) { v.RemoveFromSuperview (); cell.ContentView.AddSubview (TextView); } } TextView.Frame = new RectangleF (70, 11, 220, TextViewHeight); }
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { UITableViewCell cell = null; //pIndexPath = indexPath.Row; // if (indexPath.Row == 0) // { // cell = tableView.DequeueReusableCell (kCellIdentifier) as UltrasoundParametersAndTheNonstressTestTableViewCell; // if (cell == null) // { // var views = NSBundle.MainBundle.LoadNib("UltrasoundParametersAndTheNonstressTestTableViewCell", cell, null); // cell = views.GetItem<UltrasoundParametersAndTheNonstressTestTableViewCell>(0); // } // var TestNameLabel = cell.ViewWithTag (3200) as UILabel; // var TestDescriptionLabel = cell.ViewWithTag (3300) as UILabel; // TestNameLabel.Text = testList[indexPath.Row]; // TestDescriptionLabel.Text = testDescription[indexPath.Row]; // } // else // { cell = tableView.DequeueReusableCell(kCellIdentifier) as UltrasoundParametersAndTheNonstressTestTableViewCell; if (cell == null) { var views = NSBundle.MainBundle.LoadNib("UltrasoundParametersAndTheNonstressTestTableViewCell", cell, null); cell = views.GetItem <UltrasoundParametersAndTheNonstressTestTableViewCell>(0); } var TestNameLabel = cell.ViewWithTag(3200) as UILabel; var TestDescriptionLabel = cell.ViewWithTag(3300) as UILabel; TestNameLabel.Text = testList[indexPath.Row]; TestDescriptionLabel.Text = testDescription[indexPath.Row]; //TestNameLabel.BackgroundColor = UIColor.White; //TestDescriptionLabel.BackgroundColor = UIColor.White; //cell.BackgroundColor = UIColor.Black; //cell.BackgroundColor = UIColor.Purple; // if (indexPath.Row == 0) { // cell.BackgroundColor = UIColor.Red; // } // if (indexPath.Row == 1) { // cell.BackgroundColor = UIColor.Blue; // } // if (indexPath.Row == 2) { // cell.BackgroundColor = UIColor.Green; // } // if (indexPath.Row == 3) { // cell.BackgroundColor = UIColor.Gray; // } // if (indexPath.Row == 4) { // cell.BackgroundColor = UIColor.Purple; // } //} // if (indexPath.Row == 0) { // cell.BackgroundColor = UIColor.Red; // } // UITableViewCell cell = null; // // cell = tableView.DequeueReusableCell (kCellIdentifier); // if (cell == null) // { // //var views = NSBundle.MainBundle.LoadNib("FifthTableViewCell", cell, null); // //cell = views.GetItem<FifthTableViewCell>(0); // cell = new UITableViewCell(); // } // cell.BackgroundColor = UIColor.Red; return(cell); }
public override void RefreshCell(UITableViewCell cell) { base.RefreshCell (cell); var v = cell.ViewWithTag (42); if (v == null) { cell.ContentView.AddSubview (_activity); } }