Lines Matching defs:imageView
30 import android.widget.ImageView;
39 * ImageView. It handles things like using a memory and disk cache, running the work in a background
64 * Load an image specified by the data parameter into an ImageView (override
70 * @param imageView The ImageView to bind the downloaded image to.
72 public void loadImage(Object data, ImageView imageView) {
74 imageView.setImageBitmap(mLoadingBitmap);
86 imageView.setImageBitmap(bitmap);
87 } else if (cancelPotentialWork(data, imageView)) {
88 final BitmapWorkerTask task = new BitmapWorkerTask(imageView);
91 imageView.setImageDrawable(asyncDrawable);
129 * {@link ImageLoader#loadImage(Object, ImageView)}
135 * Cancels any pending work attached to the provided ImageView.
137 public static void cancelWork(ImageView imageView) {
138 final BitmapWorkerTask bitmapWorkerTask = getBitmapWorkerTask(imageView);
154 public static boolean cancelPotentialWork(Object data, ImageView imageView) {
155 final BitmapWorkerTask bitmapWorkerTask = getBitmapWorkerTask(imageView);
173 * @param imageView Any imageView
174 * @return Retrieve the currently active work task (if any) associated with this imageView.
177 private static BitmapWorkerTask getBitmapWorkerTask(ImageView imageView) {
178 if (imageView != null) {
179 final Drawable drawable = imageView.getDrawable();
193 private final WeakReference<ImageView> imageViewReference;
195 public BitmapWorkerTask(ImageView imageView) {
196 imageViewReference = new WeakReference<ImageView>(imageView);
221 // If the task has not been cancelled by another thread and the ImageView that was
244 * Once the image is processed, associates it to the imageView
253 final ImageView imageView = getAttachedImageView();
254 if (bitmap != null && imageView != null) {
258 setImageBitmap(imageView, bitmap);
271 * Returns the ImageView associated with this task as long as the ImageView's task still
274 private ImageView getAttachedImageView() {
275 final ImageView imageView = imageViewReference.get();
276 final BitmapWorkerTask bitmapWorkerTask = getBitmapWorkerTask(imageView);
279 return imageView;
287 * A custom Drawable that will be attached to the imageView while the work is in progress.
307 * Called when the processing is complete and the final bitmap should be set on the ImageView.
309 * @param imageView The ImageView to set the bitmap to.
312 private void setImageBitmap(ImageView imageView, Bitmap bitmap) {
320 imageView.setBackgroundDrawable(imageView.getDrawable());
321 imageView.setImageDrawable(td);
324 imageView.setImageBitmap(bitmap);