/** * Returns any stored request using {@link android.view.View#getTag()}. * * <p> For Glide to function correctly, Glide must be the only thing that calls {@link * View#setTag(Object)}. If the tag is cleared or put to another object type, Glide will not be * able to retrieve and cancel previous loads which will not only prevent Glide from reusing * resource, but will also result in incorrect images being loaded and lots of flashing of images * in lists. As a result, this will throw an {@link java.lang.IllegalArgumentException} if {@link * android.view.View#getTag()}} returns a non null object that is not an {@link * com.bumptech.glide.request.Request}. </p> */ @Override @Nullable public Request getRequest() { Object tag = getTag(); Request request = null; if (tag != null) { if (tag instanceof Request) { request = (Request) tag; } else { throw new IllegalArgumentException( "You must not call setTag() on a view Glide is targeting"); } } return request; }
/** * Returns any stored request using {@link View#getTag()}. * * <p> * For Glide to function correctly, Glide must be the only thing that calls {@link View#setTag(Object)}. If the * tag is cleared or set to another object type, Glide will not be able to retrieve and cancel previous loads * which will not only prevent Glide from reusing resource, but will also result in incorrect images being * loaded and lots of flashing of images in lists. As a result, this will throw an * {@link IllegalArgumentException} if {@link View#getTag()}} returns a non null object * that is not an {@link Request}. * </p> */ @Override public Request getRequest() { Object tag = getTag(); Request request = null; if (tag != null) { if (tag instanceof Request) { request = (Request) tag; } else { throw new IllegalArgumentException("You must not call setTag() on a view Glide is targeting"); } } return request; }
/** * Returns any stored request using {@link android.view.View#getTag()}. * * <p> For Glide to function correctly, Glide must be the only thing that calls {@link * View#setTag(Object)}. If the tag is cleared or put to another object type, Glide will not be * able to retrieve and cancel previous loads which will not only prevent Glide from reusing * resource, but will also result in incorrect images being loaded and lots of flashing of images * in lists. As a result, this will throw an {@link java.lang.IllegalArgumentException} if {@link * android.view.View#getTag()}} returns a non null object that is not an {@link * com.bumptech.glide.request.Request}. </p> */ @Override @Nullable public Request getRequest() { Object tag = getTag(); Request request = null; if (tag != null) { if (tag instanceof Request) { request = (Request) tag; } else { throw new IllegalArgumentException( "You must not call setTag() on a view Glide is targeting"); } } return request; }