mirror of https://github.com/M66B/FairEmail.git
Letter icons for non latin characters
This commit is contained in:
parent
c87db50333
commit
6a547da17b
|
@ -404,6 +404,12 @@ public class Helper {
|
|||
return df.format(bytes / Math.pow(unit, exp)) + " " + pre + "B";
|
||||
}
|
||||
|
||||
static boolean isPrintableChar(char c) {
|
||||
Character.UnicodeBlock block = Character.UnicodeBlock.of(c);
|
||||
if (block == null || block == Character.UnicodeBlock.SPECIALS)
|
||||
return false;
|
||||
return !Character.isISOControl(c);
|
||||
}
|
||||
// https://issuetracker.google.com/issues/37054851
|
||||
|
||||
static DateFormat getTimeInstance(Context context) {
|
||||
|
|
|
@ -115,7 +115,7 @@ class ImageHelper {
|
|||
String letter = null;
|
||||
for (int i = 0; i < name.length(); i++) {
|
||||
char kar = name.charAt(i);
|
||||
if (Character.isAlphabetic(kar)) {
|
||||
if (Helper.isPrintableChar(kar)) {
|
||||
letter = name.substring(i, i + 1).toUpperCase();
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue