Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can use a Universal Image Loader.</p> <p><a href="https://github.com/nostra13/Android-Universal-Image-Loader" rel="nofollow noreferrer">https://github.com/nostra13/Android-Universal-Image-Loader</a>. </p> <p>Can be used to display bitmaps with rounded corners. Check the Link above.</p> <p>In your custom adapter constructor</p> <pre><code> File cacheDir = StorageUtils.getOwnCacheDirectory(a, "your folder"); // Get singletone instance of ImageLoader imageLoader = ImageLoader.getInstance(); // Create configuration for ImageLoader (all options are optional) ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(a) // You can pass your own memory cache implementation .discCache(new UnlimitedDiscCache(cacheDir)) // You can pass your own disc cache implementation .discCacheFileNameGenerator(new HashCodeFileNameGenerator()) .enableLogging() .build(); // Initialize ImageLoader with created configuration. Do it once. imageLoader.init(config); options = new DisplayImageOptions.Builder() .showStubImage(R.drawable.stub_id)//display stub image .cacheInMemory() .cacheOnDisc() .displayer(new RoundedBitmapDisplayer(20)) //rounded corner bitmap .build(); </code></pre> <p>In your getView()</p> <pre><code> ImageView image=(ImageView)vi.findViewById(R.id.imageview); imageLoader.displayImage(imageurl, image,options);//provide imageurl, imageview and options </code></pre> <p>You can configure with other options to suit your needs.</p> <p>Romain guys image with rounded corners @ <a href="http://www.curious-creature.org/2012/12/11/android-recipe-1-image-with-rounded-corners/" rel="nofollow noreferrer">http://www.curious-creature.org/2012/12/11/android-recipe-1-image-with-rounded-corners/</a></p> <p>Found the below @ <a href="https://stackoverflow.com/questions/2459916/how-to-make-an-imageview-to-have-rounded-corners">How to make an ImageView with rounded corners?</a></p> <p><a href="http://ruibm.com/?p=184" rel="nofollow noreferrer">http://ruibm.com/?p=184</a>.</p> <pre><code>public class ImageHelper { public static Bitmap getRoundedCornerBitmap(Bitmap bitmap, int pixels) { Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap .getHeight(), Config.ARGB_8888); Canvas canvas = new Canvas(output); final int color = 0xff424242; final Paint paint = new Paint(); final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()); final RectF rectF = new RectF(rect); final float roundPx = pixels; paint.setAntiAlias(true); canvas.drawARGB(0, 0, 0, 0); paint.setColor(color); canvas.drawRoundRect(rectF, roundPx, roundPx, paint); paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN)); canvas.drawBitmap(bitmap, rect, rect, paint); return output; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload