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.test.weatherapp.adapters.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 av  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);
            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.quipmate.loadingBitmaps.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  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);
            addBitmapToCache(url, bitmap);
            imageView.setImageBitmap(bitmap);
            break;

        case NO_DOWNLOADED_DRAWABLE:
            imageView.setMinimumHeight(minHeight);
            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(minHeight);
            task.execute(url);
            break;
        }
    }
}

From source file:cn.huaxingtan.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  ww. j  a  v a 2s.  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);
            addBitmapToCache(url, bitmap);
            imageView.setImageBitmap(bitmap);
            break;

        case NO_DOWNLOADED_DRAWABLE:
            imageView.setMinimumHeight(156);
            BitmapDownloaderTask task = new BitmapDownloaderTask(imageView);
            task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, url);
            break;

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

From source file:com.cms.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 www . j  a va 2s  .  com*/
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);
            DownloadedDrawable downloadedDrawable = new DownloadedDrawable(task);
            imageView.setImageDrawable(downloadedDrawable);
            imageView.setMinimumHeight(156);
            task.execute(url);
            break;
        }
    }
}

From source file:net.peterkuterna.android.apps.devoxxfrsched.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 a2s  .  c o m
private void forceDownload(String url, ImageView imageView, int emptyResId) {
    // 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 = new DownloadedDrawable(mContext, task, emptyResId);
        imageView.setImageDrawable(downloadedDrawable);
        imageView.setMinimumHeight(156);
        task.execute(url);
    }
}

From source file:net.sinoace.library.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.  ja v  a 2  s. com
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);
        task = new BitmapDownloaderTask(imageView);
        DownloadedDrawable downloadedDrawable = new DownloadedDrawable(task);
        imageView.setImageDrawable(downloadedDrawable);
        imageView.setMinimumHeight(156);
        task.execute(url);

    }
}

From source file:com.synconset.ImageFetcher.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  va2 s .  co m*/
private void forceDownload(Integer position, ImageView imageView, int rotate) {
    if (position == null) {
        imageView.setImageDrawable(null);
        return;
    }

    if (cancelPotentialDownload(position, imageView)) {
        BitmapFetcherTask task = new BitmapFetcherTask(imageView.getContext(), imageView, rotate);
        DownloadedDrawable downloadedDrawable = new DownloadedDrawable(imageView.getContext(), task, origId);
        imageView.setImageDrawable(downloadedDrawable);
        imageView.setMinimumHeight(colWidth);

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
            task.executeOnExecutor(executor, position);
        } else {
            try {
                task.execute(position);
            } catch (RejectedExecutionException e) {
                // Oh :(
            }
        }

    }
}

From source file:com.jgraves.achievementunlocked.AchievementsList_Fragment.java

private void addAchievementToList(Long id, String name, int points) {
    Log.i(ExploraApp.TAG, "Adding achievement image request of id " + id + " with height, " + imageViewHeight);
    FrameLayout fl = new FrameLayout(getActivity());
    touchMap.put(fl, id);/* w  w  w . j  a  v a2s.co  m*/
    fl.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Long id = touchMap.get(v);
            Log.i(ExploraApp.TAG, "TOUCHED " + id);
            Intent intent = new Intent(getActivity(), Activity_AchievementInfo.class);
            intent.putExtra("achievement_id", Long.toString(id));
            startActivity(intent);
        }
    });
    TextView tv_name = new TextView(getActivity());
    TextView tv_points = new TextView(getActivity());
    ImageView iv = new ImageView(getActivity());
    fl.setMinimumHeight(imageViewHeight);
    fl.setMinimumWidth(ExploraApp.screenWidth);
    robotoTypeface = Typeface.createFromAsset(getActivity().getAssets(), "Roboto-Thin.ttf");
    tv_name.setText(name);
    tv_name.setTextSize(15f);
    tv_points.setTextSize(15f);
    tv_name.setTypeface(robotoTypeface);
    tv_points.setTypeface(robotoTypeface);
    tv_points.setText(Integer.toString(points));
    tv_points.setGravity(Gravity.RIGHT);
    tv_points.setTextColor(Color.WHITE);
    tv_name.setTextColor(Color.WHITE);
    iv.setMinimumHeight(imageViewHeight);
    iv.setMinimumWidth(ExploraApp.screenWidth);
    fl.addView(iv);
    fl.addView(tv_name);
    fl.addView(tv_points);
    ll_images_container.addView(fl);
    sv_images.bringChildToFront(mQuickReturnView);
    DefaultImageListener listener = new DefaultImageListener(iv);
    ImageRequest imageRequest = new ImageRequest(
            ExploraApp.url_main + "/achievement/" + id + "/photo?y=" + imageViewHeight + "&x="
                    + ExploraApp.screenWidth,
            listener, ExploraApp.screenWidth, imageViewHeight, Bitmap.Config.ARGB_8888, listener);
    ExploraApp.mRequestQueue.add(imageRequest);
}

From source file:com.bxduan.apps.secretgallery.ImageDownloader.java

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;//from  w  w  w .  j  a va  2  s  . com
    }

    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.wanpaijie.www.http.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 a2  s  .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)) {
        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.setImageDrawable(this.current.getResources().getDrawable(R.drawable.index_topic_default));
            imageView.setMinimumHeight(225);
            imageView.setMinimumHeight(130);
            task.execute(url);
            break;
        }
    }
}