Check for letter instead of printable

pull/168/head
M66B 5 years ago
parent ae184eaa91
commit af97e9e0f4

@ -113,15 +113,16 @@ class ImageHelper {
name = email;
String letter = null;
for (int i = 0; i < name.length(); i++) {
int len = name.length();
for (int i = 0; i < len; i++) {
char kar = name.charAt(i);
if (Helper.isPrintableChar(kar)) {
if (Character.isLetter(kar)) {
letter = name.substring(i, i + 1).toUpperCase();
break;
}
}
if (letter == null)
return null;
letter = (len > 0 ? name.substring(0, 1) : "?");
float h = Math.abs(email.hashCode()) % 360f;
return generateLetterIcon(letter, h, size, context);

Loading…
Cancel
Save