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

项目:AndroidBackendlessChat    文件:GraphObjectAdapter.java   
private void processImageResponse(ImageResponse response, String graphObjectId, ImageView imageView) {
    pendingRequests.remove(graphObjectId);
    if (response.getError() != null) {
        callOnErrorListener(response.getError());
    }

    if (imageView == null) {
        // This was a pre-fetch request.
        if (response.getBitmap() != null) {
            // Is the cache too big?
            if (prefetchedPictureCache.size() >= MAX_PREFETCHED_PICTURES) {
                // Find the oldest one and remove it.
                String oldestId = prefetchedProfilePictureIds.remove(0);
                prefetchedPictureCache.remove(oldestId);
            }
            prefetchedPictureCache.put(graphObjectId, response);
        }
    } else if (graphObjectId.equals(imageView.getTag())) {
        Exception error = response.getError();
        Bitmap bitmap = response.getBitmap();
        if (error == null && bitmap != null) {
            imageView.setImageBitmap(bitmap);
            imageView.setTag(response.getRequest().getImageUri());
        }
    }
}
项目:AndroidBackendlessChat    文件:UserSettingsFragment.java   
private ImageRequest getImageRequest() {
    ImageRequest request = null;
    try {
        ImageRequest.Builder requestBuilder = new ImageRequest.Builder(
                getActivity(),
                ImageRequest.getProfilePictureUrl(
                        user.getId(),
                        getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_width),
                        getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_height)));

        request = requestBuilder.setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(user.getId(), response);
                            }
                        })
                .build();
    } catch (URISyntaxException e) {
    }
    return request;
}
项目:chat-sdk-android-push-firebase    文件:GraphObjectAdapter.java   
private void processImageResponse(ImageResponse response, String graphObjectId, ImageView imageView) {
    pendingRequests.remove(graphObjectId);
    if (response.getError() != null) {
        callOnErrorListener(response.getError());
    }

    if (imageView == null) {
        // This was a pre-fetch request.
        if (response.getBitmap() != null) {
            // Is the cache too big?
            if (prefetchedPictureCache.size() >= MAX_PREFETCHED_PICTURES) {
                // Find the oldest one and remove it.
                String oldestId = prefetchedProfilePictureIds.remove(0);
                prefetchedPictureCache.remove(oldestId);
            }
            prefetchedPictureCache.put(graphObjectId, response);
        }
    } else if (graphObjectId.equals(imageView.getTag())) {
        Exception error = response.getError();
        Bitmap bitmap = response.getBitmap();
        if (error == null && bitmap != null) {
            imageView.setImageBitmap(bitmap);
            imageView.setTag(response.getRequest().getImageUri());
        }
    }
}
项目:chat-sdk-android-push-firebase    文件:UserSettingsFragment.java   
private ImageRequest getImageRequest() {
    ImageRequest request = null;
    try {
        ImageRequest.Builder requestBuilder = new ImageRequest.Builder(
                getActivity(),
                ImageRequest.getProfilePictureUrl(
                        user.getId(),
                        getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_width),
                        getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_height)));

        request = requestBuilder.setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(user.getId(), response);
                            }
                        })
                .build();
    } catch (URISyntaxException e) {
    }
    return request;
}
项目:yelo-android    文件:ProfilePictureView.java   
private void processResponse(ImageResponse response) {
    // First check if the response is for the right request. We may have:
    // 1. Sent a new request, thus super-ceding this one.
    // 2. Detached this view, in which case the response should be discarded.
    if (response.getRequest() == lastRequest) {
        lastRequest = null;
        Bitmap responseImage = response.getBitmap();
        Exception error = response.getError();
        if (error != null) {
            OnErrorListener listener = onErrorListener;
            if (listener != null) {
                listener.onError(new FacebookException(
                        "Error in downloading profile picture for profileId: " + getProfileId(), error));
            } else {
                Logger.log(LoggingBehavior.REQUESTS, Log.ERROR, TAG, error.toString());
            }
        } else if (responseImage != null) {
            setImageBitmap(responseImage);

            if (response.isCachedRedirect()) {
                sendImageRequest(false);
            }
        }
    }
}
项目:yelo-android    文件:GraphObjectAdapter.java   
private void processImageResponse(ImageResponse response, String graphObjectId, ImageView imageView) {
    pendingRequests.remove(graphObjectId);
    if (response.getError() != null) {
        callOnErrorListener(response.getError());
    }

    if (imageView == null) {
        // This was a pre-fetch request.
        if (response.getBitmap() != null) {
            // Is the cache too big?
            if (prefetchedPictureCache.size() >= MAX_PREFETCHED_PICTURES) {
                // Find the oldest one and remove it.
                String oldestId = prefetchedProfilePictureIds.remove(0);
                prefetchedPictureCache.remove(oldestId);
            }
            prefetchedPictureCache.put(graphObjectId, response);
        }
    } else if (graphObjectId.equals(imageView.getTag())) {
        Exception error = response.getError();
        Bitmap bitmap = response.getBitmap();
        if (error == null && bitmap != null) {
            imageView.setImageBitmap(bitmap);
            imageView.setTag(response.getRequest().getImageUri());
        }
    }
}
项目:yelo-android    文件:UserSettingsFragment.java   
private ImageRequest getImageRequest() {
    ImageRequest request = null;
    try {
        ImageRequest.Builder requestBuilder = new ImageRequest.Builder(
                getActivity(),
                ImageRequest.getProfilePictureUrl(
                        user.getId(),
                        getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_width),
                        getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_height)));

        request = requestBuilder.setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(user.getId(), response);
                            }
                        })
                .build();
    } catch (URISyntaxException e) {
    }
    return request;
}
项目:BrillaMXAndroid    文件:GraphObjectAdapter.java   
private void processImageResponse(ImageResponse response, String graphObjectId, ImageView imageView) {
    pendingRequests.remove(graphObjectId);
    if (response.getError() != null) {
        callOnErrorListener(response.getError());
    }

    if (imageView == null) {
        // This was a pre-fetch request.
        if (response.getBitmap() != null) {
            // Is the cache too big?
            if (prefetchedPictureCache.size() >= MAX_PREFETCHED_PICTURES) {
                // Find the oldest one and remove it.
                String oldestId = prefetchedProfilePictureIds.remove(0);
                prefetchedPictureCache.remove(oldestId);
            }
            prefetchedPictureCache.put(graphObjectId, response);
        }
    } else if (graphObjectId.equals(imageView.getTag())) {
        Exception error = response.getError();
        Bitmap bitmap = response.getBitmap();
        if (error == null && bitmap != null) {
            imageView.setImageBitmap(bitmap);
            imageView.setTag(response.getRequest().getImageUri());
        }
    }
}
项目:BrillaMXAndroid    文件:UserSettingsFragment.java   
private ImageRequest getImageRequest() {
    ImageRequest request = null;
    try {
        ImageRequest.Builder requestBuilder = new ImageRequest.Builder(
                getActivity(),
                ImageRequest.getProfilePictureUrl(
                        user.getId(),
                        getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_width),
                        getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_height)));

        request = requestBuilder.setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(user.getId(), response);
                            }
                        })
                .build();
    } catch (URISyntaxException e) {
    }
    return request;
}
项目:aquaplay    文件:GraphObjectAdapter.java   
private void processImageResponse(ImageResponse response, String graphObjectId, ImageView imageView) {
    pendingRequests.remove(graphObjectId);
    if (response.getError() != null) {
        callOnErrorListener(response.getError());
    }

    if (imageView == null) {
        // This was a pre-fetch request.
        if (response.getBitmap() != null) {
            // Is the cache too big?
            if (prefetchedPictureCache.size() >= MAX_PREFETCHED_PICTURES) {
                // Find the oldest one and remove it.
                String oldestId = prefetchedProfilePictureIds.remove(0);
                prefetchedPictureCache.remove(oldestId);
            }
            prefetchedPictureCache.put(graphObjectId, response);
        }
    } else if (graphObjectId.equals(imageView.getTag())) {
        Exception error = response.getError();
        Bitmap bitmap = response.getBitmap();
        if (error == null && bitmap != null) {
            imageView.setImageBitmap(bitmap);
            imageView.setTag(response.getRequest().getImageUri());
        }
    }
}
项目:aquaplay    文件:UserSettingsFragment.java   
private ImageRequest getImageRequest() {
    ImageRequest request = null;
    try {
        ImageRequest.Builder requestBuilder = new ImageRequest.Builder(
                getActivity(),
                ImageRequest.getProfilePictureUrl(
                        user.getId(),
                        getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_width),
                        getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_height)));

        request = requestBuilder.setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(user.getId(), response);
                            }
                        })
                .build();
    } catch (URISyntaxException e) {
    }
    return request;
}
项目:TP-Formation-Android    文件:GraphObjectAdapter.java   
private void processImageResponse(ImageResponse response, String graphObjectId, ImageView imageView) {
    pendingRequests.remove(graphObjectId);
    if (response.getError() != null) {
        callOnErrorListener(response.getError());
    }

    if (imageView == null) {
        // This was a pre-fetch request.
        if (response.getBitmap() != null) {
            // Is the cache too big?
            if (prefetchedPictureCache.size() >= MAX_PREFETCHED_PICTURES) {
                // Find the oldest one and remove it.
                String oldestId = prefetchedProfilePictureIds.remove(0);
                prefetchedPictureCache.remove(oldestId);
            }
            prefetchedPictureCache.put(graphObjectId, response);
        }
    } else if (graphObjectId.equals(imageView.getTag())) {
        Exception error = response.getError();
        Bitmap bitmap = response.getBitmap();
        if (error == null && bitmap != null) {
            imageView.setImageBitmap(bitmap);
            imageView.setTag(response.getRequest().getImageUri());
        }
    }
}
项目:TP-Formation-Android    文件:UserSettingsFragment.java   
private ImageRequest getImageRequest() {
    ImageRequest request = null;
    try {
        ImageRequest.Builder requestBuilder = new ImageRequest.Builder(
                getActivity(),
                ImageRequest.getProfilePictureUrl(
                        user.getId(),
                        getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_width),
                        getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_height)));

        request = requestBuilder.setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(user.getId(), response);
                            }
                        })
                .build();
    } catch (URISyntaxException e) {
    }
    return request;
}
项目:AutoTimeHelper    文件:GraphObjectAdapter.java   
private void processImageResponse(ImageResponse response, String graphObjectId, ImageView imageView) {
    pendingRequests.remove(graphObjectId);
    if (response.getError() != null) {
        callOnErrorListener(response.getError());
    }

    if (imageView == null) {
        // This was a pre-fetch request.
        if (response.getBitmap() != null) {
            // Is the cache too big?
            if (prefetchedPictureCache.size() >= MAX_PREFETCHED_PICTURES) {
                // Find the oldest one and remove it.
                String oldestId = prefetchedProfilePictureIds.remove(0);
                prefetchedPictureCache.remove(oldestId);
            }
            prefetchedPictureCache.put(graphObjectId, response);
        }
    } else if (graphObjectId.equals(imageView.getTag())) {
        Exception error = response.getError();
        Bitmap bitmap = response.getBitmap();
        if (error == null && bitmap != null) {
            imageView.setImageBitmap(bitmap);
            imageView.setTag(response.getRequest().getImageUri());
        }
    }
}
项目:AutoTimeHelper    文件:UserSettingsFragment.java   
private ImageRequest getImageRequest() {
    ImageRequest request = null;
    try {
        ImageRequest.Builder requestBuilder = new ImageRequest.Builder(
                getActivity(),
                ImageRequest.getProfilePictureUrl(
                        user.getId(),
                        getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_width),
                        getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_height)));

        request = requestBuilder.setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(user.getId(), response);
                            }
                        })
                .build();
    } catch (URISyntaxException e) {
    }
    return request;
}
项目:snake-game-aws    文件:GraphObjectAdapter.java   
private void processImageResponse(ImageResponse response, String graphObjectId, ImageView imageView) {
    pendingRequests.remove(graphObjectId);
    if (response.getError() != null) {
        callOnErrorListener(response.getError());
    }

    if (imageView == null) {
        // This was a pre-fetch request.
        if (response.getBitmap() != null) {
            // Is the cache too big?
            if (prefetchedPictureCache.size() >= MAX_PREFETCHED_PICTURES) {
                // Find the oldest one and remove it.
                String oldestId = prefetchedProfilePictureIds.remove(0);
                prefetchedPictureCache.remove(oldestId);
            }
            prefetchedPictureCache.put(graphObjectId, response);
        }
    } else if (graphObjectId.equals(imageView.getTag())) {
        Exception error = response.getError();
        Bitmap bitmap = response.getBitmap();
        if (error == null && bitmap != null) {
            imageView.setImageBitmap(bitmap);
            imageView.setTag(response.getRequest().getImageUri());
        }
    }
}
项目:snake-game-aws    文件:UserSettingsFragment.java   
private ImageRequest getImageRequest() {
    ImageRequest request = null;
    try {
        ImageRequest.Builder requestBuilder = new ImageRequest.Builder(
                getActivity(),
                ImageRequest.getProfilePictureUrl(
                        user.getId(),
                        getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_width),
                        getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_height)));

        request = requestBuilder.setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(user.getId(), response);
                            }
                        })
                .build();
    } catch (URISyntaxException e) {
    }
    return request;
}
项目:BrainStudio    文件:GraphObjectAdapter.java   
private void processImageResponse(ImageResponse response, String graphObjectId, ImageView imageView) {
    pendingRequests.remove(graphObjectId);
    if (response.getError() != null) {
        callOnErrorListener(response.getError());
    }

    if (imageView == null) {
        // This was a pre-fetch request.
        if (response.getBitmap() != null) {
            // Is the cache too big?
            if (prefetchedPictureCache.size() >= MAX_PREFETCHED_PICTURES) {
                // Find the oldest one and remove it.
                String oldestId = prefetchedProfilePictureIds.remove(0);
                prefetchedPictureCache.remove(oldestId);
            }
            prefetchedPictureCache.put(graphObjectId, response);
        }
    } else if (graphObjectId.equals(imageView.getTag())) {
        Exception error = response.getError();
        Bitmap bitmap = response.getBitmap();
        if (error == null && bitmap != null) {
            imageView.setImageBitmap(bitmap);
            imageView.setTag(response.getRequest().getImageUri());
        }
    }
}
项目:BrainStudio    文件:UserSettingsFragment.java   
private ImageRequest getImageRequest() {
    ImageRequest request = null;
    try {
        ImageRequest.Builder requestBuilder = new ImageRequest.Builder(
                getActivity(),
                ImageRequest.getProfilePictureUrl(
                        user.getId(),
                        getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_width),
                        getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_height)));

        request = requestBuilder.setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(user.getId(), response);
                            }
                        })
                .build();
    } catch (URISyntaxException e) {
    }
    return request;
}
项目:QuizUpWinner    文件:ProfilePictureView.java   
private void processResponse(ImageResponse paramImageResponse)
{
  if (paramImageResponse.getRequest() == this.lastRequest)
  {
    this.lastRequest = null;
    Bitmap localBitmap = paramImageResponse.getBitmap();
    Exception localException = paramImageResponse.getError();
    if (localException != null)
    {
      OnErrorListener localOnErrorListener = this.onErrorListener;
      if (localOnErrorListener != null)
      {
        localOnErrorListener.onError(new FacebookException("Error in downloading profile picture for profileId: " + getProfileId(), localException));
        return;
      }
      Logger.log(LoggingBehavior.REQUESTS, 6, TAG, localException.toString());
      return;
    }
    if (localBitmap != null)
    {
      setImageBitmap(localBitmap);
      if (paramImageResponse.isCachedRedirect())
        sendImageRequest(false);
    }
  }
}
项目: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());
  }
}
项目:KlyphMessenger    文件:GraphObjectAdapter.java   
private void processImageResponse(ImageResponse response, String graphObjectId, ImageView imageView) {
    pendingRequests.remove(graphObjectId);
    if (response.getError() != null) {
        callOnErrorListener(response.getError());
    }

    if (imageView == null) {
        // This was a pre-fetch request.
        if (response.getBitmap() != null) {
            // Is the cache too big?
            if (prefetchedPictureCache.size() >= MAX_PREFETCHED_PICTURES) {
                // Find the oldest one and remove it.
                String oldestId = prefetchedProfilePictureIds.remove(0);
                prefetchedPictureCache.remove(oldestId);
            }
            prefetchedPictureCache.put(graphObjectId, response);
        }
    } else if (graphObjectId.equals(imageView.getTag())) {
        Exception error = response.getError();
        Bitmap bitmap = response.getBitmap();
        if (error == null && bitmap != null) {
            imageView.setImageBitmap(bitmap);
            imageView.setTag(response.getRequest().getImageUri());
        }
    }
}
项目:stepout    文件:UserSettingsFragment.java   
private ImageRequest getImageRequest() {
    ImageRequest request = null;
    try {
        ImageRequest.Builder requestBuilder = new ImageRequest.Builder(
                getActivity(),
                ImageRequest.getProfilePictureUrl(
                        user.getId(),
                        getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_width),
                        getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_height)));

        request = requestBuilder.setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(user.getId(), response);
                            }
                        })
                .build();
    } catch (URISyntaxException e) {
    }
    return request;
}
项目:platform-friends-android    文件:UserSettingsFragment.java   
private ImageRequest getImageRequest() {
    ImageRequest request = null;
    try {
        ImageRequest.Builder requestBuilder = new ImageRequest.Builder(
                getActivity(),
                ImageRequest.getProfilePictureUrl(
                        user.getId(),
                        getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_width),
                        getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_height)));

        request = requestBuilder.setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(user.getId(), response);
                            }
                        })
                .build();
    } catch (URISyntaxException e) {
    }
    return request;
}
项目:PetTinder    文件:GraphObjectAdapter.java   
private void processImageResponse(ImageResponse response, String graphObjectId, ImageView imageView) {
    pendingRequests.remove(graphObjectId);
    if (response.getError() != null) {
        callOnErrorListener(response.getError());
    }

    if (imageView == null) {
        // This was a pre-fetch request.
        if (response.getBitmap() != null) {
            // Is the cache too big?
            if (prefetchedPictureCache.size() >= MAX_PREFETCHED_PICTURES) {
                // Find the oldest one and remove it.
                String oldestId = prefetchedProfilePictureIds.remove(0);
                prefetchedPictureCache.remove(oldestId);
            }
            prefetchedPictureCache.put(graphObjectId, response);
        }
    } else if (graphObjectId.equals(imageView.getTag())) {
        Exception error = response.getError();
        Bitmap bitmap = response.getBitmap();
        if (error == null && bitmap != null) {
            imageView.setImageBitmap(bitmap);
            imageView.setTag(response.getRequest().getImageUri());
        }
    }
}
项目:ClosedCirclesAndroid    文件:GraphObjectAdapter.java   
private void processImageResponse(ImageResponse response, String graphObjectId, ImageView imageView) {
    pendingRequests.remove(graphObjectId);
    if (response.getError() != null) {
        callOnErrorListener(response.getError());
    }

    if (imageView == null) {
        // This was a pre-fetch request.
        if (response.getBitmap() != null) {
            // Is the cache too big?
            if (prefetchedPictureCache.size() >= MAX_PREFETCHED_PICTURES) {
                // Find the oldest one and remove it.
                String oldestId = prefetchedProfilePictureIds.remove(0);
                prefetchedPictureCache.remove(oldestId);
            }
            prefetchedPictureCache.put(graphObjectId, response);
        }
    } else if (graphObjectId.equals(imageView.getTag())) {
        Exception error = response.getError();
        Bitmap bitmap = response.getBitmap();
        if (error == null && bitmap != null) {
            imageView.setImageBitmap(bitmap);
            imageView.setTag(response.getRequest().getImageUri());
        }
    }
}
项目:Shorcial    文件:GraphObjectAdapter.java   
private void processImageResponse(ImageResponse response, String graphObjectId, ImageView imageView) {
    pendingRequests.remove(graphObjectId);
    if (response.getError() != null) {
        callOnErrorListener(response.getError());
    }

    if (imageView == null) {
        // This was a pre-fetch request.
        if (response.getBitmap() != null) {
            // Is the cache too big?
            if (prefetchedPictureCache.size() >= MAX_PREFETCHED_PICTURES) {
                // Find the oldest one and remove it.
                String oldestId = prefetchedProfilePictureIds.remove(0);
                prefetchedPictureCache.remove(oldestId);
            }
            prefetchedPictureCache.put(graphObjectId, response);
        }
    } else if (graphObjectId.equals(imageView.getTag())) {
        Exception error = response.getError();
        Bitmap bitmap = response.getBitmap();
        if (error == null && bitmap != null) {
            imageView.setImageBitmap(bitmap);
            imageView.setTag(response.getRequest().getImageUri());
        }
    }
}
项目:Shorcial    文件:UserSettingsFragment.java   
private ImageRequest getImageRequest() {
    ImageRequest request = null;
    try {
        ImageRequest.Builder requestBuilder = new ImageRequest.Builder(
                getActivity(),
                ImageRequest.getProfilePictureUrl(
                        user.getId(),
                        getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_width),
                        getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_height)));

        request = requestBuilder.setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(user.getId(), response);
                            }
                        })
                .build();
    } catch (URISyntaxException e) {
    }
    return request;
}
项目:Team-Alice    文件:GraphObjectAdapter.java   
private void processImageResponse(ImageResponse response, String graphObjectId, ImageView imageView) {
    pendingRequests.remove(graphObjectId);
    if (response.getError() != null) {
        callOnErrorListener(response.getError());
    }

    if (imageView == null) {
        // This was a pre-fetch request.
        if (response.getBitmap() != null) {
            // Is the cache too big?
            if (prefetchedPictureCache.size() >= MAX_PREFETCHED_PICTURES) {
                // Find the oldest one and remove it.
                String oldestId = prefetchedProfilePictureIds.remove(0);
                prefetchedPictureCache.remove(oldestId);
            }
            prefetchedPictureCache.put(graphObjectId, response);
        }
    } else if (graphObjectId.equals(imageView.getTag())) {
        Exception error = response.getError();
        Bitmap bitmap = response.getBitmap();
        if (error == null && bitmap != null) {
            imageView.setImageBitmap(bitmap);
            imageView.setTag(response.getRequest().getImageUri());
        }
    }
}
项目:Team-Alice    文件:UserSettingsFragment.java   
private ImageRequest getImageRequest() {
    ImageRequest request = null;
    try {
        ImageRequest.Builder requestBuilder = new ImageRequest.Builder(
                getActivity(),
                ImageRequest.getProfilePictureUrl(
                        user.getId(),
                        getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_width),
                        getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_height)));

        request = requestBuilder.setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(user.getId(), response);
                            }
                        })
                .build();
    } catch (URISyntaxException e) {
    }
    return request;
}
项目:Abelana-Android    文件:UserSettingsFragment.java   
private ImageRequest getImageRequest() {
    ImageRequest request = null;
    try {
        ImageRequest.Builder requestBuilder = new ImageRequest.Builder(
                getActivity(),
                ImageRequest.getProfilePictureUrl(
                        user.getId(),
                        getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_width),
                        getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_height)));

        request = requestBuilder.setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(user.getId(), response);
                            }
                        })
                .build();
    } catch (URISyntaxException e) {
    }
    return request;
}
项目:openkit-android    文件:GraphObjectAdapter.java   
private void processImageResponse(ImageResponse response, String graphObjectId, ImageView imageView) {
    pendingRequests.remove(graphObjectId);
    if (response.getError() != null) {
        callOnErrorListener(response.getError());
    }

    if (imageView == null) {
        // This was a pre-fetch request.
        if (response.getBitmap() != null) {
            // Is the cache too big?
            if (prefetchedPictureCache.size() >= MAX_PREFETCHED_PICTURES) {
                // Find the oldest one and remove it.
                String oldestId = prefetchedProfilePictureIds.remove(0);
                prefetchedPictureCache.remove(oldestId);
            }
            prefetchedPictureCache.put(graphObjectId, response);
        }
    } else if (graphObjectId.equals(imageView.getTag())) {
        Exception error = response.getError();
        Bitmap bitmap = response.getBitmap();
        if (error == null && bitmap != null) {
            imageView.setImageBitmap(bitmap);
            imageView.setTag(response.getRequest().getImageUri());
        }
    }
}
项目:CampusFeedv2    文件:UserSettingsFragment.java   
private ImageRequest getImageRequest() {
    ImageRequest request = null;
    try {
        ImageRequest.Builder requestBuilder = new ImageRequest.Builder(
                getActivity(),
                ImageRequest.getProfilePictureUrl(
                        user.getId(),
                        getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_width),
                        getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_height)));

        request = requestBuilder.setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(user.getId(), response);
                            }
                        })
                .build();
    } catch (URISyntaxException e) {
    }
    return request;
}
项目:bladedroid    文件:GraphObjectAdapter.java   
private void processImageResponse(ImageResponse response, String graphObjectId, ImageView imageView) {
    pendingRequests.remove(graphObjectId);
    if (response.getError() != null) {
        callOnErrorListener(response.getError());
    }

    if (imageView == null) {
        // This was a pre-fetch request.
        if (response.getBitmap() != null) {
            // Is the cache too big?
            if (prefetchedPictureCache.size() >= MAX_PREFETCHED_PICTURES) {
                // Find the oldest one and remove it.
                String oldestId = prefetchedProfilePictureIds.remove(0);
                prefetchedPictureCache.remove(oldestId);
            }
            prefetchedPictureCache.put(graphObjectId, response);
        }
    } else if (graphObjectId.equals(imageView.getTag())) {
        Exception error = response.getError();
        Bitmap bitmap = response.getBitmap();
        if (error == null && bitmap != null) {
            imageView.setImageBitmap(bitmap);
            imageView.setTag(response.getRequest().getImageUri());
        }
    }
}
项目:WatsiAndroidApp    文件:GraphObjectAdapter.java   
private void processImageResponse(ImageResponse response, String graphObjectId, ImageView imageView) {
    pendingRequests.remove(graphObjectId);
    if (response.getError() != null) {
        callOnErrorListener(response.getError());
    }

    if (imageView == null) {
        // This was a pre-fetch request.
        if (response.getBitmap() != null) {
            // Is the cache too big?
            if (prefetchedPictureCache.size() >= MAX_PREFETCHED_PICTURES) {
                // Find the oldest one and remove it.
                String oldestId = prefetchedProfilePictureIds.remove(0);
                prefetchedPictureCache.remove(oldestId);
            }
            prefetchedPictureCache.put(graphObjectId, response);
        }
    } else if (graphObjectId.equals(imageView.getTag())) {
        Exception error = response.getError();
        Bitmap bitmap = response.getBitmap();
        if (error == null && bitmap != null) {
            imageView.setImageBitmap(bitmap);
            imageView.setTag(response.getRequest().getImageUri());
        }
    }
}
项目:WatsiAndroidApp    文件:UserSettingsFragment.java   
private ImageRequest getImageRequest() {
    ImageRequest request = null;
    try {
        ImageRequest.Builder requestBuilder = new ImageRequest.Builder(
                getActivity(),
                ImageRequest.getProfilePictureUrl(
                        user.getId(),
                        getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_width),
                        getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_height)));

        request = requestBuilder.setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(user.getId(), response);
                            }
                        })
                .build();
    } catch (URISyntaxException e) {
    }
    return request;
}
项目:Qtino.SharingKit    文件:GraphObjectAdapter.java   
private void processImageResponse(ImageResponse response, String graphObjectId, ImageView imageView) {
    pendingRequests.remove(graphObjectId);
    if (response.getError() != null) {
        callOnErrorListener(response.getError());
    }

    if (imageView == null) {
        // This was a pre-fetch request.
        if (response.getBitmap() != null) {
            // Is the cache too big?
            if (prefetchedPictureCache.size() >= MAX_PREFETCHED_PICTURES) {
                // Find the oldest one and remove it.
                String oldestId = prefetchedProfilePictureIds.remove(0);
                prefetchedPictureCache.remove(oldestId);
            }
            prefetchedPictureCache.put(graphObjectId, response);
        }
    } else if (graphObjectId.equals(imageView.getTag())) {
        Exception error = response.getError();
        Bitmap bitmap = response.getBitmap();
        if (error == null && bitmap != null) {
            imageView.setImageBitmap(bitmap);
            imageView.setTag(response.getRequest().getImageUri());
        }
    }
}
项目:smartenit    文件:GraphObjectAdapter.java   
private void processImageResponse(ImageResponse response, String graphObjectId, ImageView imageView) {
    pendingRequests.remove(graphObjectId);
    if (response.getError() != null) {
        callOnErrorListener(response.getError());
    }

    if (imageView == null) {
        // This was a pre-fetch request.
        if (response.getBitmap() != null) {
            // Is the cache too big?
            if (prefetchedPictureCache.size() >= MAX_PREFETCHED_PICTURES) {
                // Find the oldest one and remove it.
                String oldestId = prefetchedProfilePictureIds.remove(0);
                prefetchedPictureCache.remove(oldestId);
            }
            prefetchedPictureCache.put(graphObjectId, response);
        }
    } else if (graphObjectId.equals(imageView.getTag())) {
        Exception error = response.getError();
        Bitmap bitmap = response.getBitmap();
        if (error == null && bitmap != null) {
            imageView.setImageBitmap(bitmap);
            imageView.setTag(response.getRequest().getImageUri());
        }
    }
}
项目:smartenit    文件:UserSettingsFragment.java   
private ImageRequest getImageRequest() {
    ImageRequest request = null;
    try {
        ImageRequest.Builder requestBuilder = new ImageRequest.Builder(
                getActivity(),
                ImageRequest.getProfilePictureUrl(
                        user.getId(),
                        getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_width),
                        getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_height)));

        request = requestBuilder.setCallerTag(this)
                .setCallback(
                        new ImageRequest.Callback() {
                            @Override
                            public void onCompleted(ImageResponse response) {
                                processImageResponse(user.getId(), response);
                            }
                        })
                .build();
    } catch (URISyntaxException e) {
    }
    return request;
}
项目:localhost-android    文件:GraphObjectAdapter.java   
private void processImageResponse(ImageResponse response, String graphObjectId, ImageView imageView) {
    pendingRequests.remove(graphObjectId);
    if (response.getError() != null) {
        callOnErrorListener(response.getError());
    }

    if (imageView == null) {
        // This was a pre-fetch request.
        if (response.getBitmap() != null) {
            // Is the cache too big?
            if (prefetchedPictureCache.size() >= MAX_PREFETCHED_PICTURES) {
                // Find the oldest one and remove it.
                String oldestId = prefetchedProfilePictureIds.remove(0);
                prefetchedPictureCache.remove(oldestId);
            }
            prefetchedPictureCache.put(graphObjectId, response);
        }
    } else if (graphObjectId.equals(imageView.getTag())) {
        Exception error = response.getError();
        Bitmap bitmap = response.getBitmap();
        if (error == null && bitmap != null) {
            imageView.setImageBitmap(bitmap);
            imageView.setTag(response.getRequest().getImageUri());
        }
    }
}