public override View GetView(int position, View convertView, ViewGroup parent) { if (position < 0) return null; var view = (convertView ?? context.LayoutInflater.Inflate( Resource.Layout.item_monkey, parent, false) ); if (view == null) return null; var wrapper = view.Tag as MonkeyAdapterWrapper; if (wrapper == null) { wrapper = new MonkeyAdapterWrapper { Title = view.FindViewById<TextView>(Resource.Id.item_title), Art = view.FindViewById<ImageView>(Resource.Id.item_image) }; view.Tag = wrapper; } var friend = friends.ElementAt(position); wrapper.Title.Text = friend.Title; ImageLoader.DisplayImage(friend.Image, wrapper.Art, -1); return view; }
public override View GetView(int position, View convertView, ViewGroup parent) { if (position < 0) { return(null); } var view = (convertView ?? context.LayoutInflater.Inflate( Resource.Layout.item_monkey, parent, false) ); if (view == null) { return(null); } var wrapper = view.Tag as MonkeyAdapterWrapper; if (wrapper == null) { wrapper = new MonkeyAdapterWrapper { Title = view.FindViewById <TextView>(Resource.Id.item_title), Art = view.FindViewById <ImageView>(Resource.Id.item_image) }; view.Tag = wrapper; } var friend = friends.ElementAt(position); wrapper.Title.Text = friend.Title; ImageLoader.DisplayImage(friend.Image, wrapper.Art, -1); return(view); }