From d024ea725c33b029981e02cf331e2afb73175b24 Mon Sep 17 00:00:00 2001 From: Sam Judd Date: Tue, 20 Jun 2017 07:13:13 -0700 Subject: [PATCH] Update the documentation in RequestListener. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RequestListener is called before Targets so that it has the option of overriding the Target’s behavior. #2053 --- .../com/bumptech/glide/request/RequestListener.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/library/src/main/java/com/bumptech/glide/request/RequestListener.java b/library/src/main/java/com/bumptech/glide/request/RequestListener.java index 0644473d26..a6156b495f 100644 --- a/library/src/main/java/com/bumptech/glide/request/RequestListener.java +++ b/library/src/main/java/com/bumptech/glide/request/RequestListener.java @@ -1,5 +1,6 @@ package com.bumptech.glide.request; +import android.graphics.drawable.Drawable; import android.support.annotation.Nullable; import com.bumptech.glide.load.DataSource; import com.bumptech.glide.load.engine.GlideException; @@ -13,9 +14,10 @@ public interface RequestListener { /** - * Called when an exception occurs during a load. Will only be called if we currently want to - * display an image for the given model in the given target. It is recommended to create a single - * instance per activity/fragment rather than instantiate a new object for each call to {@code + * Called when an exception occurs during a load, immediately before + * {@link Target#onLoadFailed(Drawable)}. Will only be called if we currently want to display an + * image for the given model in the given target. It is recommended to create a single instance + * per activity/fragment rather than instantiate a new object for each call to {@code * Glide.load()} to avoid object churn. * *

It is safe to reload this or a different model or change what is displayed in the target at @@ -31,7 +33,7 @@ public interface RequestListener { *

* *

Note - if you want to reload this or any other model after an exception, you will need to - * include all relevant builder calls (like centerCrop, placeholder etc).

+ * include all relevant builder calls (like centerCrop, placeholder etc). * * @param e The maybe {@code null} exception containing information about why the * request failed. @@ -45,7 +47,7 @@ boolean onLoadFailed(@Nullable GlideException e, Object model, Target target, boolean isFirstResource); /** - * Called when a load completes successfully, immediately after {@link + * Called when a load completes successfully, immediately before {@link * Target#onResourceReady(Object, com.bumptech.glide.request.transition.Transition)}. * * @param resource The resource that was loaded for the target.