I want to create icons similary to the google contact app.
I wish to provide a background color and a text and generate the icon.
What I'm trying at the moment is something like the solution here.
I'm using the CircularImageView external library and it seems to be the problem. In fact if I try to do:
CircularImageView imageView;
....
Drawable d = new TextDrawable("My Text", mycolor, textSize);
imageView.setImageDrawable(d);
I get this error:
java.lang.IllegalArgumentException: width and height must be > 0
at android.graphics.Bitmap.createBitmap(Bitmap.java:829)
at android.graphics.Bitmap.createBitmap(Bitmap.java:808)
at android.graphics.Bitmap.createBitmap(Bitmap.java:775)
at com.pkmmte.view.CircularImageView.drawableToBitmap(CircularImageView.java:327)
while if I use the standard ImageView it works. Any advice?