Code example for RoundRectShape

0
	 } 
	  
	@SuppressWarnings("unused") 
	private static ShapeDrawable messageBackground(){
		//RoundRectShape rect = new RoundRectShape( new float[] {15,15, 15,15, 15,15, 15,15}, null, null); 
		RoundRectShape rect = new RoundRectShape( new float[] {0,0, 0,0, 0,0, 0,0}, null, null);
		ShapeDrawable bg = new ShapeDrawable(rect);		
		 
		Paint p = new Paint();
		int [] colors = {0xffC6CACE, 0xff9EA6AF};
		float [] positions = {0.0f,0.5f};
	    p.setShader(new LinearGradient(0, 0, 0, 50, colors, positions,  Shader.TileMode.MIRROR));	    	    
	    bg.getPaint().set(p);
	    bg.getPaint().setAlpha(230); 
	     
	    return bg;
	} 
}