Android – How to add rounded corner to a drawable I’m using as a background in Android

androidlayoutrounded-corners

I have a specific drawable that I use as background in my app. It is not a solid color.
Now I want to add rounded corners to this drawable.

I only found the rounded corner available in a shape with a gradient or a solid color as a background but not another drawable.

Is there another easy way of adding rounded corners to a drawable?

Best Answer

Use AQuery to make Drawable or Downloaded images rounded corners.

http://code.google.com/p/android-query/wiki/ImageLoading

Note : This is very effective in doing asynchronous task with images and provides lots of featres.

Download API from here : http://code.google.com/p/android-query/downloads/list

Code to do rounded Corners of an image :

AQuery aq = new AQuery(this);

// Image URL to download
String url = "http://www.vikispot.com/z/images/vikispot/android-w.png";

ImageOptions options = new ImageOptions();
options.round = 15;

aq.id(R.id.image).image(url, options);