public UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath, AthleteTeam item) { var cell = tableView.DequeueReusableCell("AthleteTeamCell", indexPath) as AthleteTeamCell; cell.SetData(item); return(cell); }
View GetView(AthleteTeam item, int position, View convertView, ViewGroup parent) { View view = convertView; if (view == null) { view = LayoutInflater.Inflate(Resource.Layout.AthleteTeamItem, null); } view.FindViewById <TextView>(Resource.Id.lblSchoolName).Text = item.SchoolName; view.FindViewById <TextView>(Resource.Id.lblSportName).Text = item.SportName; var profileImageView = view.FindViewById <ImageViewAsync>(Resource.Id.imgProfile); profileImageView.Tag?.CancelPendingTask(item.ProfilePublicUrl); var task = ImageService.Instance.LoadUrl(item.ProfilePublicUrl) .Retry(3, 300) .LoadingPlaceholder(Resource.Drawable.DefProfPic.ToString(), ImageSource.CompiledResource) .Into(profileImageView); profileImageView.Tag = new ImageLoaderHelper(task); return(view); }
public void SetData(AthleteTeam item) { lblSport.Text = item.SportName; lblSchool.Text = item.SchoolName; imageTask?.Cancel(item.ProfilePublicUrl); if (!string.IsNullOrEmpty(item.ProfilePublicUrl)) { imageTask = new ImageLoaderHelper(item.ProfilePublicUrl, imgProfile, "DefaultProfile"); } }