com.bumptech.glide.request
Class ThumbnailRequestCoordinator

java.lang.Object
  extended by com.bumptech.glide.request.ThumbnailRequestCoordinator
All Implemented Interfaces:
Request, RequestCoordinator

public class ThumbnailRequestCoordinator
extends Object
implements RequestCoordinator, Request

A coordinator that coordinates two individual Requests that load a small thumbnail version of an image and the full size version of the image at the same time.


Constructor Summary
ThumbnailRequestCoordinator()
           
ThumbnailRequestCoordinator(RequestCoordinator coordinator)
           
 
Method Summary
 void begin()
          Starts first the thumb request and then the full request.
 boolean canNotifyStatusChanged(Request request)
          Returns true if the request is the request loading the fullsize image and if neither the full nor the thumbnail image have completed sucessfully.
 boolean canSetImage(Request request)
          Returns true if the request is either the request loading the fullsize image or if the request loading the full size image has not yet completed.
 void clear()
          Prevents any bitmaps being loaded from previous requests, releases any resources held by this request, displays the current placeholder if one was provided, and marks the request as having been cancelled.
 boolean isAnyResourceSet()
          Returns true if any coordinated Request has successfully completed.
 boolean isCancelled()
          Returns true if the request has been cancelled.
 boolean isComplete()
          Returns true if the full request is complete.
 boolean isFailed()
          Returns true if the full request has failed.
 boolean isPaused()
          Returns true if this request is paused and may be restarted.
 boolean isResourceSet()
          Returns true if a non-placeholder resource is set.
 boolean isRunning()
          Returns true if the full request is still running.
 void onRequestSuccess(Request request)
          Must be called when a request coordinated by this object completes successfully.
 void pause()
          Identical to Request.clear() except that the request may later be restarted.
 void recycle()
          Recycles the request object and releases its resources.
 void setRequests(Request full, Request thumb)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThumbnailRequestCoordinator

public ThumbnailRequestCoordinator()

ThumbnailRequestCoordinator

public ThumbnailRequestCoordinator(RequestCoordinator coordinator)
Method Detail

setRequests

public void setRequests(Request full,
                        Request thumb)

canSetImage

public boolean canSetImage(Request request)
Returns true if the request is either the request loading the fullsize image or if the request loading the full size image has not yet completed.

Specified by:
canSetImage in interface RequestCoordinator
Parameters:
request - The Request requesting permission to display a bitmap.

canNotifyStatusChanged

public boolean canNotifyStatusChanged(Request request)
Returns true if the request is the request loading the fullsize image and if neither the full nor the thumbnail image have completed sucessfully.

Specified by:
canNotifyStatusChanged in interface RequestCoordinator
Parameters:
request - The Request requesting permission to display a placeholder..

isAnyResourceSet

public boolean isAnyResourceSet()
Description copied from interface: RequestCoordinator
Returns true if any coordinated Request has successfully completed.

Specified by:
isAnyResourceSet in interface RequestCoordinator
See Also:
Request.isComplete()

onRequestSuccess

public void onRequestSuccess(Request request)
Description copied from interface: RequestCoordinator
Must be called when a request coordinated by this object completes successfully.

Specified by:
onRequestSuccess in interface RequestCoordinator

begin

public void begin()
Starts first the thumb request and then the full request.

Specified by:
begin in interface Request

pause

public void pause()
Description copied from interface: Request
Identical to Request.clear() except that the request may later be restarted.

Specified by:
pause in interface Request

clear

public void clear()
Prevents any bitmaps being loaded from previous requests, releases any resources held by this request, displays the current placeholder if one was provided, and marks the request as having been cancelled.

Specified by:
clear in interface Request

isPaused

public boolean isPaused()
Description copied from interface: Request
Returns true if this request is paused and may be restarted.

Specified by:
isPaused in interface Request

isRunning

public boolean isRunning()
Returns true if the full request is still running.

Specified by:
isRunning in interface Request

isComplete

public boolean isComplete()
Returns true if the full request is complete.

Specified by:
isComplete in interface Request

isResourceSet

public boolean isResourceSet()
Description copied from interface: Request
Returns true if a non-placeholder resource is set. For Requests that load more than one resource, isResourceSet may return true even if Request.isComplete()} returns false.

Specified by:
isResourceSet in interface Request

isCancelled

public boolean isCancelled()
Description copied from interface: Request
Returns true if the request has been cancelled.

Specified by:
isCancelled in interface Request

isFailed

public boolean isFailed()
Returns true if the full request has failed.

Specified by:
isFailed in interface Request

recycle

public void recycle()
Recycles the request object and releases its resources..

Specified by:
recycle in interface Request