mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-21 13:47:04 +00:00
Check for letter instead of printable
This commit is contained in:
parent
ae184eaa91
commit
af97e9e0f4
1 changed files with 4 additions and 3 deletions
|
@ -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…
Reference in a new issue