Code example for ArcShape

-1
		int randomNumber = r.nextInt(4);
		 
		// in function of the random number, we create either a ArcShape, or a RoundRectShape, or a RectShape or a OvalShape 
		if (randomNumber == 0) 
		{  
			mDrawable = new ShapeDrawable(new ArcShape(r.nextInt(360),r.nextInt(360)));
		} 
		else if (randomNumber == 1) 
		{  
			float[] roundedCorner = new float[] { r.nextInt(400), r.nextInt(400), r.nextInt(400), r.nextInt(400), 
					r.nextInt(400), r.nextInt(400), r.nextInt(400), r.nextInt(400) };
			 
			mDrawable = new ShapeDrawable(new RoundRectShape(roundedCorner, null, null));
		} 
		else if (randomNumber == 2)
		{ 
			// rectangle figure 
			mDrawable = new ShapeDrawable(new RectShape());
		} 
		else if (randomNumber == 3)
Stop searching for code, let great code find you!  Add Codota to your java IDE