package com.wrapp.android.webimageexample;

import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

public class WebImageListAdapter extends BaseAdapter {
  private static final int NUM_IMAGES = 50;

  public int getCount() {
    return NUM_IMAGES;
  }

  private String getImageUrl(int i) {
    // Unicorns!
    return "http://unicornify.appspot.com/avatar/" + i + "?s=100";
  }

  public Object getItem(int i) {
    return getImageUrl(i);
  }

  public long getItemId(int i) {
    return i;
  }

  public View getView(int i, View convertView, ViewGroup parentViewGroup) {
    LinearLayout webImageContainerView;
    if(convertView != null) {
      webImageContainerView = (LinearLayout)convertView;
    }
    else {
      final Context context = parentViewGroup.getContext();
      LayoutInflater layoutInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      webImageContainerView = (LinearLayout)layoutInflater.inflate(R.layout.web_image_container_view, null);
    }

    WebImageView webImageView = (WebImageView)webImageContainerView.findViewById(R.id.WebImageView);
    webImageView.setImageUrl(getImageUrl(i));
    return webImageContainerView;
  }
}

@@ -612,22 +612,9 @@
     
-LinearLayout w
+W
 ebIm
@@ -625,24 +625,38 @@
 ontainerView
+ containerView
 ;%0A    if(con
@@ -677,25 +677,42 @@
 ll) %7B%0A      
-w
+containerView = (W
 ebImageConta
@@ -719,32 +719,16 @@
 inerView
- = (LinearLayout
 )convert
@@ -760,404 +760,101 @@
     
-final Context context = parentViewGroup.getContext();%0A      LayoutInflater layoutInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);%0A      webImageContainerView = (LinearLayout)layoutInflater.inflate(R.layout.web_image_container_view, null);%0A    %7D%0A%0A    WebImageView webImageView = (WebImageView)webImageContainerView.findViewById(R.id.WebImageView);%0A    webImage
+containerView = new WebImageContainerView(parentViewGroup.getContext());%0A    %7D%0A%0A    container
 View
@@ -898,17 +898,9 @@
 urn 
-webImageC
+c
 onta

Use container view class