/ Published in: Java
This creates a rounded rectangle (10x20) with a given color (such as #AABBCC) as a drawable, which you can later use anywhere (I use it in TextView.setCompoundDrawables).
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
ShapeDrawable drawable = new ShapeDrawable(); drawable.setBounds(0, 0, 10, 20); float radius = 4; float[] radii = new float[] {radius, radius, radius, radius, radius, radius, radius, radius}; drawable.setShape(shape); return drawable; }