Square identicons

pull/162/head
M66B 5 years ago
parent 759683457f
commit b1766afd0b

@ -161,15 +161,17 @@ public class ContactInfo {
} }
} }
boolean identicon = false;
if (info.bitmap == null) { if (info.bitmap == null) {
int dp = Helper.dp2pixels(context, 48); int dp = Helper.dp2pixels(context, 48);
boolean dark = Helper.isDarkTheme(context); boolean dark = Helper.isDarkTheme(context);
boolean generated = prefs.getBoolean("generated_icons", true); boolean generated = prefs.getBoolean("generated_icons", true);
if (generated) { if (generated) {
boolean identicons = prefs.getBoolean("identicons", false); boolean identicons = prefs.getBoolean("identicons", false);
if (identicons) if (identicons) {
identicon = true;
info.bitmap = Identicon.icon(key, dp, 5, dark); info.bitmap = Identicon.icon(key, dp, 5, dark);
else } else
info.bitmap = Identicon.letter(key, dp, dark); info.bitmap = Identicon.letter(key, dp, dark);
} }
} }
@ -198,7 +200,7 @@ public class ContactInfo {
paint.setAntiAlias(true); paint.setAntiAlias(true);
canvas.drawARGB(0, 0, 0, 0); canvas.drawARGB(0, 0, 0, 0);
paint.setColor(Color.GRAY); paint.setColor(Color.GRAY);
if (circular) if (circular && !identicon)
canvas.drawOval(new RectF(dest), paint); canvas.drawOval(new RectF(dest), paint);
else { else {
float radius = Helper.dp2pixels(context, 3); float radius = Helper.dp2pixels(context, 3);

Loading…
Cancel
Save