public override View GetView(int position, View convertView, ViewGroup parent) { try { View row = convertView; if (row == null) { row = LayoutInflater.From(mContext).Inflate(Resource.Layout.MoreCellView, null, false); } //ImageView imgNewsImage = row.FindViewById<ImageView>(Resource.Id.imageViewMore); //var imageBitmap = AndroidHelper.GetImageFromUrl(mItem[position].imageUrl); //imgNewsImage.SetImageBitmap(imageBitmap); ImageViewAsync imgMoreImage = row.FindViewById <ImageViewAsync>(Resource.Id.imageViewMore); TextView txtHeadline = row.FindViewById <TextView>(Resource.Id.textViewMoreHeadline); TextView txtDescription = row.FindViewById <TextView>(Resource.Id.textViewMoreDescription); Typeface tf = Typeface.CreateFromAsset(parentTabView.Assets, Joyces.Helpers.Settings.MainFont); txtHeadline.SetTypeface(tf, Android.Graphics.TypefaceStyle.Normal); txtDescription.SetTypeface(tf, Android.Graphics.TypefaceStyle.Normal); if (!string.IsNullOrEmpty(mItem[position].imageUrl)) { ImageService.Instance.LoadUrl(mItem[position].imageUrl).Into(imgMoreImage); } if (!string.IsNullOrEmpty(mItem[position].desc)) { txtHeadline.Text = mItem[position].desc; } else { txtHeadline.Text = ""; } if (!string.IsNullOrEmpty(mItem[position].note)) { txtDescription.Text = mItem[position].note; } else { txtDescription.Text = ""; } parentTabView.DismissProgressbar(); return(row); } catch (Exception ee) { throw ee; } }
public override View GetView(int position, View convertView, ViewGroup parent) { View row = convertView; if (row == null) { row = LayoutInflater.From(mContext).Inflate(Resource.Layout.CustomListViewRowNewsfeed, null, false); } ImageViewAsync imgNewsImage = row.FindViewById <ImageViewAsync>(Resource.Id.imageViewNews); TextView txtHeadline = row.FindViewById <TextView>(Resource.Id.textViewHeadline); TextView txtDescription = row.FindViewById <TextView>(Resource.Id.textViewDescription); Typeface tf = Typeface.CreateFromAsset(parentTabView.Assets, Joyces.Helpers.Settings.MainFont); txtHeadline.SetTypeface(tf, Android.Graphics.TypefaceStyle.Normal); txtDescription.SetTypeface(tf, Android.Graphics.TypefaceStyle.Normal); if (!string.IsNullOrEmpty(mItem[position].imageUrl)) { ImageService.Instance.LoadUrl(mItem[position].imageUrl).Into(imgNewsImage); } if (!string.IsNullOrEmpty(mItem[position].name)) { txtHeadline.Text = mItem[position].name; } else { txtHeadline.Text = ""; } if (!string.IsNullOrEmpty(mItem[position].name)) { if (mItem[position].note.Length > iMaxChars) { txtDescription.Text = mItem[position].note.Substring(0, iMaxChars) + "..."; } else { txtDescription.Text = mItem[position].note; } } else { txtDescription.Text = ""; } parentTabView.DismissProgressbar(); return(row); }