Class ImageViewTarget<Z>

    • Field Summary

      • Fields inherited from class com.bumptech.glide.request.target.ViewTarget

        view
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      android.graphics.drawable.Drawable getCurrentDrawable()
      Returns the current Drawable being displayed in the view using ImageView.getDrawable().
      void onLoadCleared​(android.graphics.drawable.Drawable placeholder)
      Sets the given Drawable on the view using ImageView.setImageDrawable(android.graphics.drawable.Drawable).
      void onLoadFailed​(android.graphics.drawable.Drawable errorDrawable)
      Sets the given Drawable on the view using ImageView.setImageDrawable(android.graphics.drawable.Drawable).
      void onLoadStarted​(android.graphics.drawable.Drawable placeholder)
      Sets the given Drawable on the view using ImageView.setImageDrawable(android.graphics.drawable.Drawable).
      void onResourceReady​(Z resource, Transition<? super Z> transition)
      The method that will be called when the resource load has finished.
      void onStart()
      Callback for when Fragment.onStart()} or Activity.onStart() is called.
      void onStop()
      Callback for when Fragment.onStop()} or Activity.onStop()} is called.
      void setDrawable​(android.graphics.drawable.Drawable drawable)
      Sets the given Drawable on the view using ImageView.setImageDrawable(android.graphics.drawable.Drawable).
      protected abstract void setResource​(Z resource)  
      • Methods inherited from class java.lang.Object

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

      • ImageViewTarget

        public ImageViewTarget​(android.widget.ImageView view)
      • ImageViewTarget

        @Deprecated
        public ImageViewTarget​(android.widget.ImageView view,
                               boolean waitForLayout)
        Deprecated.
    • Method Detail

      • getCurrentDrawable

        @Nullable
        public android.graphics.drawable.Drawable getCurrentDrawable()
        Returns the current Drawable being displayed in the view using ImageView.getDrawable().
        Specified by:
        getCurrentDrawable in interface Transition.ViewAdapter
      • setDrawable

        public void setDrawable​(android.graphics.drawable.Drawable drawable)
        Sets the given Drawable on the view using ImageView.setImageDrawable(android.graphics.drawable.Drawable).
        Specified by:
        setDrawable in interface Transition.ViewAdapter
        Parameters:
        drawable - The drawable to display in the wrapped view.
      • onLoadStarted

        public void onLoadStarted​(@Nullable
                                  android.graphics.drawable.Drawable placeholder)
        Sets the given Drawable on the view using ImageView.setImageDrawable(android.graphics.drawable.Drawable).
        Specified by:
        onLoadStarted in interface Target<Z>
        Overrides:
        onLoadStarted in class ViewTarget<android.widget.ImageView,​Z>
        Parameters:
        placeholder - The placeholder drawable to optionally show, or null.
      • onLoadFailed

        public void onLoadFailed​(@Nullable
                                 android.graphics.drawable.Drawable errorDrawable)
        Sets the given Drawable on the view using ImageView.setImageDrawable(android.graphics.drawable.Drawable).
        Specified by:
        onLoadFailed in interface Target<Z>
        Overrides:
        onLoadFailed in class BaseTarget<Z>
        Parameters:
        errorDrawable - The error drawable to optionally show, or null.
      • onLoadCleared

        public void onLoadCleared​(@Nullable
                                  android.graphics.drawable.Drawable placeholder)
        Sets the given Drawable on the view using ImageView.setImageDrawable(android.graphics.drawable.Drawable).
        Specified by:
        onLoadCleared in interface Target<Z>
        Overrides:
        onLoadCleared in class ViewTarget<android.widget.ImageView,​Z>
        Parameters:
        placeholder - The placeholder drawable to optionally show, or null.
      • onResourceReady

        public void onResourceReady​(@NonNull
                                    Z resource,
                                    @Nullable
                                    Transition<? super Z> transition)
        Description copied from interface: Target
        The method that will be called when the resource load has finished.
        Specified by:
        onResourceReady in interface Target<Z>
        Parameters:
        resource - the loaded resource.
      • setResource

        protected abstract void setResource​(@Nullable
                                            Z resource)