public override View GetView(int position, View convertView, ViewGroup parent) { var view = convertView; FriendAdapterViewHolder holder = null; if (view != null) holder = view.Tag as FriendAdapterViewHolder; if (holder == null) { holder = new FriendAdapterViewHolder(); var inflater = context.GetSystemService(Context.LayoutInflaterService).JavaCast<LayoutInflater>(); //replace with your item and your holder items //comment back in view = inflater.Inflate(Resource.Layout.item_friend, parent, false); holder.Name = view.FindViewById<TextView>(Resource.Id.contact_name); holder.Photo = view.FindViewById<ImageView>(Resource.Id.contact_photo); view.Tag = holder; } var friend = viewModel.Friends [position]; holder.Name.Text = friend.Name; Koush.UrlImageViewHelper.SetUrlDrawable (holder.Photo, friend.Photo, Resource.Drawable.default_photo); return view; }
public override View GetView(int position, View convertView, ViewGroup parent) { var view = convertView; FriendAdapterViewHolder holder = null; if (view != null) { holder = view.Tag as FriendAdapterViewHolder; } if (holder == null) { holder = new FriendAdapterViewHolder(); var inflater = context.GetSystemService(Context.LayoutInflaterService).JavaCast <LayoutInflater>(); //replace with your item and your holder items //comment back in view = inflater.Inflate(Resource.Layout.item_friend, parent, false); holder.Name = view.FindViewById <TextView>(Resource.Id.contact_name); holder.Photo = view.FindViewById <ImageView>(Resource.Id.contact_photo); view.Tag = holder; } var friend = viewModel.Friends [position]; holder.Name.Text = friend.Name; Koush.UrlImageViewHelper.SetUrlDrawable(holder.Photo, friend.Photo, Resource.Drawable.default_photo); return(view); }