Class ErrorRequestCoordinator

java.lang.Object
com.bumptech.glide.request.ErrorRequestCoordinator
All Implemented Interfaces:
Request, RequestCoordinator

public final class ErrorRequestCoordinator extends Object implements RequestCoordinator, Request
Runs a single primary Request until it completes and then a fallback error request only if the single primary request fails.
  • Constructor Details

  • Method Details

    • setRequests

      public void setRequests(Request primary, Request error)
    • begin

      public void begin()
      Description copied from interface: Request
      Starts an asynchronous load.
      Specified by:
      begin in interface Request
    • clear

      public void clear()
      Description copied from interface: Request
      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
    • pause

      public void pause()
      Description copied from interface: Request
      Similar to Request.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.

      Specified by:
      pause in interface Request
    • isRunning

      public boolean isRunning()
      Description copied from interface: Request
      Returns true if this request is running and has not completed or failed.
      Specified by:
      isRunning in interface Request
    • isComplete

      public boolean isComplete()
      Description copied from interface: Request
      Returns true if the request has completed successfully.
      Specified by:
      isComplete in interface Request
    • isCleared

      public boolean isCleared()
      Description copied from interface: Request
      Returns true if the request has been cleared.
      Specified by:
      isCleared in interface Request
    • isEquivalentTo

      public boolean isEquivalentTo(Request o)
      Description copied from interface: Request
      Returns true if this Request is equivalent to the given Request (has all of the same options and sizes).

      This method is identical to Object.equals(Object) except that it's specific to Request subclasses. We do not use Object.equals(Object) directly because we track Requests in collections like Set and it's perfectly legitimate to have two different Request objects for two different Targets (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.

      Specified by:
      isEquivalentTo in interface Request
    • canSetImage

      public boolean canSetImage(Request request)
      Description copied from interface: RequestCoordinator
      Returns true if the Request can display a loaded bitmap.
      Specified by:
      canSetImage in interface RequestCoordinator
      Parameters:
      request - The Request requesting permission to display a bitmap.
    • canNotifyStatusChanged

      public boolean canNotifyStatusChanged(Request request)
      Description copied from interface: RequestCoordinator
      Returns true if the Request can display a placeholder.
      Specified by:
      canNotifyStatusChanged in interface RequestCoordinator
      Parameters:
      request - The Request requesting permission to display a placeholder.
    • canNotifyCleared

      public boolean canNotifyCleared(Request request)
      Description copied from interface: RequestCoordinator
      Returns true if the Request can clear the Target.
      Specified by:
      canNotifyCleared in interface RequestCoordinator
    • isAnyResourceSet

      public boolean isAnyResourceSet()
      Description copied from interface: RequestCoordinator
      Returns true if any coordinated Request has successfully completed.
      Specified by:
      isAnyResourceSet in interface Request
      Specified by:
      isAnyResourceSet in interface RequestCoordinator
      See Also:
    • 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
    • onRequestFailed

      public void onRequestFailed(Request request)
      Description copied from interface: RequestCoordinator
      Must be called when a Request coordinated by this object fails.
      Specified by:
      onRequestFailed in interface RequestCoordinator
    • getRoot

      public RequestCoordinator getRoot()
      Description copied from interface: RequestCoordinator
      Returns the top most parent RequestCoordinator.
      Specified by:
      getRoot in interface RequestCoordinator