@@ -0,0 +1,2147 @@
+import android.content.Context;%0Aimport android.graphics.Bitmap;%0Aimport android.graphics.Bitmap.Config;%0Aimport android.graphics.Canvas;%0Aimport android.graphics.Color;%0Aimport android.graphics.Paint;%0Aimport android.graphics.PorterDuff.Mode;%0Aimport android.graphics.PorterDuffXfermode;%0Aimport android.graphics.Rect;%0Aimport android.graphics.drawable.BitmapDrawable;%0Aimport android.graphics.drawable.Drawable;%0A%0Aimport android.util.AttributeSet;%0Aimport android.util.Log;%0Aimport android.widget.ImageView;%0A%0Apublic class RoundedImageView extends ImageView %7B%0A%0A%09public RoundedImageView(Context context) %7B%0A%09%09super(context);%0A%09%7D%0A%0A%09public RoundedImageView(Context context, AttributeSet attrs) %7B%0A%09%09super(context, attrs);%0A%09%7D%0A%0A%09public RoundedImageView(Context context, AttributeSet attrs, int defStyle) %7B%0A%09%09super(context, attrs, defStyle);%0A%09%7D%0A%0A%09@Override%0A%09protected void onDraw(Canvas canvas) %7B%0A%0A%09%09Drawable drawable = getDrawable();%0A%0A%09%09if (drawable == null) %7B%0A%09%09%09return;%0A%09%09%7D%0A%0A%09%09if (getWidth() == 0 %7C%7C getHeight() == 0) %7B%0A%09%09%09return; %0A%09%09%7D%0A%09%09Bitmap b = ((BitmapDrawable) drawable).getBitmap() ;%0A%09%09Bitmap bitmap = b.copy(Bitmap.Config.ARGB_8888, true);%0A%0A%09%09int w = getWidth(), h = getHeight();%0A%0A%09%09Bitmap roundBitmap =  getCroppedBitmap(bitmap, w);%0A%09%09canvas.drawBitmap(roundBitmap, 0,0, null);%0A%0A%09%7D%0A%0A%09public static Bitmap getCroppedBitmap(Bitmap bmp, int radius) %7B%0A%09%09Bitmap sbmp;%0A%09%09if(bmp.getWidth() != radius %7C%7C bmp.getHeight() != radius)%0A%09%09%09sbmp = Bitmap.createScaledBitmap(bmp, radius, radius, false);%0A%09%09else%0A%09%09%09sbmp = bmp;%0A%09%09Bitmap output = Bitmap.createBitmap(sbmp.getWidth(),%0A%09%09%09%09sbmp.getHeight(), Config.ARGB_8888);%0A%09%09Canvas canvas = new Canvas(output);%0A%0A%09%09final int color = 0xffa19774;%0A%09%09final Paint paint = new Paint();%0A%09%09final Rect rect = new Rect(0, 0, sbmp.getWidth(), sbmp.getHeight());%0A%0A%09%09paint.setAntiAlias(true);%0A%09%09paint.setFilterBitmap(true);%0A%09%09paint.setDither(true);%0A%09%09canvas.drawARGB(0, 0, 0, 0);%0A%09%09paint.setColor(Color.parseColor(%22#BAB399%22));%0A%09%09canvas.drawCircle(sbmp.getWidth() / 2, sbmp.getHeight() / 2,%0A%09%09%09%0950, paint);%0A%09%09%0A%09%09paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN));%0A%09%09canvas.drawBitmap(sbmp, rect, rect, paint);%0A%0A%09%09return output;%0A%09%7D%0A%0A%7D%0A

Create RoundedImageView.java