當前位置: 首頁>>代碼示例>>Java>>正文


Java ImageResponse.getBitmap方法代碼示例

本文整理匯總了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());
        }
    }
}
 
開發者ID:MobileDev418,項目名稱:AndroidBackendlessChat,代碼行數:27,代碼來源:GraphObjectAdapter.java

示例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);
            }
        }
    }
}
 
開發者ID:yeloapp,項目名稱:yelo-android,代碼行數:26,代碼來源:ProfilePictureView.java

示例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());
        }
    }
}
 
開發者ID:MobileDev418,項目名稱:AndroidBackendlessChat,代碼行數:16,代碼來源:UserSettingsFragment.java

示例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);
			}
		}
	}
}
 
開發者ID:netanelkl,項目名稱:guitar_guy,代碼行數:44,代碼來源:ProfilePictureView.java


注:本文中的com.facebook.internal.ImageResponse.getBitmap方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。