public class ThumbnailRequestCoordinator extends Object implements RequestCoordinator, Request
Request
s that load a small thumbnail
version of an image and the full size version of the image at the same time.Constructor and Description |
---|
ThumbnailRequestCoordinator() |
ThumbnailRequestCoordinator(RequestCoordinator coordinator) |
Modifier and Type | Method and Description |
---|---|
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 full size image and if neither the full
nor the thumbnail image have completed successfully.
|
boolean |
canSetImage(Request request)
Returns true if the request is either the request loading the full size 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 |
isEquivalentTo(Request o)
|
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 put.
|
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) |
public ThumbnailRequestCoordinator()
public ThumbnailRequestCoordinator(RequestCoordinator coordinator)
public boolean canSetImage(Request request)
canSetImage
in interface RequestCoordinator
request
- The Request
requesting permission to display a bitmap.public boolean canNotifyStatusChanged(Request request)
canNotifyStatusChanged
in interface RequestCoordinator
request
- The Request
requesting permission to display a placeholder..public boolean isAnyResourceSet()
RequestCoordinator
Request
has successfully completed.isAnyResourceSet
in interface RequestCoordinator
Request.isComplete()
public void onRequestSuccess(Request request)
RequestCoordinator
onRequestSuccess
in interface RequestCoordinator
public void begin()
public void pause()
Request
Request.clear()
except that the request may later be restarted.public void clear()
public boolean isPaused()
Request
public boolean isRunning()
public boolean isComplete()
isComplete
in interface Request
public boolean isResourceSet()
Request
Request.isComplete()
} returns false.isResourceSet
in interface Request
public boolean isCancelled()
Request
isCancelled
in interface Request
public boolean isFailed()
public void recycle()
public boolean isEquivalentTo(Request o)
Request
true
if this Request
is equivalent to the given Request
(has
all of the same options and sizes).
This method is identical to #equals(Object)
except that it's specific to
Request
subclasses. We do not use #equals(Object)
directly because we track
Request
s in collections like Set
and it's perfectly legitimate to
have two different Request
objects for two different
Target
s (for example). Using a similar but different
method let's us selectively compare Request
objects to each other when it's useful in
specific scenarios.
isEquivalentTo
in interface Request