Skip to content

Commit

Permalink
Update the documentation in RequestListener.
Browse files Browse the repository at this point in the history
RequestListener is called before Targets so that
it has the option of overriding the Target’s 
behavior.

bumptech#2053
  • Loading branch information
sjudd committed Jun 20, 2017
1 parent 7049ace commit d024ea7
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -13,9 +14,10 @@
public interface RequestListener<R> {

/**
* 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.
*
* <p> It is safe to reload this or a different model or change what is displayed in the target at
Expand All @@ -31,7 +33,7 @@ public interface RequestListener<R> {
* </p>
*
* <p> 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). </p>
* include all relevant builder calls (like centerCrop, placeholder etc).
*
* @param e The maybe {@code null} exception containing information about why the
* request failed.
Expand All @@ -45,7 +47,7 @@ boolean onLoadFailed(@Nullable GlideException e, Object model, Target<R> 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.
Expand Down

0 comments on commit d024ea7

Please sign in to comment.