Java 类com.facebook.internal.ImageDownloader 实例源码

项目:QuizUpWinner    文件:ProfilePictureView.java   
private void sendImageRequest(boolean paramBoolean)
{
  try
  {
    ImageRequest localImageRequest = new ImageRequest.Builder(getContext(), ImageRequest.getProfilePictureUrl(this.profileId, this.queryWidth, this.queryHeight)).setAllowCachedRedirects(paramBoolean).setCallerTag(this).setCallback(new ImageRequest.Callback()
    {
      public void onCompleted(ImageResponse paramAnonymousImageResponse)
      {
        ProfilePictureView.this.processResponse(paramAnonymousImageResponse);
      }
    }).build();
    if (this.lastRequest != null)
      ImageDownloader.cancelRequest(this.lastRequest);
    this.lastRequest = localImageRequest;
    ImageDownloader.downloadAsync(localImageRequest);
    return;
  }
  catch (URISyntaxException localURISyntaxException)
  {
    Logger.log(LoggingBehavior.REQUESTS, 6, TAG, localURISyntaxException.toString());
  }
}
项目:AndroidBackendlessChat    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}
项目:chat-sdk-android-push-firebase    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}
项目:yelo-android    文件:ProfilePictureView.java   
private void sendImageRequest(boolean allowCachedResponse) {
    try {
        ImageRequest.Builder requestBuilder = new ImageRequest.Builder(
                getContext(),
                ImageRequest.getProfilePictureUrl(profileId, queryWidth,  queryHeight));

        ImageRequest request = requestBuilder.setAllowCachedRedirects(allowCachedResponse)
                .setCallerTag(this)
                .setCallback(
                new ImageRequest.Callback() {
                    @Override
                    public void onCompleted(ImageResponse response) {
                        processResponse(response);
                    }
                })
                .build();

        // Make sure to cancel the old request before sending the new one to prevent
        // accidental cancellation of the new request. This could happen if the URL and
        // caller tag stayed the same.
        if (lastRequest != null) {
            ImageDownloader.cancelRequest(lastRequest);
        }
        lastRequest = request;

        ImageDownloader.downloadAsync(request);
    } catch (URISyntaxException e) {
        Logger.log(LoggingBehavior.REQUESTS, Log.ERROR, TAG, e.toString());
    }
}
项目:yelo-android    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}
项目:BrillaMXAndroid    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}
项目:aquaplay    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}
项目:TP-Formation-Android    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}
项目:AutoTimeHelper    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}
项目:snake-game-aws    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}
项目:BrainStudio    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}
项目:QuizUpWinner    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String paramString, URI paramURI, final ImageView paramImageView)
{
  if (paramURI == null)
    return;
  int i;
  if (paramImageView == null)
    i = 1;
  else
    i = 0;
  int j = i;
  if ((i != 0) || (!paramURI.equals(paramImageView.getTag())))
  {
    if (j == 0)
    {
      paramImageView.setTag(paramString);
      paramImageView.setImageResource(getDefaultPicture());
    }
    ImageRequest localImageRequest = new ImageRequest.Builder(this.context.getApplicationContext(), paramURI).setCallerTag(this).setCallback(new ImageRequest.Callback()
    {
      public void onCompleted(ImageResponse paramAnonymousImageResponse)
      {
        GraphObjectAdapter.this.processImageResponse(paramAnonymousImageResponse, paramString, paramImageView);
      }
    }).build();
    this.pendingRequests.put(paramString, localImageRequest);
    ImageDownloader.downloadAsync(localImageRequest);
  }
}
项目:platform-friends-android    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}
项目:Shorcial    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}
项目:Team-Alice    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}
项目:CampusFeedv2    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}
项目:WatsiAndroidApp    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}
项目:Qtino.SharingKit    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}
项目:smartenit    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}
项目:maven-multilib-sample-app    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}
项目:DualRunner    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}
项目:ShopAfter    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}
项目:MeNextAndroid    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}
项目:MisterWok    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}
项目:CanYouSinkMe    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}
项目:ClassParticipation2    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}
项目:Klyph    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}
项目:Wabbit-Messenger---android-client    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}
项目:LostAndFound    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}
项目:UbiNomadLib    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}
项目:Nefete    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}
项目:PetTinder    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}
项目:StoryTeller    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}
项目:barterli_android    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}
项目:HereAStory-Android    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}
项目:android-skeleton-project    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}
项目:FacebookImageShareIntent    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}
项目:openkit-android    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}
项目:stepout    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}
项目:bladedroid    文件:GraphObjectAdapter.java   
private void downloadProfilePicture(final String profileId, URI pictureURI, final ImageView imageView) {
    if (pictureURI == null) {
        return;
    }

    // If we don't have an imageView, we are pre-fetching this image to store in-memory because we
    // think the user might scroll to its corresponding list row. If we do have an imageView, we
    // only want to queue a download if the view's tag isn't already set to the URL (which would mean
    // it's already got the correct picture).
    boolean prefetching = imageView == null;
    if (prefetching || !pictureURI.equals(imageView.getTag())) {
        if (!prefetching) {
            // Setting the tag to the profile ID indicates that we're currently downloading the
            // picture for this profile; we'll set it to the actual picture URL when complete.
            imageView.setTag(profileId);
            imageView.setImageResource(getDefaultPicture());
        }

        ImageRequest.Builder builder = new ImageRequest.Builder(context.getApplicationContext(), pictureURI)
                .setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(response, profileId, imageView);
                            }
                        });

        ImageRequest newRequest = builder.build();
        pendingRequests.put(profileId, newRequest);

        ImageDownloader.downloadAsync(newRequest);
    }
}