/** * Load an image from a url into an ImageView using the default placeholder * drawable if available. * @param url The web URL of an image. * @param imageView The target ImageView to load the image into. * @param requestListener A listener to monitor the request result. * @param placeholderOverride A drawable to use as a placeholder for this specific image. * If this parameter is present, {@link #mPlaceHolderResId} * if ignored for this request. */ public void loadImage(String url, ImageView imageView, RequestListener<String> requestListener, Drawable placeholderOverride, boolean crop) { BitmapRequestBuilder request = beginImageLoad(url, requestListener, crop) .animate(com.saarang.samples.apps.iosched.R.anim.image_fade_in); if (placeholderOverride != null) { request.placeholder(placeholderOverride); } else if (mPlaceHolderResId != -1) { request.placeholder(mPlaceHolderResId); } request.into(imageView); }
public BitmapRequestBuilder beginImageLoad(String url, RequestListener<String> requestListener, boolean crop) { return mGlideModelRequest.load(url) .asBitmap() // don't allow animated GIFs .listener(requestListener) .transform(crop ? mCenterCrop : mNone); }
/** * Load an image from a url into an ImageView using the default placeholder * drawable if available. * @param url The web URL of an image. * @param imageView The target ImageView to load the image into. * @param requestListener A listener to monitor the request result. * @param placeholderOverride A drawable to use as a placeholder for this specific image. * If this parameter is present, {@link #mPlaceHolderResId} * if ignored for this request. */ public void loadImage(String url, ImageView imageView, RequestListener<String> requestListener, Drawable placeholderOverride, boolean crop) { BitmapRequestBuilder request = beginImageLoad(url, requestListener, crop) .animate(R.anim.image_fade_in); if (placeholderOverride != null) { request.placeholder(placeholderOverride); } else if (mPlaceHolderResId != -1) { request.placeholder(mPlaceHolderResId); } request.into(imageView); }
/** * Load an image from a url into an ImageView using the default placeholder * drawable if available. * @param url The web URL of an image. * @param imageView The target ImageView to load the image into. * @param requestListener A listener to monitor the request result. * @param placeholderOverride A drawable to use as a placeholder for this specific image. * If this parameter is present, {@link #mPlaceHolderResId} * if ignored for this request. */ public void loadImage(String url, ImageView imageView, RequestListener<String> requestListener, Drawable placeholderOverride, boolean crop) { DrawableRequestBuilder<String> request = beginImageLoad(url, requestListener, crop) .animate(R.anim.image_fade_in); if (placeholderOverride != null) { request.placeholder(placeholderOverride); } else if (mPlaceHolderResId != -1) { request.placeholder(mPlaceHolderResId); } request.into(imageView); }
@Override public DrawableRequestBuilder<ModelType> listener( RequestListener<ModelType> requestListener) { super.listener(requestListener); return this; }
@Override public BitmapRequestBuilder<ModelType, TranscodeType> listener(RequestListener<ModelType> requestListener) { super.listener(requestListener); return this; }
public DrawableRequestBuilder<String> beginImageLoad(String url, RequestListener<String> requestListener, boolean crop) { return mGlideModelRequest.load(url) .listener(requestListener) .bitmapTransform(crop ? mCenterCrop : mNone); }
/** * Sets a RequestBuilder listener to monitor the image load. It's best to create a single instance of an * exception handler per type of request (usually activity/fragment) rather than pass one in per request to * avoid some redundant object allocation. * * @param requestListener The request listener to use. * @return This RequestBuilder. */ public GenericRequestBuilder<ModelType, DataType, ResourceType, TranscodeType> listener( RequestListener<ModelType> requestListener) { this.requestListener = requestListener; return this; }
/** * Load an image from a url into an ImageView using the default placeholder * drawable if available. * @param url The web URL of an image. * @param imageView The target ImageView to load the image into. * @param requestListener A listener to monitor the request result. */ public void loadImage(String url, ImageView imageView, RequestListener<String> requestListener) { loadImage(url, imageView, requestListener, null, false); }
/** * Load an image from a url into an ImageView using the given placeholder drawable. * * @param url The web URL of an image. * @param imageView The target ImageView to load the image into. * @param requestListener A listener to monitor the request result. * @param placholderOverride A placeholder to use in place of the default placholder. */ public void loadImage(String url, ImageView imageView, RequestListener<String> requestListener, Drawable placholderOverride) { loadImage(url, imageView, requestListener, placholderOverride, false /*crop*/); }