Android examples for Graphics:Drawable
get Label Color Drawable
import android.graphics.drawable.Drawable; import android.graphics.drawable.ShapeDrawable; import android.graphics.drawable.shapes.RoundRectShape; public class Main{ private static final int INTRINSIC_SHAPE_SIZE = 52; public static Drawable getLabelColorDrawable(int index) { float[] r = new float[] { 4, 4, 4, 4, 4, 4, 4, 4 }; ShapeDrawable shape = new ShapeDrawable(new RoundRectShape(r, null, null));//from w w w . j av a2s . c o m shape.setIntrinsicWidth(INTRINSIC_SHAPE_SIZE); shape.setIntrinsicHeight(INTRINSIC_SHAPE_SIZE); //shape.getPaint().setColor(); return shape; } }