Class BaseTarget<Z>

  • Type Parameters:
    Z - The type of resource that will be received by this target.
    All Implemented Interfaces:
    LifecycleListener, Target<Z>
    Direct Known Subclasses:
    SimpleTarget, ViewTarget

    @Deprecated
    public abstract class BaseTarget<Z>
    extends java.lang.Object
    implements Target<Z>
    Deprecated.
    Use CustomViewTarget if loading the content into a view, the download API if in the background (http://bumptech.github.io/glide/doc/getting-started.html#background-threads), or a a fully implemented Target for any specialized use-cases. Using BaseView is unsafe if the user does not implement onLoadCleared(android.graphics.drawable.Drawable), resulting in recycled bitmaps being referenced from the UI and hard to root-cause crashes.
    A base Target for loading Resources that provides basic or empty implementations for most methods.

    For maximum efficiency, clear this target when you have finished using or displaying the Resource loaded into it using RequestManager.clear(Target).

    For loading Resources into Views, ViewTarget or ImageViewTarget are preferable.

    • Constructor Summary

      Constructors 
      Constructor Description
      BaseTarget()
      Deprecated.
       
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      Request getRequest()
      Deprecated.
      Retrieves the current request for this target, should not be called outside of Glide.
      void onDestroy()
      Deprecated.
      Callback for when Fragment.onDestroy()} or Activity.onDestroy() is called.
      void onLoadCleared​(android.graphics.drawable.Drawable placeholder)
      Deprecated.
      A mandatory lifecycle callback that is called when a load is cancelled and its resources are freed.
      void onLoadFailed​(android.graphics.drawable.Drawable errorDrawable)
      Deprecated.
      A mandatory lifecycle callback that is called when a load fails.
      void onLoadStarted​(android.graphics.drawable.Drawable placeholder)
      Deprecated.
      A lifecycle callback that is called when a load is started.
      void onStart()
      Deprecated.
      Callback for when Fragment.onStart()} or Activity.onStart() is called.
      void onStop()
      Deprecated.
      Callback for when Fragment.onStop()} or Activity.onStop()} is called.
      void setRequest​(Request request)
      Deprecated.
      Sets the current request for this target to retain, should not be called outside of Glide.
      • Methods inherited from class java.lang.Object

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

      • BaseTarget

        public BaseTarget()
        Deprecated.
    • Method Detail

      • setRequest

        public void setRequest​(@Nullable
                               Request request)
        Deprecated.
        Description copied from interface: Target
        Sets the current request for this target to retain, should not be called outside of Glide.
        Specified by:
        setRequest in interface Target<Z>
      • getRequest

        @Nullable
        public Request getRequest()
        Deprecated.
        Description copied from interface: Target
        Retrieves the current request for this target, should not be called outside of Glide.
        Specified by:
        getRequest in interface Target<Z>
      • onLoadCleared

        public void onLoadCleared​(@Nullable
                                  android.graphics.drawable.Drawable placeholder)
        Deprecated.
        Description copied from interface: Target
        A mandatory lifecycle callback that is called when a load is cancelled and its resources are freed.

        You must ensure that any current Drawable received in Target.onResourceReady(Object, Transition) is no longer used before redrawing the container (usually a View) or changing its visibility.

        Specified by:
        onLoadCleared in interface Target<Z>
        Parameters:
        placeholder - The placeholder drawable to optionally show, or null.
      • onLoadStarted

        public void onLoadStarted​(@Nullable
                                  android.graphics.drawable.Drawable placeholder)
        Deprecated.
        Description copied from interface: Target
        A lifecycle callback that is called when a load is started.

        Note - This may not be called for every load, it is possible for example for loads to fail before the load starts (when the model object is null).

        Note - This method may be called multiple times before any other lifecycle method is called. Loads can be paused and restarted due to lifecycle or connectivity events and each restart may cause a call here.

        Specified by:
        onLoadStarted in interface Target<Z>
        Parameters:
        placeholder - The placeholder drawable to optionally show, or null.
      • onLoadFailed

        public void onLoadFailed​(@Nullable
                                 android.graphics.drawable.Drawable errorDrawable)
        Deprecated.
        Description copied from interface: Target
        A mandatory lifecycle callback that is called when a load fails.

        Note - This may be called before Target.onLoadStarted(android.graphics.drawable.Drawable) if the model object is null.

        You must ensure that any current Drawable received in Target.onResourceReady(Object, Transition) is no longer used before redrawing the container (usually a View) or changing its visibility.

        Specified by:
        onLoadFailed in interface Target<Z>
        Parameters:
        errorDrawable - The error drawable to optionally show, or null.
      • onStart

        public void onStart()
        Deprecated.
        Description copied from interface: LifecycleListener
        Callback for when Fragment.onStart()} or Activity.onStart() is called.
        Specified by:
        onStart in interface LifecycleListener
      • onStop

        public void onStop()
        Deprecated.
        Description copied from interface: LifecycleListener
        Callback for when Fragment.onStop()} or Activity.onStop()} is called.
        Specified by:
        onStop in interface LifecycleListener
      • onDestroy

        public void onDestroy()
        Deprecated.
        Description copied from interface: LifecycleListener
        Callback for when Fragment.onDestroy()} or Activity.onDestroy() is called.
        Specified by:
        onDestroy in interface LifecycleListener