Class ErrorRequestCoordinator
- All Implemented Interfaces:
Request,RequestCoordinator
Request until it completes and then a fallback error request only
if the single primary request fails.-
Nested Class Summary
Nested classes/interfaces inherited from interface com.bumptech.glide.request.RequestCoordinator
RequestCoordinator.RequestState -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbegin()Starts an asynchronous load.booleancanNotifyCleared(Request request) booleancanNotifyStatusChanged(Request request) Returns true if theRequestcan display a placeholder.booleancanSetImage(Request request) Returns true if theRequestcan display a loaded bitmap.voidclear()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.getRoot()Returns the top most parentRequestCoordinator.booleanReturns true if any coordinatedRequesthas successfully completed.booleanReturns true if the request has been cleared.booleanReturns true if the request has completed successfully.booleanbooleanReturns true if this request is running and has not completed or failed.voidonRequestFailed(Request request) Must be called when aRequestcoordinated by this object fails.voidonRequestSuccess(Request request) Must be called when aRequestcoordinated by this object completes successfully.voidpause()Similar toRequest.clear()for in progress requests (or portions of a request), but does nothing if the request is already complete.voidsetRequests(Request primary, Request error)
-
Constructor Details
-
ErrorRequestCoordinator
-
-
Method Details
-
setRequests
-
begin
public void begin()Description copied from interface:RequestStarts an asynchronous load. -
clear
public void clear()Description copied from interface:RequestPrevents 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. -
pause
public void pause()Description copied from interface:RequestSimilar toRequest.clear()for in progress requests (or portions of a request), but does nothing if the request is already complete.Unlike
Request.clear(), this method allows implementations to act differently on subparts of a request. For example if a Request has both a thumbnail and a primary request and the thumbnail portion of the request is complete, this method allows only the primary portion of the request to be paused without clearing the previously completed thumbnail portion. -
isRunning
public boolean isRunning()Description copied from interface:RequestReturns true if this request is running and has not completed or failed. -
isComplete
public boolean isComplete()Description copied from interface:RequestReturns true if the request has completed successfully.- Specified by:
isCompletein interfaceRequest
-
isCleared
public boolean isCleared()Description copied from interface:RequestReturns true if the request has been cleared. -
isEquivalentTo
Description copied from interface:RequestReturnstrueif thisRequestis equivalent to the givenRequest(has all of the same options and sizes).This method is identical to
Object.equals(Object)except that it's specific toRequestsubclasses. We do not useObject.equals(Object)directly because we trackRequests in collections likeSetand it's perfectly legitimate to have two differentRequestobjects for two differentTargets (for example). Using a similar but different method let's us selectively compareRequestobjects to each other when it's useful in specific scenarios.- Specified by:
isEquivalentToin interfaceRequest
-
canSetImage
Description copied from interface:RequestCoordinatorReturns true if theRequestcan display a loaded bitmap.- Specified by:
canSetImagein interfaceRequestCoordinator- Parameters:
request- TheRequestrequesting permission to display a bitmap.
-
canNotifyStatusChanged
Description copied from interface:RequestCoordinatorReturns true if theRequestcan display a placeholder.- Specified by:
canNotifyStatusChangedin interfaceRequestCoordinator- Parameters:
request- TheRequestrequesting permission to display a placeholder.
-
canNotifyCleared
Description copied from interface:RequestCoordinator- Specified by:
canNotifyClearedin interfaceRequestCoordinator
-
isAnyResourceSet
public boolean isAnyResourceSet()Description copied from interface:RequestCoordinatorReturns true if any coordinatedRequesthas successfully completed.- Specified by:
isAnyResourceSetin interfaceRequest- Specified by:
isAnyResourceSetin interfaceRequestCoordinator- See Also:
-
onRequestSuccess
Description copied from interface:RequestCoordinatorMust be called when aRequestcoordinated by this object completes successfully.- Specified by:
onRequestSuccessin interfaceRequestCoordinator
-
onRequestFailed
Description copied from interface:RequestCoordinatorMust be called when aRequestcoordinated by this object fails.- Specified by:
onRequestFailedin interfaceRequestCoordinator
-
getRoot
Description copied from interface:RequestCoordinatorReturns the top most parentRequestCoordinator.- Specified by:
getRootin interfaceRequestCoordinator
-