本文整理匯總了Java中com.facebook.internal.ImageResponse.getBitmap方法的典型用法代碼示例。如果您正苦於以下問題:Java ImageResponse.getBitmap方法的具體用法?Java ImageResponse.getBitmap怎麽用?Java ImageResponse.getBitmap使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.facebook.internal.ImageResponse
的用法示例。
在下文中一共展示了ImageResponse.getBitmap方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: processImageResponse
import com.facebook.internal.ImageResponse; //導入方法依賴的package包/類
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());
}
}
}
示例2: processResponse
import com.facebook.internal.ImageResponse; //導入方法依賴的package包/類
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);
}
}
}
}
示例3: processImageResponse
import com.facebook.internal.ImageResponse; //導入方法依賴的package包/類
private void processImageResponse(String id, ImageResponse response) {
if (response != null) {
Bitmap bitmap = response.getBitmap();
if (bitmap != null) {
BitmapDrawable drawable = new BitmapDrawable(UserSettingsFragment.this.getResources(), bitmap);
drawable.setBounds(0, 0,
getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_width),
getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_height));
userProfilePic = drawable;
userProfilePicID = id;
connectedStateLabel.setCompoundDrawables(null, drawable, null, null);
connectedStateLabel.setTag(response.getRequest().getImageUri());
}
}
}
示例4: processResponse
import com.facebook.internal.ImageResponse; //導入方法依賴的package包/類
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)
{
if (m_OnImageChangedEventListener != null)
{
responseImage =
m_OnImageChangedEventListener
.onImageChangedEventListener(responseImage);
}
setImageBitmap(responseImage);
if (response.isCachedRedirect())
{
sendImageRequest(false);
}
}
}
}