Package 

Class SingleRequest

    • Method Summary

      Modifier and Type Method Description
      static <R> SingleRequest<R> obtain(Context context, ImageContext imageContext, Object requestLock, Object model, Class<R> transcodeClass, BaseRequestOptions<out Object> requestOptions, int overrideWidth, int overrideHeight, Priority priority, Target<R> target, RequestListener<R> targetListener, @Nullable() List<RequestListener<R>> requestListeners, RequestCoordinator requestCoordinator, Engine engine, TransitionFactory<out Object> animationFactory, Executor callbackExecutor)
      void begin() Starts an asynchronous load.
      void clear() Cancels the current load if it is in progress, clears any resources held onto by the requestand replaces the loaded resource if the load completed with the placeholder.
      void pause() Similar to clear for in progress requests (or portions of a request), but does nothingif the request is already complete.
      boolean isRunning() Returns true if this request is running and has not completed or failed.
      boolean isComplete() Returns true if the request has completed successfully.
      boolean isCleared() Returns true if the request has been cleared.
      boolean isAnyResourceSet() Returns true if a resource is set, even if the request is not yet complete or the primaryrequest has failed.
      void onSizeReady(int width, int height) A callback method that should never be invoked directly.
      void onResourceReady(Resource<out Object> resource, DataSource dataSource, boolean isLoadedFromAlternateCacheKey) A callback method that should never be invoked directly.
      void onLoadFailed(ImageModuleException e) A callback method that should never be invoked directly.
      Object getLock() Returns the lock to use when notifying individual requests.
      boolean isEquivalentTo(Request o) Returns {@code true} if this Request is equivalent to the given Request (hasall of the same options and sizes).
      • Methods inherited from class com.mobwith.imgmodule.request.Request

        isEquivalentTo
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • begin

         void begin()

        Starts an asynchronous load.

      • clear

         void clear()

        Cancels the current load if it is in progress, clears any resources held onto by the requestand replaces the loaded resource if the load completed with the placeholder.

        Cleared requests can be restarted with a subsequent call to begin

      • pause

         void pause()

        Similar to clear for in progress requests (or portions of a request), but does nothingif the request is already complete.

        Unlike clear, this method allows implementations to act differently on subpartsof a request. For example if a Request has both a thumbnail and a primary request and thethumbnail portion of the request is complete, this method allows only the primary portion ofthe request to be paused without clearing the previously completed thumbnail portion.

      • isRunning

         boolean isRunning()

        Returns true if this request is running and has not completed or failed.

      • isComplete

         boolean isComplete()

        Returns true if the request has completed successfully.

      • isCleared

         boolean isCleared()

        Returns true if the request has been cleared.

      • isAnyResourceSet

         boolean isAnyResourceSet()

        Returns true if a resource is set, even if the request is not yet complete or the primaryrequest has failed.

      • onSizeReady

         void onSizeReady(int width, int height)

        A callback method that should never be invoked directly.

      • getLock

         Object getLock()

        Returns the lock to use when notifying individual requests.

      • isEquivalentTo

         boolean isEquivalentTo(Request o)

        Returns {@code true} if this Request is equivalent to the given Request (hasall of the same options and sizes).

        This method is identical to equals except that it's specific to Request subclasses. We do not use equals directly because wetrack Requests in collections like java.util.Set and it's perfectly legitimateto have two different Request objects for two different s (for example). Using a similar but different methodlet's us selectively compare Request objects to each other when it's useful in specificscenarios.