picview/src/com/google/android/apps/picview/adapter/MultiColumnImageAdapter.java
private void recycleSlotView(ThumbnailSlotView slot,
      final ThumbnailItem<T> item) {
    slot.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
        listener.thumbnailClicked(item.getDataObject());
      }
    });

    TextView picTitle = (TextView) slot.findViewById(R.id.picture_title);
    picTitle.setText(item.getTitle());

    // We need to cancel the UI update of the image loading task for this
    // slot, if one is present and instead set the loading icon.
    ImageLoadingTask previousLoadingTask = slot.getImageLoadingTask();
    if (previousLoadingTask != null) {
      previousLoadingTask.setCancelUiUpdate(true);
    }

    ImageView albumThumbnail = (ImageView) slot
        .findViewById(R.id.album_thumbnail);

    // The ImageLoadingTask will load the thumbnail asynchronously and set
    // the result as soon as the response is in. The image will be set
    // immediately, if the result is already in cache.
    try {
      ImageLoadingTask task = new ImageLoadingTask(albumThumbnail, new URL(
          item.getThumbnailUrl()), cachedImageFetcher);
      slot.setImageLoadingTask(task);
      task.execute();
    } catch (MalformedURLException e) {
      e.printStackTrace();
    }
  }
/**
   * Recycles a slot view, if it already exists. This means, changing the title,
   * stopping a previous image loading task and instantiating a new image
   * loading task.
   * 
   * @param slot
   *          the slot to recycle
   * @param item
   *          the item that holds the data for the slot
   */
Recycles a slot view, if it already exists. This means, changing the title,
stopping a previous image loading task and instantiating a new image
loading task.

@param slot
the slot to recycle
@param item
the item that holds the data for the slot
Recycles a slot view if it already exists . This means changing the title stopping a previous image loading task and instantiating a new image loading task . @param slot the slot to recycle @param item the item that holds the data for the slot
private void recycleSlotView(ThumbnailSlotView slot,
      final ThumbnailItem<T> item) {
    slot.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
        listener.thumbnailClicked(item.getDataObject());
      }
    });
    TextView picTitle = (TextView) slot.findViewById(R.id.picture_title);
    picTitle.setText(item.getTitle());
    ImageLoadingTask previousLoadingTask = slot.getImageLoadingTask();
    if (previousLoadingTask != null) {
      previousLoadingTask.setCancelUiUpdate(true);
    }
    ImageView albumThumbnail = (ImageView) slot
        .findViewById(R.id.album_thumbnail);
    try {
      ImageLoadingTask task = new ImageLoadingTask(albumThumbnail, new URL(
          item.getThumbnailUrl()), cachedImageFetcher);
      slot.setImageLoadingTask(task);
      task.execute();
    } catch (MalformedURLException e) {
      e.printStackTrace();
    }
  }
private void recycleSlotView ( ThumbnailSlotView slot , final ThumbnailItem < T > item ) { slot . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { listener . thumbnailClicked ( item . getDataObject ( ) ) ; } } ) ; TextView picTitle = ( TextView ) slot . findViewById ( R . id . picture_title ) ; picTitle . setText ( item . getTitle ( ) ) ; ImageLoadingTask previousLoadingTask = slot . getImageLoadingTask ( ) ; if ( previousLoadingTask != null ) { previousLoadingTask . setCancelUiUpdate ( true ) ; } ImageView albumThumbnail = ( ImageView ) slot . findViewById ( R . id . album_thumbnail ) ; try { ImageLoadingTask task = new ImageLoadingTask ( albumThumbnail , new URL ( item . getThumbnailUrl ( ) ) , cachedImageFetcher ) ; slot . setImageLoadingTask ( task ) ; task . execute ( ) ; } catch ( MalformedURLException e ) { e . printStackTrace ( ) ; } }
Recycles a slot view, if it already exists.
Recycles a slot view if it already exists .
// We need to cancel the UI update of the image loading task for this // slot, if one is present and instead set the loading icon. // The ImageLoadingTask will load the thumbnail asynchronously and set // the result as soon as the response is in. The image will be set // immediately, if the result is already in cache.