Inheritance: Java.Lang.Object
        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.Name;

            wrapper.Art.SetImageResource(Android.Resource.Color.Transparent);
            ImageLoader.DisplayImage(friend.Image, wrapper.Art);
            return view;
        }
Beispiel #2
0
        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.Name;

            wrapper.Art.SetImageResource(Android.Resource.Color.Transparent);
            ImageLoader.DisplayImage(friend.Image, wrapper.Art);
            return(view);
        }