Code example for RoundRectShape

0
	 
	public IconImageView(Context context) {
		super(context);
		 
        if(mRoundShape == null){
        	mRoundShape = new ShapeDrawable(new RoundRectShape(new float[] { 5, 5, 5, 5, 5, 5, 5, 5 }, null, null));
        	mRoundShape.setBounds(0, 0, 48, 48);
        } 
        
	} 
 
	public void setImageBitmap(Bitmap bm){
		if(bm != null){
			mRoundShape.getPaint().setShader(null);
			mShader = new BitmapShader(bm, Shader.TileMode.REPEAT ,Shader.TileMode.REPEAT);
			mRoundShape.getPaint().setShader(mShader);
		}else{ 
			mShader = null;
			super.setImageBitmap(bm);
		} 
	}