Example usage for android.widget ImageView setMinimumHeight

List of usage examples for android.widget ImageView setMinimumHeight

Introduction

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

Prototype

@RemotableViewMethod
public void setMinimumHeight(int minHeight) 

Source Link

Document

Sets the minimum height of the view.

Usage

From source file:com.example.web.image.ImageDownloader.java

/**
 * Same as download but the image is always downloaded and the cache is not used.
 * Kept private at the moment as its interest is not clear.
 *//*  w ww  . j  a v  a 2  s .c  o  m*/
private void forceDownload(String url, ImageView imageView) {
    // State sanity: url is guaranteed to never be null in DownloadedDrawable and cache keys.
    if (url == null) {
        imageView.setImageDrawable(null);
        return;
    }

    if (cancelPotentialDownload(url, imageView)) {
        switch (mode) {
        case NO_ASYNC_TASK:
            Bitmap bitmap = downloadBitmap(url);
            imageCache.addBitmapToCache(url, bitmap);
            if (this.progressBar != null) {
                this.progressBar.setVisibility(View.GONE);
            }
            imageView.setImageBitmap(bitmap);
            break;

        case NO_DOWNLOADED_DRAWABLE:
            imageView.setMinimumHeight(156);
            BitmapDownloaderTask task = new BitmapDownloaderTask(imageView);
            task.execute(url);
            break;

        case CORRECT:
            task = new BitmapDownloaderTask(imageView);
            DownloadedDrawable downloadedDrawable = new DownloadedDrawable(task);
            imageView.setImageDrawable(downloadedDrawable);
            //                    imageView.setMinimumHeight(156);
            //                    imageView.setMinimumWidth(156);
            task.execute(url);
            break;
        }
    }
}

From source file:com.kiddobloom.bucketlist.ImageDownloader.java

/**
 * Same as download but the image is always downloaded and the cache is not
 * used. Kept private at the moment as its interest is not clear.
 *//*w  ww  .  j a v a  2 s. co  m*/
private void forceDownload(String url, ImageView imageView) {
    // State sanity: url is guaranteed to never be null in
    // DownloadedDrawable and cache keys.
    //Log.d("tag", "download " + url + " imageView: " + imageView);

    if (url == null) {
        imageView.setImageDrawable(null);
        return;
    }

    if (cancelPotentialDownload(url, imageView)) {
        switch (mode) {
        case NO_ASYNC_TASK:
            Bitmap bitmap = downloadBitmap(url);
            addBitmapToCache(url, bitmap);
            imageView.setImageBitmap(bitmap);
            break;

        case NO_DOWNLOADED_DRAWABLE:
            imageView.setMinimumHeight(156);
            BitmapDownloaderTask task = new BitmapDownloaderTask(imageView);
            task.execute(url);
            break;

        case CORRECT:
            task = new BitmapDownloaderTask(imageView);
            DownloadedDrawable downloadedDrawable = new DownloadedDrawable(task);
            imageView.setImageDrawable(downloadedDrawable);
            imageView.setMinimumHeight(156);
            task.execute(url);
            break;
        }
    }
}

From source file:com.baksu.screenbroadcast2.ImageDownloader.java

/**
 * Same as download but the image is always downloaded and the cache is not used.
 * Kept private at the moment as its interest is not clear.
 */// www .j a  v  a2  s  .c o  m
private void forceDownload(String url, ImageView imageView) {
    // State sanity: url is guaranteed to never be null in DownloadedDrawable and cache keys.
    if (url == null) {
        Log.i("imageUp", "URL? ?");
        imageView.setImageDrawable(null);
        return;
    }

    if (cancelPotentialDownload(url, imageView)) {
        switch (mode) {
        case NO_ASYNC_TASK:
            Log.i("imageUp", "NO_ASYNC_TASK");
            Bitmap bitmap = downloadBitmap(url);
            addBitmapToCache(url, bitmap);
            imageView.setImageBitmap(bitmap);
            break;

        case NO_DOWNLOADED_DRAWABLE:
            Log.i("imageUp", "NO_DOWNLOADED_DRAWABLE");
            imageView.setMinimumHeight(156);
            BitmapDownloaderTask task = new BitmapDownloaderTask(imageView);
            task.execute(url);
            break;

        case CORRECT:
            Log.i("imageUp", "CORRECT");
            task = new BitmapDownloaderTask(imageView);
            DownloadedDrawable downloadedDrawable = new DownloadedDrawable(task);
            imageView.setImageDrawable(downloadedDrawable);
            imageView.setMinimumHeight(156);
            task.execute(url);
            break;
        }
    }
}

From source file:com.waveface.installer.util.ImageDownloader.java

/**
 * Same as download but the image is always downloaded and the cache is not used.
 * Kept private at the moment as its interest is not clear.
 *///from  w  w w .j a  v a 2s .com
private void forceDownload(String url, ImageView imageView, int resId) {
    // State sanity: url is guaranteed to never be null in DownloadedDrawable and cache keys.
    BitmapDrawable draw = (BitmapDrawable) mContext.getResources().getDrawable(resId);
    Bitmap bm = draw.getBitmap();
    if (url == null) {
        imageView.setImageBitmap(bm);
        return;
    }

    if (cancelPotentialDownload(url, imageView)) {
        switch (mode) {
        case NO_ASYNC_TASK:
            Bitmap bitmap = downloadBitmap(url);
            addBitmapToCache(url, bitmap);
            imageView.setImageBitmap(bitmap);
            break;

        case NO_DOWNLOADED_DRAWABLE:
            imageView.setMinimumHeight(156);
            BitmapDownloaderTask task = new BitmapDownloaderTask(imageView);
            task.execute(url);
            break;

        case CORRECT:
            task = new BitmapDownloaderTask(imageView);

            DownloadedDrawable downloadedDrawable = new DownloadedDrawable(task, bm);
            imageView.setImageDrawable(downloadedDrawable);
            task.execute(url);
            break;
        }
    }
}

From source file:com.c4mprod.utils.ImageDownloader.java

/**
 * Same as download but the image is always downloaded and the cache is not used.
 * Kept private at the moment as its interest is not clear.
 *///from  w ww  . jav  a2  s  .co m
private void forceDownload(String url, ImageView imageView) {
    // State sanity: url is guaranteed to never be null in DownloadedDrawable and cache keys.
    if (url == null) {
        imageView.setImageDrawable(null);
        return;
    }

    if (cancelPotentialDownload(url, imageView)) {
        switch (mode) {
        case NO_ASYNC_TASK:
            Bitmap bitmap = downloadBitmap(url);
            addBitmapToCache(url, bitmap);
            imageView.setImageBitmap(bitmap);
            break;

        case NO_DOWNLOADED_DRAWABLE:
            imageView.setMinimumHeight(156);
            BitmapDownloaderTask task = new BitmapDownloaderTask(imageView);
            task.execute(url);
            break;

        case CORRECT:
            task = new BitmapDownloaderTask(imageView);
            imageView.setBackgroundDrawable((default_img));
            DownloadedDrawable downloadedDrawable = new DownloadedDrawable(task);
            imageView.setImageDrawable(downloadedDrawable);

            imageView.setMinimumHeight(156);
            task.execute(url);
            break;
        }
    }
}

From source file:com.binomed.showtime.android.util.images.ImageDownloader.java

/**
 * Same as download but the image is always downloaded and the cache is not used. Kept private at the moment as its interest is not clear.
 *//*from   w  ww .  j  a  va  2s  .  c  o  m*/
private void forceDownload(String url, ImageView imageView, Context context) {
    // State sanity: url is guaranteed to never be null in DownloadedDrawable and cache keys.
    if (url == null) {
        imageView.setImageDrawable(null);
        return;
    }

    Bitmap image = getFileDrawable(url);
    if (image != null) {
        imageView.setImageBitmap(image);
    } else if (cancelPotentialDownload(url, imageView)) {
        switch (mode) {
        case NO_ASYNC_TASK:
            Bitmap bitmap = downloadBitmap(url);
            addBitmapToCache(url, bitmap);
            imageView.setImageBitmap(bitmap);
            break;

        case NO_DOWNLOADED_DRAWABLE:
            imageView.setMinimumHeight(156);
            BitmapDownloaderTask task = new BitmapDownloaderTask(imageView);
            task.execute(url);
            break;

        case CORRECT:
            task = new BitmapDownloaderTask(imageView);
            DownloadedDrawable downloadedDrawable = new DownloadedDrawable(task, context);
            imageView.setImageDrawable(downloadedDrawable);
            imageView.setMinimumHeight(156);
            task.execute(url);
            break;
        }
    }
}

From source file:com.lastorder.pushnotifications.data.ImageDownloader.java

/**
 * Same as download but the image is always downloaded and the cache is not used.
 * Kept private at the moment as its interest is not clear.
 *///from   w  w  w .java2  s .  c  o  m
private void forceDownload(String url, ImageView imageView, ProgressBar bar) {
    // State sanity: url is guaranteed to never be null in DownloadedDrawable and cache keys.
    if (url == null || !url.contains(".") || url.length() <= 6 || url.contains("null")) {
        bar.setVisibility(8);
        imageView.setImageResource(R.drawable.ic_launcher);
        imageView.setVisibility(0);
        return;
    }

    if (cancelPotentialDownload(url, imageView)) {
        BitmapDownloaderTask task = new BitmapDownloaderTask(imageView, bar);
        DownloadedDrawable downloadedDrawable = new DownloadedDrawable(task);
        imageView.setImageDrawable(downloadedDrawable);
        imageView.setMinimumHeight(156);
        task.execute(url);
    }
}

From source file:se.dw.okhttpwrapper.ImageRequest.java

/**
 * Same as download but the image is always downloaded and the cache is not used.
 * Kept private at the moment as its interest is not clear.
 *///from   www.  jav a2  s  . co  m
private void forceDownload(String url, ImageView imageView) {
    // State sanity: url is guaranteed to never be null in DownloadedDrawable and cache keys.
    if (url == null) {
        imageView.setImageDrawable(null);
        return;
    }

    if (cancelPotentialDownload(url, imageView)) {

        switch (mode) {
        case NO_ASYNC_TASK:
            Bitmap bitmap = downloadBitmap(url);
            addBitmapToCache(url, bitmap);
            imageView.setImageBitmap(bitmap);
            break;

        case CORRECT:
            BitmapDownloaderTask task = new BitmapDownloaderTask(imageView);
            DownloadedDrawable downloadedDrawable = new DownloadedDrawable(task);
            imageView.setImageDrawable(downloadedDrawable);
            imageView.setMinimumHeight(156);
            task.execute(url);
            break;
        }

    }
}

From source file:com.secretlisa.lib.utils.BaseImageLoader.java

private void forceDownload(String url, ImageView imageView) {
    if (url == null) {
        imageView.setImageDrawable(null);
        return;//from w ww .j a  va 2s  . co  m
    }

    if (cancelPotentialDownload(url, imageView)) {
        BitmapDownloaderTask task = null;
        task = new BitmapDownloaderTask(imageView, url);
        Object obj = imageView.getTag();
        int resId = -1;
        Bitmap bitmapDefault = null;
        if (obj != null) {
            resId = (Integer) obj;
            bitmapDefault = BitmapFactory.decodeResource(imageView.getResources(), resId);
        }
        DownloadedDrawable downloadedDrawable = new DownloadedDrawable(bitmapDefault, task);
        imageView.setImageDrawable(downloadedDrawable);
        // imageView.setBackgroundColor(Color.WHITE);
        //         imageView.setBackgroundResource(R.drawable.wallpaper_bg);
        imageView.setMinimumHeight(156);
        task.execute();
    }
}

From source file:com.ndn.menurandom.ImageDownloader.java

/**
 * Same as download but the image is always downloaded and the cache is not used.
 * Kept private at the moment as its interest is not clear.
 *//* w  w  w.  j a v  a  2s.  c om*/
private void forceDownload(String url, ImageView imageView) {
    // State sanity: url is guaranteed to never be null in DownloadedDrawable and cache keys.
    if (url == null) {
        imageView.setImageDrawable(null);
        return;
    }

    if (cancelPotentialDownload(url, imageView)) {
        BitmapDownloaderTask task = new BitmapDownloaderTask(imageView);
        DownloadedDrawable downloadedDrawable = null;
        if (mContext != null) {
            Resources res = mContext.getResources();
            Drawable d = res.getDrawable(mDefaultImageResourceId);
            if (d instanceof BitmapDrawable) {
                Bitmap bitmap = ((BitmapDrawable) d).getBitmap();
                downloadedDrawable = new DownloadedDrawable(res, bitmap, task);
            }
        }

        imageView.setImageDrawable(downloadedDrawable);
        imageView.setMinimumHeight(156);
        task.execute(url);
    }
}