Github's or Stackoverflow's identicons don't look good in circular profile pictures. Circular-identicons will generate gorgeous circular default profile pictures for your Android app.
The identicons are circular kaleidoscopes.
Place IdenticonFactory.java in your project. The method to create an identicon is createIdenticon(Bitmap original, int foregroundColor, int backgroundColor)
.
Bitmap original = BitmapFactory.decodeResource(getResources(), R.drawable.kaleidoscope_source);
Bitmap identicon = IdenticonFactory.createIdenticon(original, Color.BLACK, Color.WHITE);
// The identicon will have the same size as the original
You will need a bitmap that is used as a source to create the kaleidoscopic identicon. You can use the bitmap kaleidoscope_source.png
from the sample project:
If you want to use your own source image, make sure to make it circular with a transparent background.
If you would like to turn any object into an identicon, you can set the seed of random
in createIdenticon(...)
with the object's hash value.