title: Android gridView loading images using adapter and Glide
body: <p>I'm using a GridView to show 20 images. I'm fetching and showing the images from the web using Glide in an adapter that I create. The problem is that, also if all the images are downloaded,  when I'm scrolling the grid view I'm seeing the images appearing with a fade like animation. I dont' want this. I want to have all images loaded in the gridview without seeing them appear if I scroll faster.</p>
  
  <p>I've tried using diskcache() and dontAnimate() but it didnt solved my problem. I think the problem is that i'm showing 4 cells of the gridview. When i Scroll the adapter calls the getView to show other two cells and remove the 2 that I'm scrolling up. The problem is that the getview every times takes time to show other two cell and i have the effect that looks like a loading. I want my scenario to looks like a grid view with all 20 cells existing and allocated. </p>
  
  <p>This is my adapter:</p>
  
  <pre><code>public class ImagesAdapter extends BaseAdapter {
      private Context mContext;
      private ArrayList&lt;Picture&gt; images;
  
      public ImagesAdapter(Context context, int resource, ArrayList&lt;Picture&gt; inputImages) {
          super();
          this.mContext = context;
          this.images = inputImages;
      }
  
      @Override
      public int getCount() {
          return images.size();
      }
  
      @Override
      public Picture getItem(int position) {
          return images.get(position);
      }
  
      @Override
      public long getItemId(int position) {
          return 0;
      }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) 
      {
  
          View row = convertView;
          ViewHolder holder = null;
  
          if (row == null) {
              row = LayoutInflater.from(mContext).inflate(R.layout.grid_item_layout, null);
              holder = new ViewHolder();
              holder.imageView = (ImageView) row.findViewById(R.id.grid_item_image);
              holder.id = images.get(position).getImageId();
              row.setTag(holder);
          }
          else {
              holder = (ViewHolder) row.getTag();
              holder.id = images.get(position).getImageId();
          }
  
          Picture pic = images.get(position);
          Glide
                  .with(mContext)
                  .load(pic.getBigImageUrl())
                  .into(holder.imageView);
  
          return row;
      }
       public class ViewHolder {
          ImageView imageView;
          public String id;
      }
  }
  </code></pre>
  
  <p>Can someone help me finding solution? </p>