Example usage for android.widget ImageView getDrawable

List of usage examples for android.widget ImageView getDrawable

Introduction

In this page you can find the example usage for android.widget ImageView getDrawable.

Prototype

public Drawable getDrawable() 

Source Link

Document

Gets the current Drawable, or null if no Drawable has been assigned.

Usage

From source file:de.s2hmobile.bitmaps.ImageLoader.java

/**
 * Retrieves the currently active work task (if any) associated with this
 * view. Returns null if there is no such task.
 *///from w ww  .j ava  2  s .c  o  m
protected static BitmapWorkerTask getBitmapWorkerTask(final ImageView imageView) {
    if (imageView == null) {
        return null;
    }

    final Drawable drawable = imageView.getDrawable();
    if (!(drawable instanceof AsyncDrawable)) {
        return null;
    }

    final AsyncDrawable placeHolder = (AsyncDrawable) drawable;
    return placeHolder.getBitmapWorkerTask();
}

From source file:org.everyuse.android.util.ImageDownloader.java

/**
 * @param imageView Any imageView//  ww  w .j a  v  a2s  .co m
 * @return Retrieve the currently active download task (if any) associated with this imageView.
 * null if there is no such task.
 */
private static BitmapDownloaderTask getBitmapDownloaderTask(ImageView imageView) {
    if (imageView != null) {
        Drawable drawable = imageView.getDrawable();
        if (drawable instanceof DownloadedDrawable) {
            DownloadedDrawable downloadedDrawable = (DownloadedDrawable)drawable;
            return downloadedDrawable.getBitmapDownloaderTask();
        }
    }
    return null;
}

From source file:net.archenemy.archenemyapp.presenter.BitmapUtility.java

private static BitmapFromUrlTask getBitmapWorkerTask(ImageView imageView) {
    if (imageView != null) {
        final Drawable drawable = imageView.getDrawable();
        if (drawable instanceof AsyncDrawable) {
            final AsyncDrawable asyncDrawable = (AsyncDrawable) drawable;
            return asyncDrawable.getAsyncTask();
        }/*from   ww  w  .  j  a  v a  2 s .  c o  m*/
    }
    return null;
}

From source file:adapters.images.ImageDownloader.java

/**
 * @param imageView Any imageView//  w w  w.  j  a v  a2 s. c om
 * @return Retrieve the currently active download task (if any) associated with this imageView.
 * null if there is no such task.
 */
private static BitmapDownloaderTask getBitmapDownloaderTask(ImageView imageView) {
    if (imageView != null) {
        Drawable drawable = imageView.getDrawable();
        if (drawable instanceof DownloadedDrawable) {
            DownloadedDrawable downloadedDrawable = (DownloadedDrawable) drawable;
            return downloadedDrawable.getBitmapDownloaderTask();
        }
    }
    return null;
}

From source file:com.example.util.ImageUtils.java

private static BitmapDownloaderTask getBitmapDownloaderTask1(ImageView imageView) {
    if (imageView != null) {
        Drawable drawable = imageView.getDrawable();
        if (drawable == null || !(drawable instanceof DownloadedDrawable1)) {
            return null;
        }//w  w w .j  a v  a2  s.c  o m
        DownloadedDrawable1 downloadedDrawable = (DownloadedDrawable1) drawable;
        return downloadedDrawable.getBitmapDownloaderTask();
    }
    return null;
}

From source file:FacebookImageLoader.java

private static boolean checkImageViewFileName(ImageView imageView, String filename) {
    if (imageView != null) {
        Drawable drawable = imageView.getDrawable();

        if (drawable instanceof LoadedDrawable) {
            LoadedDrawable loadedDrawable = (LoadedDrawable) drawable;
            return loadedDrawable.checkFilname(filename);
        }/* w w  w .  j a v  a 2s . c  o m*/
    }
    return false;
}

From source file:com.chinaLife.claimAssistant.tools.sc_ImageDownloaderId.java

/**
 * @param imageView//  w w w  . j  av  a  2s  .c  o  m
 *            Any imageView
 * @return Retrieve the currently active download task (if any) associated
 *         with this imageView. null if there is no such task.
 */
private static BitmapDownloaderTask getBitmapDownloaderTask(ImageView imageView) {
    System.out.println("uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu");
    if (imageView != null) {
        Drawable drawable = imageView.getDrawable();
        if (drawable instanceof DownloadedDrawable) {
            DownloadedDrawable downloadedDrawable = (DownloadedDrawable) drawable;
            return downloadedDrawable.getBitmapDownloaderTask();
        }
    }
    return null;
}

From source file:com.manning.androidhacks.hack040.util.ImageWorker.java

/**
 * @param imageView//from w  ww .  j a  va  2s .c o m
 *          Any imageView
 * @return Retrieve the currently active work task (if any) associated with
 *         this imageView. null if there is no such task.
 */
static BitmapWorkerTask getBitmapWorkerTask(ImageView imageView) {
    if (imageView != null) {
        final Drawable drawable = imageView.getDrawable();
        if (drawable instanceof AsyncDrawable) {
            final AsyncDrawable asyncDrawable = (AsyncDrawable) drawable;
            return asyncDrawable.getBitmapWorkerTask();
        }
    }
    return null;
}

From source file:com.synconset.ImageFetcher.java

private static long getOrigId(ImageView imageView) {
    if (imageView != null) {
        Drawable drawable = imageView.getDrawable();
        if (drawable instanceof DownloadedDrawable) {
            DownloadedDrawable downloadedDrawable = (DownloadedDrawable) drawable;
            return downloadedDrawable.getOrigId();
        }// w ww .j  a v  a  2  s .  com
    }
    return -1;
}

From source file:com.synconset.ImageFetcher.java

/**
 * @param imageView//from w w w  .  j a  v  a 2 s .c o m
 *            Any imageView
 * @return Retrieve the currently active download task (if any) associated
 *         with this imageView. null if there is no such task.
 */
private static BitmapFetcherTask getBitmapDownloaderTask(ImageView imageView) {
    if (imageView != null) {
        Drawable drawable = imageView.getDrawable();
        if (drawable instanceof DownloadedDrawable) {
            DownloadedDrawable downloadedDrawable = (DownloadedDrawable) drawable;
            return downloadedDrawable.getBitmapDownloaderTask();
        }
    }
    return null;
}