title: Android Create ImageView with 3 rounded and 1 straight corner
body: <p>I want to create an image view with 3 rounded and one straight corner.</p>
  
  <p>Setting background drawable doesn't work and I did find some java code but it only rounds 2 corners or 4 and not 3</p>
  
  <pre><code>Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap
  .getHeight(), Bitmap.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(PorterDuff.Mode.SRC_IN));
  canvas.drawBitmap(bitmap, rect, rect, paint);
  
  return output;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/2SUVo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2SUVo.png" alt="The resultant image should be as attached"></a></p>