Home | History | Annotate | Download | only in contacts

Lines Matching refs:request

160      * it is displayed immediately.  Otherwise a request is sent to load the photo
176 * it is displayed immediately. Otherwise a request is sent to load the photo
209 * Remove photo from the supplied image view. This also cancels current pending load request
328 * A map from ImageView to the corresponding photo ID or uri, encapsulated in a request.
329 * The request may swapped out before the photo loading request is started.
331 private final ConcurrentHashMap<ImageView, Request> mPendingRequests =
332 new ConcurrentHashMap<ImageView, Request>();
341 * the first request.
480 if (DEBUG) Log.d(TAG, "loadPhoto request: " + photoId);
481 loadPhotoByIdOrUri(view, Request.createFromThumbnailId(photoId, darkTheme,
494 if (DEBUG) Log.d(TAG, "loadPhoto request: " + photoUri);
495 loadPhotoByIdOrUri(view, Request.createFromUri(photoUri, requestedExtent, darkTheme,
500 private void loadPhotoByIdOrUri(ImageView view, Request request) {
501 boolean loaded = loadCachedPhoto(view, request, false);
505 mPendingRequests.put(view, request);
507 // Send a request to start loading photos
537 private boolean loadCachedPhoto(ImageView view, Request request, boolean fadeIn) {
538 BitmapHolder holder = mBitmapHolderCache.get(request.getKey());
541 request.applyDefaultImage(view);
546 request.applyDefaultImage(view);
554 inflateBitmap(holder, request.getRequestedExtent());
560 request.applyDefaultImage(view);
588 mBitmapCache.put(request.getKey(), cachedBitmap);
677 * to request their respective photos before any of those requests are executed.
722 * photos still haven't been loaded, sends another request for image loading.
728 Request key = mPendingRequests.get(view);
787 Request request = Request.createFromUri(photoUri, smallerExtent, false, DEFAULT_AVATAR);
790 mBitmapHolderCache.put(request.getKey(), holder);
792 mBitmapCache.put(request.getKey(), bitmap);
800 Set<String> photoIdsAsStrings, Set<Request> uris) {
815 Iterator<Request> iterator = mPendingRequests.values().iterator();
817 Request request = iterator.next();
818 final BitmapHolder holder = mBitmapHolderCache.get(request.getKey());
822 inflateBitmap(holder, request.getRequestedExtent());
826 if (request.isUriRequest()) {
827 uris.add(request);
829 photoIds.add(request.getId());
830 photoIdsAsStrings.add(String.valueOf(request.mId));
867 private final Set<Request> mPhotoUris = Sets.newHashSet();
913 * request, if any: we don't want preloading to impede loading of the photos
1110 for (Request uriRequest : mPhotoUris) {
1147 private static final class Request {
1154 private Request(long id, Uri uri, int requestedExtent, boolean darkTheme,
1163 public static Request createFromThumbnailId(long id, boolean darkTheme,
1165 return new Request(id, null /* no URI */, -1, darkTheme, defaultProvider);
1168 public static Request createFromUri(Uri uri, int requestedExtent, boolean darkTheme,
1170 return new Request(0 /* no ID */, uri, requestedExtent, darkTheme, defaultProvider);
1204 final Request that = (Request) obj;
1210 // regardless of mDarkTheme, so we shouldn't need to put the photo request on the queue